Historian Table Partitioning

I haven’t had to optimize the Historian, as I don’t ever put millions of rows in it. /-: But I’d start with studying all of the indices on the tables to make sure the queries are optimizable and optimization statistics are present. I would make sure there is a BRIN index on the t_stamp column, and a separate b-tree index on the tag id column. Recommended indexing would vary with DB brand, of course. Larger partitions should be tolerable with proper indices.

The EXPLAIN ANALYZE … command will show you what the optimizer decides and how well it works. I wouldn’t use anything older than PostgreSQL 9.5.