Re: Excessive planner time for some queries with high statistics - Mailing list pgsql-general

From Tom Lane
Subject Re: Excessive planner time for some queries with high statistics
Date
Msg-id 12384.1320431177@sss.pgh.pa.us
Whole thread Raw
In response to Excessive planner time for some queries with high statistics  (Stuart Bishop <stuart@stuartbishop.net>)
Responses Re: Excessive planner time for some queries with high statistics  (Stuart Bishop <stuart@stuartbishop.net>)
List pgsql-general
Stuart Bishop <stuart@stuartbishop.net> 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 of entries in the MCV lists.
I wouldn't expect this to be an issue unless comparison is pretty
expensive, but maybe those are string not integer columns?

> Thoughts on IRC was this might be a regression in 8.4.9, but I haven't
> got earlier versions to test with at the moment.

eqjoinsel has worked like that for many years.  Are you claiming you
didn't see this behavior in a prior release?  If so, which one?

            regards, tom lane

pgsql-general by date:

Previous
From: Adam Cornett
Date:
Subject: Re: Explicitly adding a table to a schema.
Next
From: Martín Marqués
Date:
Subject: Re: 9.1 replication on different arch