Re: Problem using Subselect results

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Problem using Subselect results
Дата
Msg-id 200307301108.56047.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Problem using Subselect results  (oheinz@stud.fbi.fh-darmstadt.de)
Список 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 по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: function returning setof performance question
Следующее
От: Jamie Lawrence
Дата:
Сообщение: Fwd: Bad Join moment - how is this happening?