pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carlo Stonebanks <stonec.register@sympatico.ca>
To: pgsql-performance@postgresql.org
Subject: Does FILTER in SEQSCAN short-circuit AND?
Date: Tue, 18 May 2010 18:28:25 -0400
Message-ID: <hsv49v$312j$1@news.hub.org> (raw)

Sample code:

SELECT *
FROM MyTable
WHERE foo = 'bar' AND MySlowFunc('foo') = 'bar'

Let's say this required a SEQSCAN because there were no indexes to support 
column foo. For every row where foo <> 'bar' would the filter on the SEQSCAN 
short-circuit the AND return false right away, or would it still execute 
MySlowFunc('foo') ?

Thanks!

Carlo 




view thread (6+ messages)  latest in thread

Message-ID: <hsv49v$312j$1@news.hub.org>
Permalink:  ../hsv49v$312j$1@news.hub.org/
Also on:    postgresql.org/message-id/hsv49v$312j$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: stonec.register@sympatico.ca
  Subject: Re: Does FILTER in SEQSCAN short-circuit AND?
  In-Reply-To: <hsv49v$312j$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox