Le 05/04/2013 16:17, Tom Lane a écrit :
What have you got the statistics targets set to in this database?
Ok, the problem definitely comes from the default_statistics_target which is obviously too high on the database.
I have experimented with explain on queries with another set of 4 joined tables.
In my first attempt, explain took more than 4 seconds (!)Then I have set default_statistics_target to 100 and analyzed the 4 tables. Explain took a few ms. Restored default_statistics_target to 5000, analyzed again. Explain took 1.8 seconds.
So, I seem to have two related problems: statistics are somewhat bloated (as re-analyzing with same target takes the explain time from 4 sec down to 1.8 sec). And the target is far too high (as default target value take analyse down to a few ms).
Now... can someone help me understand what happens ? Where can I look (in pg_stats ?) to see the source of the problem ? maybe a column with a huge list of different values the palnner has to parse ?
Regards, Franck
Attachment:
smime.p7s
Description: Signature cryptographique S/MIME