Re: Synchronized Scan update - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Synchronized Scan update
Date
Msg-id 1173807071.4903.7.camel@localhost.localdomain
Whole thread Raw
In response to Re: Synchronized Scan update  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Ühel kenal päeval, T, 2007-03-13 kell 12:53, kirjutas Tom Lane:
> 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.

Can't we do it in some lock-free way ? writing page numbers (4-byte
ints) into a predetermined location isn shared mem should be atomic on
all platforms we support (still may cause some cache ping-pong in
multiprocessor systems, but this should be much cheaper), and even an
occasional error in establishing the "scan head" should not be
catastrophic.

-- 
----------------
Hannu Krosing
Database Architect
Skype Technologies OÜ
Akadeemia tee 21 F, Tallinn, 12618, Estonia

Skype me:  callto:hkrosing
Get Skype for free:  http://www.skype.com




pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: 8.1.x (tested 8.1.8) timezone bugs
Next
From: "Joshua D. Drake"
Date:
Subject: Re: 8.1.x (tested 8.1.8) timezone bugs