pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: K C Lau <KCLau@attglobal.net>
To: pgsql-performance@postgresql.org
Subject: Re: SELECT DISTINCT Performance Issue
Date: Mon, 06 Jun 2005 13:45:39 +0200
Message-ID: <op.srx5mdsmth1vuj@localhost> (raw)
In-Reply-To: <6.2.1.2.0.20050602190756.05ab2c70@localhost>
References: <6.2.1.2.0.20050602190756.05ab2c70@localhost>



> Previously, we have also tried to use LIMIT 1 instead of DISTINCT, but  
> the performance was no better:
> select PlayerID,AtDate from Player where PlayerID='22220' order by  
> PlayerID desc, AtDate desc LIMIT 1

	The DISTINCT query will pull out all the rows and keep only one, so the  
one with LIMIT should be faster. Can you post explain analyze of the LIMIT  
query ?



view thread (6+ messages)  latest in thread

Message-ID: <op.srx5mdsmth1vuj@localhost>
Permalink:  ../op.srx5mdsmth1vuj@localhost/
Also on:    postgresql.org/message-id/op.srx5mdsmth1vuj@localhost

 · 

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: lists@boutiquenumerique.com, KCLau@attglobal.net
  Subject: Re: SELECT DISTINCT Performance Issue
  In-Reply-To: <op.srx5mdsmth1vuj@localhost>

* 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