Re: Indexes vs. cache flushes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Indexes vs. cache flushes
Date
Msg-id 11920.1137656771@sss.pgh.pa.us
Whole thread Raw
In response to Re: Indexes vs. cache flushes  (Greg Stark <gsstark@mit.edu>)
Responses Re: Indexes vs. cache flushes  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Indexes vs. cache flushes  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> But you couldn't make any meaningful changes in the definition of an
>> index, such as changing its column set, operator classes, partial-index
>> predicate, etc, except by dropping and recreating it.

> The only example that comes to mind of something you might want to be able to
> twiddle and wouldn't expect to be a slow operation is making a unique index a
> non-unique index.

I think actually that that would still work, so long as you acquired
exclusive lock on the parent table first (which you'd have to do anyway,
because this would constitute a significant change to the table's schema
--- it could invalidate plans for example).  The lock would guarantee
that no one has the index open.  It's only in the case of an opened
index that I propose not flushing the index support info.

The concerns that I find more interesting are changes in the underlying
objects.  We don't have an ALTER OPERATOR CLASS, much less an ALTER
ACCESS METHOD, but it's certainly theoretically possible to change the
definition of a support function used by an index.  There isn't
presently any mechanism to force timely propagation of such a change,
and so you'd be largely on your own --- but realistically, wouldn't such
a change require rebuilding the index anyway?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Indexes vs. cache flushes
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Indexes vs. cache flushes