Re: Dead Space Map - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Dead Space Map
Date
Msg-id 87acccypjt.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Dead Space Map  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Dead Space Map
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Heikki Linnakangas <hlinnaka@iki.fi> writes:

> > * implementation of index-only scans
> 
> > An index scan would not have to check the visibility information of heap 
> > tuples on those heap pages that are marked as clean in the dead space map.
> > This requires that the dead space map is implemented so that a page is 
> > reliably marked as dirty in all circumstances when it contains any tuples 
> > that are not visible to all backends.
> 
> The "reliably" part of this is likely to make it a non-starter.  Another
> problem is that the semantics needed by this are not quite the same as
> the semantics of whether a page needs to be visited by vacuum.

It would be very disappointing if this part doesn't turn out to be possible.

I had always thought the semantics were the same, but now I'm realizing that
vacuum doesn't need to visit tuples that have been committed even if they're
not visible to some transaction. So having a "vacuum can ignore this" bit
doesn't help you with index scans.

But I think the thought process went the other direction. If you have the bit
intended for index scans indicating that the tuple is not "in doubt" ie, it's
visible to every transaction, then that also implies the tuple doesn't need to
be visited by vacuum.

Skipping pages that don't contain any in doubt tuples would be a huge win.
Even if there might be some additional pages that vacuum could in theory be
skipping too.

-- 
greg



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dead Space Map
Next
From: Tom Lane
Date:
Subject: Re: Vacuum dead tuples that are "between" transactions