Repeated PredicateLockRelation calls during seqscan

From: Dan Ports <drkp(at)csail(dot)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Repeated PredicateLockRelation calls during seqscan
Date: 2011-06-22 04:58:50
Message-ID: 20110622045850.GN83336@csail.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

That would save us a bit of overhead, since checking that flag is
cheaper than doing a hash lookup in the local predicate lock table
before bailing out.

Dan

--
Dan R. K. Ports MIT CSAIL http://drkp.net/

Attachment Content-Type Size
predlock-seqscan.patch text/x-diff 824 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Ports 2011-06-22 05:31:11 Re: pika buildfarm member failure on isolationCheck tests
Previous Message Brendan Jurd 2011-06-22 04:12:38 Re: Fwd: Keywords in pg_hba.conf should be field-specific