Re: Excessive planner time for some queries with high statistics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stuart Bishop <stuart(at)stuartbishop(dot)net>
Cc: "List, Postgres" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Excessive planner time for some queries with high statistics
Date: 2011-11-04 18:26:17
Message-ID: 12384.1320431177@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stuart Bishop <stuart(at)stuartbishop(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martín Marqués 2011-11-04 18:31:36 Re: 9.1 replication on different arch
Previous Message Adam Cornett 2011-11-04 18:09:51 Re: Explicitly adding a table to a schema.