[PATCH] To remove EXTEND INDEX

Lists: pgsql-generalpgsql-hackers
From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 13:51:40
Message-ID: 20010713235140.A9930@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Hi,

As promised, here is a patch to remove all support for the (non-functional
anyway) EXTEND INDEX statement. See earlier emails for more explanations.

Note, this patch makes it as if it never existed. So, if you think some of
the code may be useful, now is the time to speak up! :)

Since this patch conflicts with my currently pending patch for partial
indices, I put it here for review. I will submit a new patch to -patches
once the other is in.

http://svana.org/kleptog/pgsql/remove-extend.patch
--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.


From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 15:06:09
Message-ID: 3B4F0E61.B06FE865@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> Note, this patch makes it as if it never existed. So, if you think some of
> the code may be useful, now is the time to speak up! :)

Shouldn't this conversation be happening on the -hackers list? TIA

- Thomas


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)fourpalms(dot)org
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 16:07:22
Message-ID: 200107131607.f6DG7Mv15671@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> > Note, this patch makes it as if it never existed. So, if you think some of
> > the code may be useful, now is the time to speak up! :)
>
> Shouldn't this conversation be happening on the -hackers list? TIA

Actually, because it had a patch attached, it should go to patches,
right?

--
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


From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: lockhart(at)fourpalms(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 20:56:12
Message-ID: 3B4F606C.C1CEB06B@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> > > Note, this patch makes it as if it never existed. So, if you think some of
> > > the code may be useful, now is the time to speak up! :)
> > Shouldn't this conversation be happening on the -hackers list? TIA
> Actually, because it had a patch attached, it should go to patches,
> right?

imho, no. Because there needs to be a discussion about whether to remove
code from the tree, and whether that code may be useful for something
else.

-patches is designed to take actual patch files (to reduce bandwidth on
-hackers) but not to host planning discussions. If this had been a
simple patch without feature changes or other larger ramifications, then
it is more clearly a patch-only topic.

- Thomas


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: lockhart(at)fourpalms(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 21:00:22
Message-ID: 200107132100.f6DL0Mf07284@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> > > > Note, this patch makes it as if it never existed. So, if you think some of
> > > > the code may be useful, now is the time to speak up! :)
> > > Shouldn't this conversation be happening on the -hackers list? TIA
> > Actually, because it had a patch attached, it should go to patches,
> > right?
>
> imho, no. Because there needs to be a discussion about whether to remove
> code from the tree, and whether that code may be useful for something
> else.
>
> -patches is designed to take actual patch files (to reduce bandwidth on
> -hackers) but not to host planning discussions. If this had been a
> simple patch without feature changes or other larger ramifications, then
> it is more clearly a patch-only topic.

What some people do is split the patch text with the actual patch. I
don't like it sometimes, but I hesistate to post big patches to hachers,
even if they require discussion.

--
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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: lockhart(at)fourpalms(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 21:13:10
Message-ID: 200107132113.f6DLDAh08200@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> > > > Note, this patch makes it as if it never existed. So, if you think some of
> > > > the code may be useful, now is the time to speak up! :)
> > > Shouldn't this conversation be happening on the -hackers list? TIA
> > Actually, because it had a patch attached, it should go to patches,
> > right?
>
> imho, no. Because there needs to be a discussion about whether to remove
> code from the tree, and whether that code may be useful for something
> else.
>
> -patches is designed to take actual patch files (to reduce bandwidth on
> -hackers) but not to host planning discussions. If this had been a
> simple patch without feature changes or other larger ramifications, then
> it is more clearly a patch-only topic.

Sorry. I thought the posting had an attached patch. I now see it is a
URL. I was wrong.

--
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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 21:49:56
Message-ID: 18711.995060996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Let's drop the meta-discussions and cut to the chase: given that we are
about to re-enable partial indexes, should we try to make EXTEND INDEX
work too, or just remove it?

The idea of EXTEND INDEX is to allow replacement of a partial index's
predicate. However, the implementation only supports weakening the
predicate, ie, it can only add tuples to the index not remove them.
The index's predicate is actually turned into (old predicate OR new
predicate), which seems counterintuitive to me.

I am not sure that EXTEND INDEX is actually broken. I originally
thought that the new predicate would replace the old, which would be
wrong --- but I now see the OR-ing behavior in UpdateIndexPredicate, so
it's not necessarily busted. The question is whether the feature has
enough usefulness to be worth supporting and documenting forevermore.
You can accomplish the same things, and more, by dropping the index and
building a new one; what's more, at least in the btree case building a
new one is likely to be much faster (the EXTEND code has to do retail
insertion, not a SORT-based build).

So, is it worth expending any effort on EXTEND INDEX? It seems to me
that it's a fair amount of code bulk and complexity for very very
marginal return. I'd like to simplify the index AM API by getting
rid of the concept.

