Re: pg_index.isclustered can work

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_index.isclustered can work
Date: 2001-05-15 02:51:13
Message-ID: 200105150251.f4F2pDj12108@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I can easily have pg_index.indisclustered updated to 'true' if you ever
> > CLUSTER the index. Is that useful to anyone? Remember, clustering
> > doesn't remain if you modify the table.
>
> I don't see any value in it as long as CLUSTER is in the disreputable
> shape it's in. I don't really like giving people the impression that
> CLUSTER is a supported operation ;-)

OK, I have an idea!

1) Set pg_index.indisclustered during CLUSTER
2) Clear pg_index.indisclustered during vacuum if any tuples are expired
3) or, have vacuum auto-CLUSTER the table as part of vacuum
4) Use pg_index.indisclustered in the optimizer

Of course, this assumes we have all the CLUSTER problems fixed.

FYI, we now have a CLUSTER section in the TODO list which says:

* CLUSTER
* cluster all tables at once
* prevent lose of indexes, permissions, inheritance
* Automatically keep clustering on a table
* Keep statistics about clustering, perhaps during VACUUM ANALYZE
[optimizer]

Doesn't look too bad.

FYI, the reference to pg_index.indisclustered in ODBC was assuming it
meant it was a hash index, which is just plain wrong, so that code is
not coming back.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-05-15 02:56:16 RE: Updating system catalogs after a tuple deletion
Previous Message Stephan Szabo 2001-05-15 02:50:17 RE: Updating system catalogs after a tuple deletion