multiple indexes on the same column - Mailing list pgsql-general

From Tiffany Thang
Subject multiple indexes on the same column
Date
Msg-id CAB_W-NNpcyQEpMba42401yupk_7t4vY2cgA2gEty7oGTzUxd_w@mail.gmail.com
Whole thread Raw
Responses Re: multiple indexes on the same column  (Geoff Winkless <pgsqladmin@geoff.dj>)
Re: multiple indexes on the same column  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,
Can someone explain the use of creating multiple indexes on the same column? 

How would the optimizer determine which index to use? From my brief testing, the optimizer picked the latest created index, testidx3. Can you provide a scenario where creating multiple indexes on the same column would be beneficial? 

create table test (a int, b int);
create index testidx1 on test (a);
create index testidx2 on test (a);
create index testidx3 on test (a);


Thanks.

Tiff

pgsql-general by date:

Previous
From: rihad
Date:
Subject: Re: When do vacuumed pages/tuples become available for reuse?
Next
From: Geoff Winkless
Date:
Subject: Re: multiple indexes on the same column