Re: order of evaluation of search arguments - Mailing list pgsql-general

From Tom Lane
Subject Re: order of evaluation of search arguments
Date
Msg-id 1122.1329371056@sss.pgh.pa.us
Whole thread Raw
In response to order of evaluation of search arguments  (Kiriakos Georgiou <kg.postgresql@olympiakos.com>)
Responses Re: order of evaluation of search arguments
List pgsql-general
Kiriakos Georgiou <kg.postgresql@olympiakos.com> writes:
> 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
theexact same query and it seems to work fine.  It seems to me the optimizer should always prefer to scan by status.
Whatsay you? 

"When it breaks, you get to keep both pieces."  Was your testing even
capable of noticing the problem if the query locked more rows than you
wanted?

Less dangerous coding practices might involve putting the lock function
in an outer query, while using an OFFSET 0 in the sub-query as an
optimization fence.

            regards, tom lane

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Postgres 9.1 package for i.MX51X processor from Freescale
Next
From: Venkat Balaji
Date:
Subject: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue