order of evaluation of search arguments

Поиск
Список
Период
Сортировка
От Kiriakos Georgiou
Тема order of evaluation of search arguments
Дата
Msg-id 7A4F291C-3B32-4DDC-BB3E-82A374972B61@olympiakos.com
обсуждение исходный текст
Ответы Re: order of evaluation of search arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
As I understand it the order the of evaluation of search arguments is up to the optimizer.  I've tested the following query, that is supposed to take advantage of advisory locks to skip over rows that are locked by other consumers running the exact same query and it seems to work fine.  It seems to me the optimizer should always prefer to scan by status.  What say you?

begin;

select *
from queue q
where
   q.status = 'unprocessed'
   and pg_try_advisory_xact_lock(q.qid, q.tableoid::int) = true
limit 2 -- specify batch size here
for update;

-- now process the queue items

Kiriakos



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

Предыдущее
От: Ondrej Ivanič
Дата:
Сообщение: Re: Rules of Thumb for Autovaccum
Следующее
От: "Rajan, Pavithra"
Дата:
Сообщение: Re: Dump functions alone