Re: Disallow redundant indexes - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: Disallow redundant indexes
Date
Msg-id c255e6ed-25f5-459b-8efc-9133636628e6@app.fastmail.com
Whole thread Raw
In response to Re: Disallow redundant indexes  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Disallow redundant indexes
List pgsql-hackers
On Mon, Apr 28, 2025, at 7:17 PM, Nathan Bossart wrote:
On Mon, Apr 28, 2025 at 01:12:18PM -0500, Sami Imseih wrote:
> 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 don't doubt that this is a problem in the field, but I'm not sure I'm
convinced it's worthwhile to emit a warning that only appears for exact
duplicates and is very easily missed, not to mention that the user could be
intentionally creating the index.

I don't like to idea of a new GUC to control an SQL command. The WARNING seems
fragile because it doesn't solve the problem. I also don't want to disallow
duplicate indexes; it can break old routines. If we want to do something about
it, I would say let's add a psql meta command or even a new view to show
duplicate indexes. I do think that official maintenance queries are a good to
step forward to make life easier for DBAs.


--
Euler Taveira

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: libpq: Add PQapplicationname() function
Next
From: Peter Eisentraut
Date:
Subject: Re: What's our minimum supported Python version?