Terrible performance degradation in postgreSQL when i created too many partitions -



Terrible performance degradation in postgreSQL when i created too many partitions -

i don't understand why occur performance degradation in postgresql when created many partitions table.

100 -> 0.05 sec 200 -> 0.07 sec 400 -> 0.16 sec 600 -> 0.24 sec 800 -> 0.29 sec 1,000 -> 0.37 sec 1,500 -> 0.62 sec 2,000 -> 0.82 sec 4,000 -> 1.86 sec 10,000 -> 7.62 sec

below test query , result of explain.

select count(*) test_sql_stat_daily partition_key=1000000099; aggregate (cost=20000000011.88..20000000011.89 rows=1 width=0)" output: count(*)" -> append (cost=10000000000.00..20000000011.88 rows=2 width=0)" -> seq scan on test_sql_stat_daily (cost=10000000000.00..10000000000.00 rows=1 width=0)" filter: (test_sql_stat_daily.partition_key = 1000000099)" -> seq scan on test_sql_stat_daily_p0000000099 test_sql_stat_daily (cost=10000000000.00..10000000011.88 rows=1 width=0)" filter: (test_sql_stat_daily.partition_key = 1000000099)"

i want overcome situation. , there no effect situation.

increase size of shared buffer create index primary key constraint (and create index) check constraint column set constraint_exclusion = on

the documented approach "don't that."

all constraints on partitions of master table examined during constraint exclusion, big numbers of partitions increment query planning time considerably. partitioning using these techniques work perhaps hundred partitions; don't seek utilize many thousands of partitions.

emphasis added.

i'd seek number of partitions downwards 1000 if you.

performance postgresql

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -