Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 53286634460 for ; Thu, 27 May 2010 16:29:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 14766-10 for ; Thu, 27 May 2010 19:28:59 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id B3301634128 for ; Thu, 27 May 2010 16:28:55 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o4RJSlJe031458 for ; Thu, 27 May 2010 16:28:52 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o4IMSGHb099436 for pgsql-performance@postgresql.org; Tue, 18 May 2010 19:28:16 -0300 (ADT) (envelope-from news) From: "Carlo Stonebanks" X-Newsgroups: pgsql.performance Subject: Does FILTER in SEQSCAN short-circuit AND? Date: Tue, 18 May 2010 18:28:25 -0400 Organization: Hub.Org Networking Services Lines: 15 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18197 To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.986 tagged_above=-10 required=5 tests=BAYES_50=0.8, STOX_REPLY_TYPE=0.439, STOX_REPLY_TYPE_WITHOUT_QUOTES=1.757, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: ** X-Archive-Number: 201005/238 X-Sequence-Number: 38822 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