Re: Block B-Tree concept

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Block B-Tree concept
Дата
Msg-id 20060927160451.GL19827@nasby.net
обсуждение исходный текст
Ответ на Re: Block B-Tree concept  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Wed, Sep 27, 2006 at 05:38:38AM -0400, Bruce Momjian wrote:
> Heikki Linnakangas wrote:
> > Jim C. Nasby wrote:
> > > Couldn't vacuum just eliminate tuples marked dead? Heck, don't we do
> > > that anyway right now?
> > 
> > You mean _index_ tuples marked dead? Sure, no problem there.
> > 
> > > Granted, you'd want to periodically ensure that you scan the entire
> > > index, but that shouldn't be horribly hard to set up.
> > 
> > Well, it seems to be.  A vacuum can't evaluate index expressions because 
> > it's not in a real transaction.
> > 
> > The DBA could set up a cron job to do "SELECT * FROM foo WHERE bar > 0" 
> > etc. with enable_seqscan=false? That would work, but we can't depend on 
> > an additional administrative task like. And we might as well just 
> > disable the optimization that's causing us problems.
> 
> Why can't the C code just do a full index scan that touches the heap,
> sets those expired bits, and then do a vacuum?  My point is that the
> bits can be set outside the normal vacuum process, so you don't have to
> be doing heap lookups from the index inside vacuum.
> 
> Assuming the heap is mostly in index order, the full index scan
> shouldn't take much longer than a heap scan, and if the heap doesn't
> match index order, a block index shouldn't be used anyway.

Well, my thought was to have a backend process that would periodically
scan a small section of the index, so that you wouldn't have a
long-running transaction. That could then be followed by a vacuum of
that same section of the index, which would nuke the dead tuple entries.

Though, maybe we wouldn't even need the vacuum step since 8.2 will now
reclaim tuples marked as dead?
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: psql service parameter
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Buildfarm alarms