Re: Tuning queries and distinct behaviour

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Tuning queries and distinct behaviour
Дата
Msg-id 5286.979853602@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Tuning queries and distinct behaviour  ("Gordan Bobic" <gordan@freeuk.com>)
Список pgsql-general
"Gordan Bobic" <gordan@freeuk.com> writes:
> It just seems a bit strange
> that doing subqueries with temporary tables should be so much faster.

Hard to respond to this complaint without a specific example.

> SELECT DISTINCT ON (Table1.Field3) * FROM SomeView. I would hope that
> DISTINCT would pick the first record returned for each of the different
> occurences in SomeView.

It does, but kindly notice that you have not constrained what the first
record returned is.  See the example of SELECT DISTINCT ON usage in the
SELECT reference page,
http://www.postgresql.org/users-lounge/docs/7.0/postgres/sql-select.htm

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Adam Lang"
Дата:
Сообщение: Re: Re: MS Access data to PostgrSQL data
Следующее
От: Chris Hayner
Дата:
Сообщение: mSQL to PgSQL