Re: BUG #11803: avoid "distinct" logic if "limit 1" specified

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #11803: avoid "distinct" logic if "limit 1" specified
Дата
Msg-id 30634.1414524443@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #11803: avoid "distinct" logic if "limit 1" specified  (socketpair@gmail.com)
Список pgsql-bugs
socketpair@gmail.com writes:
> query:
> select * from tablename order by id limit 1

> and query:
> select distinct * from tablename order by id limit 1

> should be planned exactly (as if distinct was not specified)

Seems like a waste of planning cycles to check for this.
The uniquification step isn't going to take enough time to be
an issue, if only one input row arrives.  On the other hand,
the added planning logic would contribute some small overhead
to *every* query using DISTINCT.

            regards, tom lane

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

Предыдущее
От: djlu126@126.com
Дата:
Сообщение: BUG #11804: The delete rule problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #11804: The delete rule problem