On Wed, Apr 15, 2015 at 6:10 AM, Andres Freund <and...@anarazel.de> wrote:
>> > Of
>> > course, that applies in all cases, but when the page is already dirty,
>> > the cost of pruning it is probably quite small - we're going to have
>> > to write the page anyway, and pruning it before it gets evicted
>> > (perhaps even by our scan) will be cheaper than writing it now and
>> > writing it again after it's pruned.  When the page is clean, the cost
>> > of pruning is significantly higher.
>>
>> "We" aren't going to have to write the page, but someone will.
>
> If it's already dirty that doesn't change at all. *Not* pruning in that
> moment actually will often *increase* the total amount of writes to the
> OS. Because now the pruning will happen on the next write access or
> vacuum - when the page already might have been undirtied.
>
> I don't really see the downside to this suggestion.

+1. I think, in general, the opportunity cost of not pruning when a
page is already dirty is likely to be rather high. In general, it's
likely to be worth it.


-- 
Peter Geoghegan


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to