Skip site navigation (1) Skip section navigation (2)

Re: Possible bug in query planner when using DISTINCT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: n(dot)howden(at)eris(dot)qinetiq(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Possible bug in query planner when using DISTINCT
Date: 2002-11-14 19:25:33
Message-ID: 16982.1037301933@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Nick Howden <n(dot)howden(at)eris(dot)qinetiq(dot)com> writes:
> Using postgres 7.2.3 the query planner seems to lose interest in using 
> indexes when DISTINCT is used.

I don't think this is a bug.  DISTINCT requires a sort step, so even
though you have a LIMIT, the planner has to plan on the basis of reading
the entire join table.  The nestloop plan loses badly on that basis.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Theodore PetroskyDate: 2002-11-15 12:32:43
Subject: new journaling system in OSX
Previous:From: WilliamDate: 2002-11-14 14:59:29
Subject: 答复: [BUGS] Bug #818: There are no agg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group