Re: Transaction Snapshots and Hot Standby - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: Transaction Snapshots and Hot Standby
Date
Msg-id 1221211266.17270.134.camel@PCD12478
Whole thread Raw
In response to Re: Transaction Snapshots and Hot Standby  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Transaction Snapshots and Hot Standby  (Hannu Krosing <hannu@2ndQuadrant.com>)
List pgsql-hackers
On Fri, 2008-09-12 at 09:38 +0100, Simon Riggs wrote:
> If you request a block, we check to see whether there is a lookaside
> copy of it prior to the tuple removals. We then redirect the block
> request to a viewpoint relation's block. Each viewpoint gets a separate
> relfilenode. We do the switcheroo while holding cleanup lock on block.

Wouldn't it make sense to also have a hint bit on the pages which are
copied away ? Then instead of looking up a hash table, you first would
look up that bit, and if not set you won't look up the hash table at
all.  Then when you clean up the "lookaside copies" you clear those bits
too...

That would probably perform somewhat better for reading than always
looking up a potentially big hash table, and the cost of setting the
hint is probably a lot less than copying away the page in the first
place. Resetting the hint bit might be a bit more expensive.

Cheers,
Csaba.




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_regress inputdir
Next
From: KaiGai Kohei
Date:
Subject: Re: Proposal of SE-PostgreSQL patches (for CommitFest:Sep)