Re: [PERFORM] Poor index choice -- multiple indexes of the same columns

2005-06-28 Thread Tom Lane
"Karl O. Pinc" <[EMAIL PROTECTED]> writes: > I have a query > select 1 > from census > where date < '1975-9-21' and sname = 'RAD' and status != 'A' > limit 1; > Explain analyze says it always uses the index made by: >CREATE INDEX census_date_sname ON census (date, sname); > this is ev

Re: [PERFORM] Poor index choice -- multiple indexes of the same columns

2005-06-27 Thread Josh Berkus
Karl, > Seems to me that when there's a constant value in the query > and an = comparision it will always be faster to use the (b-tree) > index that's ordered first by the constant value, as then all further > blocks are guarenteed to have a higher relevant information > density. At least when co