Re: Query performance question on a large table

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Sean Shanny <shannyconsulting(at)earthlink(dot)net>, "Pgsql-General(at)Postgresql(dot)Org (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query performance question on a large table
Date: 2004-01-07 17:43:07
Message-ID: 20040107174307.GC12631@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 07, 2004 at 02:31:22 -0500,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> I just a couple days ago added some logic to CVS tip to notice that the
> sub-select has a DISTINCT clause, and not add unnecessary unique-ifying
> processing on top of it. So in 7.5, writing a DISTINCT clause will
> amount to forcing a particular query plan, which might or might not be
> the best thing but hopefully won't be too terrible. But in 7.4 it has
> nothing to recommend it ...

Can't the DISTINCT be dropped if there isn't a LIMIT clause?
Similarly UNION, INTERSECTION and EXCEPT could also also be changed
to the ALL forms if there isn't a LIMIT.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joseph Shraibman 2004-01-07 18:49:13 VACUUM VERBOSE ANALYZE does not work on 7.4.1
Previous Message Bruce Momjian 2004-01-07 17:42:52 Re: Paypal WAS: PostgreSQL speakers needed for OSCON