How does the planner deal with multiple possible indexes? - Mailing list pgsql-hackers

From Jim C. Nasby
Subject How does the planner deal with multiple possible indexes?
Date
Msg-id 20060719215800.GC83250@pervasive.com
Whole thread Raw
Responses Re: How does the planner deal with multiple possible indexes?  ("Gregory Maxwell" <gmaxwell@gmail.com>)
List pgsql-hackers
Client has a table with 9 indexes; one is on just ident_id and takes up
75181 pages, the other is on ident_id and another field and uses 117461
pages.  

"bdata__ident_filed_departure" btree (ident_id, filed_departuretime), tablespace "array4"
"bdata_ident" btree (ident_id), tablespace "array4"


Whats interesting is that even a simple

SELECT * FROM table WHERE ident_id=1234

uses bdata__ident_filled_departure, even though it would require less IO
to use bdata_ident.

\d does list bdata__ident_filed_departure before bdata_ident; I'm
wondering if the planner is finding the first index with ident_id in it
and stopping there?
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: pgxs problem
Next
From: Joe Conway
Date:
Subject: Re: pgxs problem