Re: Synchronized Scan update - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Synchronized Scan update
Date
Msg-id 1173805707.23455.97.camel@dogma.v10.wvs
Whole thread Raw
In response to Re: Synchronized Scan update  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Synchronized Scan update
Re: Synchronized Scan update
List pgsql-hackers
On Tue, 2007-03-13 at 12:53 -0400, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > I agree that ss_report_loc() doesn't need to report on every call. If
> > there's any significant overhead I agree that it should report less
> > often. Do you think that the overhead is significant on such a simple
> > function?
> 
> One extra LWLock cycle per page processed definitely *is* a significant
> overhead ... can you say "context swap storm"?  I'd think about doing it
> once every 100 or so pages.
> 

No lock is needed to store the hint. If somehow the hint (which is
stored in a static table, no pointers) gets invalid data due to a race
condition, the new scan will simply consider the hint invalid and start
at 0.

I did this precisely to avoid causing a performance regression for usage
patterns that don't benefit from sync scans.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Synchronized Scan update
Next
From: Josh Berkus
Date:
Subject: Re: Daylight Saving Time question PostgreSQL 8.1.4