Re: Can simplify 'limit 1' with slow function?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can simplify 'limit 1' with slow function?
Дата
Msg-id 26306.1404338572@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can simplify 'limit 1' with slow function?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Wed, Jul 02, 2014 at 04:17:13PM -0400, Tom Lane wrote:
>> It's not so much the limit as that the sort has to happen before the
>> limit, and yes, evaluation of the targetlist happens before the sort.

> I guess I assumed the column c was indexable, and it that case I
> beleive the slowfunction() would indeed only be called once.

There are cases where we can avoid an explicit sort step by relying on
some earlier phase of the processing pipeline to generate the rows in the
right order to begin with.  Evidently this wasn't one of them though :-(.
        regards, tom lane



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

Предыдущее
От: Andreas Karlsson
Дата:
Сообщение: Re: New functions in sslinfo module
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Doing better at HINTing an appropriate column within errorMissingColumn()