Re: Think I see a btree vacuuming bug

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Think I see a btree vacuuming bug
Date: 2002-05-27 10:16:51
Message-ID: 2vt3fuo99t2q8t7r59csiiboec85nboq3c@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 25 May 2002 14:21:52 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
wrote:
>I'm somewhat concerned that the more stringent locking will slow down
>VACUUM a good deal when there's lots of concurrent activity, but I don't
>see another answer. Ideas anyone?

Ideas? Always! :-) Don't know if this one is so bright, but at least
we have something to vote on:

On leaf pages order index tuples by heap item pointer, if otherwise
equal. In IndexScanDescData remember the whole index tuple (including
the heap item pointer) instead of ItemPointerData. Then depending on
scan direction _bt_next() would look for the first index tuple greater
or less than currentItem respectively.

Implications:
(+) higher concurrency: normal write locks
(+) robust: can always start from the root, if nothing else helps
(though I can't think of a case making this necesary)
(-) need heap item pointer in internal nodes (could partly be
compensated by omitting unused(?) t_tid.ip_posid)
(+) btinsert knows, where to insert a new tuple, even if there are
lots of duplicates (no random())
(-) this could result in more half-empty leaf pages?
(+) dead index tuples can be removed on the fly
(?) ...

Servus
Manfred

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2002-05-27 12:35:05 Two smart guys are looking for contracts :-)
Previous Message Teodor Sigaev 2002-05-27 09:18:43 Re: strange update problem with 7.2.1