Re: key = currval('tab_key_seq') choses SEQSCAN?!

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: key = currval('tab_key_seq') choses SEQSCAN?!
Дата
Msg-id 8016.1077757377@sss.pgh.pa.us
обсуждение исходный текст
Ответ на key = currval('tab_key_seq') choses SEQSCAN?!  (Brandon Craig Rhodes <brandon@oit.gatech.edu>)
Ответы Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Eric B.Ridge <ebr@tcdi.com>)
Список pgsql-general
Brandon Craig Rhodes <brandon@oit.gatech.edu> writes:
> But this same table suddenly becomes unwilling to use an index scan if
> the target value is the result of the currval() function:

currval() is considered a volatile function, therefore it is unsafe to
use in an indexscan constraint.

The subselect hack mentioned nearby fools the planner ... at the moment.
I wouldn't guarantee that it will work indefinitely.  A better solution
is to wrap currval() in a function that you lyingly claim is stable.

            regards, tom lane

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

Предыдущее
От: Michael Chaney
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions
Следующее
От: "cnliou"
Дата:
Сообщение: Re: invalid memory alloc request size