Re: [GENERAL] Excessive planner time for some queries with high statistics

2011-11-05 Thread Stuart Bishop
On Sat, Nov 5, 2011 at 1:26 AM, Tom Lane wrote: > Stuart Bishop writes: >> We also found this problem did not occur on one of our staging >> systems, which had a default statistics target of 100. Lowering the >> statistics on the relavant columns from 1000 to 100 and reanalyzing >> made the overh

Re: [GENERAL] Excessive planner time for some queries with high statistics

2011-11-04 Thread Tom Lane
Stuart Bishop writes: > We also found this problem did not occur on one of our staging > systems, which had a default statistics target of 100. Lowering the > statistics on the relavant columns from 1000 to 100 and reanalyzing > made the overhead unnoticeable. eqjoinsel() is O(N^2) in the number

[GENERAL] Excessive planner time for some queries with high statistics

2011-11-04 Thread Stuart Bishop
I'm seeing some queries, possibly to do with using a UNIQUE index, that have fast time reported by EXPLAIN ANALYZE but the actual time as reported by \timing at 150ms+ higher. PostgreSQL 8.4.9 Simple example queries: http://paste.ubuntu.com/726131/ Table definitions: http://paste.ubuntu.com/72619