Repeated PredicateLockRelation calls during seqscan

Dan Ports <drkp@csail.mit.edu>

From: Dan Ports <drkp@csail.mit.edu>
To: pgsql-hackers@postgresql.org, Kevin Grittner <Kevin.Grittner@wicourts.gov>
Date: 2011-06-22T04:58:50Z
Lists: pgsql-hackers

Attachments

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/