Re: Buglist

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Vivek Khera <khera(at)kcilink(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Buglist
Date: 2003-08-20 18:45:23
Message-ID: 3F43C1C3.7010109@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Vivek Khera wrote:

>>>>>> "JW" == Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
>
> JW> remove all the index entries pointing to these ctid's. Your idea is (so
> JW> far) lacking a place where to remember all the single removed rows and I
> JW> assume you're not planning to pay the cost of a full scan over all
> JW> indexes of a table to reclaim the space of one data row, are you?
>
> Well, that pretty much kills my idea... back to autovacuum ;-)

Sorry that.

While at the "reclaim" and [non-] overwriting topic, the other day I had
some brilliant idea about index entries, so here comes your chance for
revenge ...

Assume we would have multiple ctid slots per index entry. An UPDATE on a
row that doesn't change indexed fields allways inserts the same index
value with a new ctid, so it'll come across this index tuple anyway. If
said index tuple has an empty slot, just put the ctid there and done. If
it does not, check the ctid's that are there if they point to "known
dead and ready to vacuum" tuples and make space. If that fails too, well
then insert another index tuple.

This has some advantages. Updating rows without changing key fields does
not result in constant index growth. An index scan will be fast even for
a value with lots of dead heap tuples. For non-unique indexes, multiple
data rows can "share" one index entry.

Index cleanup for vacuum remains pretty easy. Clear the ctid slots
pointing to removed tuples. Remove index tuples that have all slots cleared.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-08-20 18:52:18 Re: Mailing list in French
Previous Message Ron Johnson 2003-08-20 18:44:59 Re: Grouping by date range

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-08-20 18:56:56 Re: Buglist
Previous Message Thomas Swan 2003-08-20 18:35:35 Re: Can't find thread on Linux memory overcommit