Re: Disallow redundant indexes - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Disallow redundant indexes
Date
Msg-id CAA5RZ0uT66vWt8ndJtV47LRKnc6kp1TzcF9Pe=pQ8JhUqj6kJg@mail.gmail.com
Whole thread Raw
In response to Re: Disallow redundant indexes  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: Disallow redundant indexes
List pgsql-hackers
> > > I've had this idea before, and even wrote a quick POC at one point, but I had it simply throw a warning rather
thanan
 
> > > error. That avoids the need for any GUC, which I agree is not a good idea. And it still allows people to create
a
> > > duplicate index if they really want to.
> > >
> >
> > I also appreciate your suggestion regarding the GUC parameter.  You've
> > convinced me that a warning might be a more appropriate approach.  A warning
> > would still alert users to the potential issue of creating a redundant index,
> > while allowing them to proceed if they have a specific reason to do so.

> +1 to a warning.

If I had a dollar for every time I asked a user to check for duplicate
indexes :) So
I think it's a good idea to provide some way to detect these ( besides
a query in the
Wiki ), but I don't think we should prevent it.

While a WARNING will be a good to have, it could easily go unnoticed,
but it's still good to have.

I also think we should either provide a psql shortcut to detect these indexes or
to add annotation to an index in the \d <table> command, or perhaps both of
these things.


--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Parallel heap vacuum
Next
From: Masahiko Sawada
Date:
Subject: Re: Fix slot synchronization with two_phase decoding enabled