Aidan Van Dyk wrote:

> And I don't think anyone's going to have a good answer either way unless we 
> get
> real numbers.  But I don't know of any way to get at these numbers right now.
> 
> 1) How many writes happen on buffer pages that are "hint dirty" but not 
> "really
>    dirty"?
> 
> 2) How much IO would writing the WAL records "hint bits" on every page write
>    take up?

I don't think it's a matter of hoy many writes or how much IO.  The
question is locks.  Right now we flip hint bits without taking any kind
of lock on the page.  If we're going to WAL-log each hint bit change,
then we will need to lock the page to update the LSN.  This will make
changing a hint bit a very expensive operation, and maybe a possible
cause for deadlocks.

What my patch did was log hint bits in bulk.  The problem of that
approach was precisely that it was not locking the logged page enough
(locking before setting the "this page needs hint bits logged" bit).  Of
course, the trivial solution is just to lock the page before flipping
hint bits, but I don't know (and I doubt) whether it would really work
at all.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
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