Re: patch: improve SLRU replacement algorithm - Mailing list pgsql-hackers

From Greg Stark
Subject Re: patch: improve SLRU replacement algorithm
Date
Msg-id CAM-w4HN_e96YCufGP3z3mkCGJOkp0OAyVUM75jK=YLxJo8L7_g@mail.gmail.com
Whole thread Raw
In response to Re: patch: improve SLRU replacement algorithm  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: patch: improve SLRU replacement algorithm  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Apr 4, 2012 at 9:34 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Why is this pgbench run accessing so much unhinted data that is > 1
> million transactions old? Do you believe those numbers? Looks weird.

I think this is in the nature of the workload pgbench does. Because
the updates are uniformly distributed, not concentrated 90% in 10% of
the buffers like most real-world systems, (and I believe pgbench only
does index lookups) the second time a tuple is looked at is going to
average N/2 transactions later where N is the number of tuples. Given
a scale factor of 300 that's 15 million transactions.

More aggressively hinting other tuples on the page that we have no
other business looking at might help, though that would require extra
finess to avoid causing extra clog reads. Presumably you would only
want to hint other tuples whose xids were in clog pages that were
actually in memory currently.

-- 
greg


pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Speed dblink using alternate libpq tuple storage
Next
From: Greg Stark
Date:
Subject: Re: patch: improve SLRU replacement algorithm