Re: redundants indexes can be created

From: Cyril SCETBON <scetbon(at)echo(dot)fr>
To: depesz(at)depesz(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: redundants indexes can be created
Date: 2008-07-04 10:09:35
Message-ID: 486DF6DF.7080408@echo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hubert depesz lubaczewski wrote:
> On Fri, Jul 04, 2008 at 11:54:37AM +0200, Cyril SCETBON wrote:
>
>> Why postgres does not disallow creating redundants indexes ? Is it the
>> same behaviour in postgresql 8.3 ?
>>
>
> Why should it? Redundant indexes are not "bugs". And can be very useful
> sometimes (thing concurrent reindexing).
>
in this case your right, but lot of people are confused with primary key
and unique key. So they create a unique key on the same column that
constitute the primary key. For example, Oracle inhib it :

SQL> create table toto(id int primary key);

Table created.

SQL> create unique index idx_toto_id on toto(id);
create unique index idx_toto_id on toto(id)
*
ERROR at line 1:
ORA-01408: such column list already indexed

concurrent reindexing is the matter of postgresql, it should create it
transparently when needed. And if I take into account the concurrent
reindexing, why permitting more than 2 index on the same column ?

--
Cyril SCETBON

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Cyril SCETBON 2008-07-04 10:13:21 Re: redundants indexes can be created
Previous Message Richard Huxton 2008-07-04 10:04:17 Re: redundants indexes can be created