Re: Rewriting DISTINCT and losing performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Rewriting DISTINCT and losing performance
Date
Msg-id 29045.1179783125@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rewriting DISTINCT and losing performance  ("Chuck D." <pgsql-performance@nullmx.com>)
List pgsql-performance
"Chuck D." <pgsql-performance@nullmx.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

pgsql-performance by date:

Previous
From: Vivek Khera
Date:
Subject: Re: 121+ million record table perf problems
Next
From: PFC
Date:
Subject: Re: Postgres Benchmark Results