Re: Another HOT thought: why do we need indcreatexid at all?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>, "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Another HOT thought: why do we need indcreatexid at all?
Date: 2007-09-13 23:29:52
Message-ID: 6120.1189726192@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>>> AFAICS, the whole indcreatexid and validForTxn business is a waste of
>>> code. By the time CREATE INDEX CONCURRENTLY is ready to set indisvalid,
>>> surely any transactions that could see the broken HOT chains are gone.

> In answer to the real question you were actually asking, I believe you're
> correct that CREATE INDEX CONCURRENTLY should never need to set indcreatexid.
> Only regular non-concurrent CREATE INDEX needs to protect against that
> problem.

Argh, I'd momentarily gotten concurrent and nonconcurrent cases backwards.

I would still desperately like to get rid of indcreatexid, though,
because the patch's existing mechanism for clearing it is junk.
There's no guarantee that it will get cleared before it wraps around,
because the clearing is attached to vacuuming of the wrong table.
Maybe you could make it work by special-casing vacuuming of pg_index
itself, but the whole thing's a crock anyway.

[ thinks some more ... ] Hmm, maybe instead of an explicit XID stored in
the pg_index row proper, we could use the xmin of the pg_index row
itself? That's already got a working mechanism for getting frozen.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-09-13 23:44:18 Re: [HACKERS] Still recommending daily vacuum...
Previous Message Darcy Buskermolen 2007-09-13 22:59:15 Re: autovacuum launcher eating too much CPU