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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: key = currval('tab_key_seq') choses SEQSCAN?!
Дата
Msg-id 14867.1077834196@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> Consider a query like
> select * from foo where a = currval('xyz') and b = nextval('xyz')
> ...
> Though actually I don't really see how any interpretation of this
> query really makes a whole lot of sense.

Yeah.  The only moderately credible use-case I've ever seen for volatile
functions in WHERE clauses is

    select * from foo where random() < 0.01;

which gets you a random sampling of approximately 1% of the table.

            regards, tom lane

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

Предыдущее
От: Alex Satrapa
Дата:
Сообщение: Re: postgreSQL licenseing
Следующее
От: mailings@oopsware.de
Дата:
Сообщение: Re: Postgres clustering?