Re: Which index is fastest
Posted in 1999
Topics: General Discussion
Choose the field with the largest number of values in its domain with the best even distribution over that domain to be the 'head' of the index. For most RDMS the 'head' (first value) of the index is the most important in a composit index. -- --------------------------------------------------------- Steven Hauser email: hause011@tc.umn.edu URL: http://www.tc.umn.edu/~hause011 ---------------------------------------------------------
So, if you have such a table:
people
(name,
gender (F,M),
zip)
and you usually search:
select * from people
where gender = "F" and zip = "CA"
Which index would be better ?
(gender, zip) or (zip, gender)
On 3 Mar 1999 17:17:16 -0600, hause011@garnet.tc.umn.edu (Steven
Hauser) wrote:
>Choose the field with the largest number of values in its domain
>with the best even distribution over that domain to be the
>'head' of the index.
>
>For most RDMS the 'head' (first value) of the index is the most
>important in a composit index.
Thanks a lot,
Manel Falcó
SEMIC, S.A.
Lleida-Catalonia-Spain-Europe
-----------------------------------------------------
Informix version: Informix SE 5.07 / RDS 4.x & 4J's
Operating system: Unix SCO V 5.04
-----------------------------------------------------