Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Дата
Msg-id 399FC320.AFA7A99B@tm.ee
обсуждение исходный текст
Ответы Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan  (Tiago Antão <tra@fct.unl.pt>)
Список pgsql-hackers
It seems that optimiser is unaware that currval('seq') can be treated as
a constant within 
an expression and thus produces suboptimal plans for WHERE clauses that
use currval 
thus using a seq scan instead of index scan.

Is it possible (planned) to mark functions as returning a constant when
given a constant 
argument and start using it _as a constant_ (pre-evaluated) in queries

The current behaviour is not very intuitive.

------------
Hannu


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: autoconf check for AF_UNIX sockets
Следующее
От: Larry Rosenman
Дата:
Сообщение: mac.c