Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5ADC6B5D90E for ; Wed, 22 Jun 2011 11:28:27 -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 57914-01 for ; Wed, 22 Jun 2011 14:28:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 0A35AB5D8BD for ; Wed, 22 Jun 2011 11:28:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p5MESJUb029471; Wed, 22 Jun 2011 10:28:19 -0400 (EDT) To: Dan Ports cc: pgsql-hackers@postgresql.org, Kevin Grittner Subject: Re: Repeated PredicateLockRelation calls during seqscan In-reply-to: <20110622045850.GN83336@csail.mit.edu> References: <20110622045850.GN83336@csail.mit.edu> Comments: In-reply-to Dan Ports message dated "Wed, 22 Jun 2011 00:58:50 -0400" Date: Wed, 22 Jun 2011 10:28:19 -0400 Message-ID: <29470.1308752899@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/1887 X-Sequence-Number: 190600 Dan Ports writes: > I was looking at ExecSeqScan today and noticed that it invokes > PredicateLockRelation each time it's called, i.e. for each tuple > returned. Any reason we shouldn't skip that call if > rs_relpredicatelocked is already set, as in the attached patch? Why is the call in ExecSeqScan at all, and not in the node startup function? regards, tom lane