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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Дата
Msg-id 1823.966869439@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan  (Tiago Antão <tra@fct.unl.pt>)
Список pgsql-hackers
Tiago Antão <tra@fct.unl.pt> writes:
>  Isn't the problem more general than just nextval?

Yes it is, and that's why I'm not very excited about the idea of
adding special-case logic for nextval/currval into the optimizer.

It's fairly easy to get around this problem in plpgsql, eg
declare x int;beginx := currval('seq');return f1 from foo where seqfld = x;

so I really am going to resist suggestions that the optimizer should
make invalid assumptions about currval by itself ...
        regards, tom lane


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

Предыдущее
От: Mark Hollomon
Дата:
Сообщение: functional index arg matching patch
Следующее
От: Vince Vielhaber
Дата:
Сообщение: Re: Bug tracking (was Re: +/- Inf for float8's)