Re: Synchronized Scan update

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Synchronized Scan update
Date: 2007-03-13 17:18:02
Message-ID: 1173806282.23455.106.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2007-03-13 at 10:08 -0700, Jeff Davis wrote:
> > 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.
>

I'd also like to add that, if a lock was required, a constant offset
would also seem to prone to a context swap storm; it would just happen
100th as much. We'd need to do something to spread the locks over time.

That being said, I'll adjust it to report once per hundred pages anyway,
because there's really no drawback.

Regards,
Jeff Davis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2007-03-13 17:31:11 Re: Synchronized Scan update
Previous Message Simon Riggs 2007-03-13 17:17:23 Re: Synchronized Scan update