pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-performance@nullmx.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Rewriting DISTINCT and losing performance
Date: Mon, 21 May 2007 17:32:05 -0400
Message-ID: <29045.1179783125@sss.pgh.pa.us> (raw)
In-Reply-To: <200705211217.45205.pgsql-performance@nullmx.com>
References: <200705202228.32129.pgsql-performance@nullmx.com>
	<200705210909.44335.pgsql-performance@nullmx.com>
	<4651D813.5050100@archonet.com>
	<200705211217.45205.pgsql-performance@nullmx.com>

"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



view thread (8+ messages)

Message-ID: <29045.1179783125@sss.pgh.pa.us>
Permalink:  ../29045.1179783125@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29045.1179783125@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-performance@nullmx.com
  Subject: Re: Rewriting DISTINCT and losing performance
  In-Reply-To: <29045.1179783125@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox