Re: Slow SQL lookup due to every field being listed in SORT KEY

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mason Harding <mason(dot)harding(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow SQL lookup due to every field being listed in SORT KEY
Date: 2010-09-11 02:03:37
Message-ID: 20100911020337.GH26232@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> The reason it's sorting by all the columns is the DISTINCT

You might also verify that you actually need/*should* have the DISTINCT,
if it's included today.. Often developers put that in without
understanding why they're getting dups (which can often be due to
missing pieces from the JOIN clause or misunderstanding of the database
schema...).

Stephen

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message azajac 2010-09-12 17:34:00 Problem with mergejoin performance (some bug?)
Previous Message Tom Lane 2010-09-11 02:00:38 Re: Slow SQL lookup due to every field being listed in SORT KEY