Rural Hunter <ruralhunter@gmail.com> writes:
> I have a table partitioned with about 60 children tables. Now I found
> the planning time of simple query with partition key are very slow.
> ...
> You can see the timing output that the actual run time of the 'explain
> analyze' is 30 seconds while the select sql itself takes only 3 ms. My
> partition key is on article.pid and the constraint is simple like this:
> CONSTRAINT article_88_pid_check CHECK (pid = 88). What's wrong and how
> can I improve the planning performance?
[ shrug... ] Insufficient data. When I try a simple test case based on
what you've told us, I get planning times of a couple of milliseconds.
I can think of contributing factors that would increase that, but not by
four orders of magnitude. So there's something very significant that
you've left out. Can you construct a self-contained test case that's
this slow?
regards, tom lane