Re: Hint Bits and Write I/O - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Hint Bits and Write I/O
Date
Msg-id 87hccispv7.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Hint Bits and Write I/O  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Hint Bits and Write I/O  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> (Although that argument might not hold water for a bulk seqscan: you'll
> have hinted all the tuples and then very possibly throw the page away
> immediately.  

That seems like precisely the case where we don't want to dirty the buffer.

> So counting the hints and eventually deciding we did
> enough to justify dirtying the page might be worth doing.)

What if we counted how many hint bits were *not* set? I feel like the goal
should be to dirty the buffer precisely once when all the bits can be set. The
problem case is when we dirty the page but still have some hint bits to be set
on a subsequent iteration.

Of course that doesn't deal with the case where tuples are being touched
continuously. Perhaps the idea should be to treat the page as dirty every n
hint bit settings where n is the number of tuples on the page. or highest
number of unset hint bits seen on the page. or something like that.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production
Tuning


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Next
From: "Pavan Deolasee"
Date:
Subject: Avoiding second heap scan in VACUUM