Skip site navigation (1) Skip section navigation (2)

Re: Repeated PredicateLockRelation calls during seqscan

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dan Ports <drkp(at)csail(dot)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Re: Repeated PredicateLockRelation calls during seqscan
Date: 2011-06-22 18:19:44
Message-ID: 4E023240.6070100@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 22.06.2011 17:28, Tom Lane wrote:
> Dan Ports<drkp(at)csail(dot)mit(dot)edu>  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?

It makes sense to delay it until the scan is actually started, so that 
you don't get unnecessary serialization failures if the scan is never 
actually executed. I don't know if that was Kevin's original reason for 
putting it there, but that's why I left it there.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2011-06-22 18:31:51
Subject: Re: Indication of db-shared tables
Previous:From: Robert HaasDate: 2011-06-22 17:36:00
Subject: Re: [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group