How many table partitions is too many in Postgres?

后端 未结 4 1876
攒了一身酷
攒了一身酷 2021-02-05 04:17

I\'m partitioning a very large table that contains temporal data, and considering to what granularity I should make the partitions. The Postgres partition documentation claims

4条回答
  •  不思量自难忘°
    2021-02-05 04:44

    If you don't want to trust the PostgreSQL developers who wrote the code, then I recommend that you simply try it yourself and run a few example queries with explain analyze and time them using different partition schemes. Your specific hardware and software configuration is likely to dominate any answer in any case.

    I'm assuming that the row optimization cache which the query optimizer uses to determine what joins and restrictions to use is stored with each partition, so it probably needs to load and read parts of each partition to plan the query.

提交回复
热议问题