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

Поиск
Список
Период
Сортировка
От Eric B.Ridge
Тема Re: key = currval('tab_key_seq') choses SEQSCAN?!
Дата
Msg-id A4B80899-67FB-11D8-9391-000A95D98B3E@tcdi.com
обсуждение исходный текст
Ответ на Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
On Feb 25, 2004, at 8:02 PM, Tom Lane wrote:

> 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.

I suppose this is obvious, but it's volatile because *other* backends
can change it while the current transaction is still in progress?

eric

>
> 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
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)


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

Предыдущее
От: "cnliou"
Дата:
Сообщение: Re: invalid memory alloc request size
Следующее
От: Randall Skelton
Дата:
Сообщение: Simplyfying many equals in a join