Re: Problem using Subselect results - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Problem using Subselect results
Date
Msg-id 200307301108.56047.josh@agliodbs.com
Whole thread Raw
In response to Re: Problem using Subselect results  (oheinz@stud.fbi.fh-darmstadt.de)
List pgsql-sql
Oliver,

> SELECT DISTINCT ON (two.two_id) two.two_value FROM one,two WHERE
> (one.two_id=two.two_id
> AND one.updatenr > two.updatenr) ORDER BY two.updatenr ASC;

FWIW, SELECT DISTINCT ON () is slower than SELECT .... ORDER BY ... LIMIT 1 on
all stable versions of Postgres.   Not that the LIMIT 1 method can be used
with all queries.

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: function returning setof performance question
Next
From: Jamie Lawrence
Date:
Subject: Fwd: Bad Join moment - how is this happening?