Q:

Terrible performance degradation in postgreSQL when i created too many partitions

I don't understand why occur performance degradation in postgreSQL when i created too many partitions for a 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 is the test query and the result of explain.
select count(*) from test_sql_stat_daily
where 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 to overcome this situation. 
And there is no effect for this situation.

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

A:

The documented approach is "Don't do that."

All constraints on all partitions of the master table are examined
  during constraint exclusion, so large numbers of partitions are likely
  to increase query planning time considerably. Partitioning using these
  techniques will work well with up to perhaps a hundred partitions;
  don't try to use many thousands of partitions. 

Emphasis added.
I'd try to get the number of partitions down to 1000 if I were you.

