Re: Rewriting DISTINCT and losing performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-performance(at)nullmx(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Rewriting DISTINCT and losing performance
Date: 2007-05-21 21:32:05
Message-ID: 29045.1179783125@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Chuck D." <pgsql-performance(at)nullmx(dot)com> writes:
> Doesn't that seem a bit strange? Does it have to do with the smaller size of
> the new table maybe?

No, it seems to be a planner bug:
http://archives.postgresql.org/pgsql-hackers/2007-05/msg00920.php

I imagine that your table statistics are close to the critical point
where a bitmap scan looks cheaper or more expensive than a plain index
scan, and so the chosen plan varies depending on more-or-less chance
factors. Certainly getting rid of NULLs shouldn't have had any direct
impact on this choice.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message PFC 2007-05-21 21:35:14 Re: Postgres Benchmark Results
Previous Message Vivek Khera 2007-05-21 21:24:09 Re: 121+ million record table perf problems