Re: Let-bindings in SQL statements

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: Let-bindings in SQL statements
Дата
Msg-id CABRT9RDNT_JZ5cGTUeHvjqicmQBOP0wUmiY=1XHxtszJS0Xpcg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Let-bindings in SQL statements  (Jasen Betts <jasen@xnet.co.nz>)
Список pgsql-general
On Sat, Feb 11, 2012 at 12:42, Jasen Betts <jasen@xnet.co.nz> wrote:
> There is no need. now() is tagged as stable. it will only be executed once.
> the planner will figure this out for you.

Actually that's not always true. In index condition arguments, the
expression would indeed be executed just once. But in filter clauses
(e.g. seq scan), the whole expression is executed once per row, which
is a bit inefficient. Of course this makes no visible difference for
now(), since it always returns the same value -- the transaction start
time.

(I submitted a patch to improve this, but it's not certain whether it
will be included in PostgreSQL 9.2 or not)

Regards,
Marti

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Database denormalization
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue