Re: Okay, how about indexes versus unique/primary constraints? - Mailing list pgsql-hackers

From Curt Sampson
Subject Re: Okay, how about indexes versus unique/primary constraints?
Date
Msg-id Pine.NEB.4.44.0207111335460.436-100000@angelic.cynic.net
Whole thread Raw
In response to Okay, how about indexes versus unique/primary constraints?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 10 Jul 2002, Tom Lane wrote:

> As I currently have Rod's dependency code set up, an index derived from
> a UNIQUE or PRIMARY KEY clause can't be dropped directly; you must drop
> the constraint instead.
> ...
> I went out of my way to make the above happen, but now I'm wondering if
> it was a good idea or not.

I think it's a great idea. It helps make it clear just why the index was
created, so you don't get someone less familiar with the schema saying,
"we don't have any queries that use this index, so we might as well get
rid of it...."

I think this change is hardly likely to cause problems, since adding or
deleting indexes seems unlikely to be automated. It's really a system
administration activity, not something the application would do on its own.

> OTOH one might feel that the index is an implementation detail, and
> the user should only think about the constraint.

Exactly my feeling.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Okay, how about indexes versus unique/primary constraints?
Next
From: "Groff, Dana"
Date:
Subject: Re: Should this require CASCADE?