regards, tom lane


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: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-13 22:34:22
Message-ID: 200107132234.f6DMYMe12122@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> Let's drop the meta-discussions and cut to the chase: given that we are
> about to re-enable partial indexes, should we try to make EXTEND INDEX
> work too, or just remove it?
>
> The idea of EXTEND INDEX is to allow replacement of a partial index's
> predicate. However, the implementation only supports weakening the
> predicate, ie, it can only add tuples to the index not remove them.
> The index's predicate is actually turned into (old predicate OR new
> predicate), which seems counterintuitive to me.
>
> I am not sure that EXTEND INDEX is actually broken. I originally
> thought that the new predicate would replace the old, which would be
> wrong --- but I now see the OR-ing behavior in UpdateIndexPredicate, so
> it's not necessarily busted. The question is whether the feature has
> enough usefulness to be worth supporting and documenting forevermore.
> You can accomplish the same things, and more, by dropping the index and
> building a new one; what's more, at least in the btree case building a
> new one is likely to be much faster (the EXTEND code has to do retail
> insertion, not a SORT-based build).
>
> So, is it worth expending any effort on EXTEND INDEX? It seems to me
> that it's a fair amount of code bulk and complexity for very very
> marginal return. I'd like to simplify the index AM API by getting
> rid of the concept.

We don't let people add columns to an existing index so I don't see why
we should have EXTEND INDEX unless index twiddling is more common with
partial indexes.

--
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


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-14 00:34:06
Message-ID: 20010714103406.A11863@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On Fri, Jul 13, 2001 at 05:49:56PM -0400, Tom Lane wrote:
> Let's drop the meta-discussions and cut to the chase: given that we are
> about to re-enable partial indexes, should we try to make EXTEND INDEX
> work too, or just remove it?

Just a few clarifications:

* The reason it didn't go to -hackers was because I wasn't subscribed to it
and hence couldn't post to it. The only reason I can now is because I
subscribed (nopost) about 2 minutes ago.

* I discussed this with Tom Lane on -general a few days ago. I'm not sure
how many people saw that though. Are most of the people on -hackers
subscribed to -general as well?

* I agree with Tom's assertion that it's an awful lot of complexity for such
a marginal gain. Look at the size of the patch and the fact that it has all
been useless for the last few years.

* I didn't send it to -patches because it's not ready yet.

* Only posted a URL, not the patch itself. Sorry for the confusion.

Tom actually suggested doing this at the same time as re-enabling partial
indices but I favoured a separate patch considering the large number of
scattered changes.

Anyway, is there a concensus, or shall I forget the whole thing?

--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-14 00:36:28
Message-ID: 20010714103628.B11863@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On Fri, Jul 13, 2001 at 06:34:22PM -0400, Bruce Momjian wrote:
> > Let's drop the meta-discussions and cut to the chase: given that we are
> > about to re-enable partial indexes, should we try to make EXTEND INDEX
> > work too, or just remove it?
>
> We don't let people add columns to an existing index so I don't see why
> we should have EXTEND INDEX unless index twiddling is more common with
> partial indexes.

We don't allow people currently to fiddle with indices at all. I don't
understand the origin of EXTEND INDEX since I can't think of a situation
where it would actually be useful.

--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-14 00:57:08
Message-ID: 200107140057.f6E0v8m18288@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

> * I agree with Tom's assertion that it's an awful lot of complexity for such
> a marginal gain. Look at the size of the patch and the fact that it has all
> been useless for the last few years.
>
> * I didn't send it to -patches because it's not ready yet.
>
> * Only posted a URL, not the patch itself. Sorry for the confusion.
>
> Tom actually suggested doing this at the same time as re-enabling partial
> indices but I favoured a separate patch considering the large number of
> scattered changes.
>
> Anyway, is there a concensus, or shall I forget the whole thing?

I vote for removing the feature. Removing stuff of doubtful usefulness
is a big gain.

--
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


From: Bernard Frankpitt <frankpit(at)erols(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-14 13:45:50
Message-ID: 3B504D0E.F5DB6939@erols.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers


> We don't let people add columns to an existing index so I don't see why
> we should have EXTEND INDEX unless index twiddling is more common with
> partial indexes.
>

Nothing is common with partial indexes at the moment -- the feature is
not currently implemented, and I don't think other databases adopted the
idea.

From memory (*), Stonebraker's original intention for partial indexes
was that they would be used with really large tables in a situation
where you would might to process the table incrementally, a chunk at a
time, an example might be archiving historical data based on date. You
only want to archive information older than a certain date, so you use a
partial index predicated on t < t_0. You then do your archive processing
on those tuples, delete the tuples from the table, and extend the
predicate forward by an interval in aticipation of the next archiving
cycle.

The example is not perfect, but I think that it indicates what the
original author's were thinking. You also have to ask yourself when
would this approach be better than just indexing the whole table, and
use the predicate in the query qualification.

Bernie

(*) The partial indexes are mentioned briefly in one of the Stonebraker
papers. Sorry, I don't have an exact reference, but it is probably in
one of the Stonebraker publications referenced by

http://techdocs.postgresql.org/oresources.php


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: [PATCH] To remove EXTEND INDEX
Date: 2001-07-15 14:35:18
Message-ID: 200107151435.f6FEZJ904338@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> Hi,
>
> As promised, here is a patch to remove all support for the (non-functional
> anyway) EXTEND INDEX statement. See earlier emails for more explanations.
>
> Note, this patch makes it as if it never existed. So, if you think some of
> the code may be useful, now is the time to speak up! :)
>
> Since this patch conflicts with my currently pending patch for partial
> indices, I put it here for review. I will submit a new patch to -patches
> once the other is in.
>
> http://svana.org/kleptog/pgsql/remove-extend.patch
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org>
> http://svana.org/kleptog/
> > It would be nice if someone came up with a certification system that
> > actually separated those who can barely regurgitate what they crammed over
> > the last few weeks from those who command secret ninja networking powers.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>

--
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