Re: [PERFORM] Index not being used in sorting of simple table

2007-05-04 Thread Paul Smith
At 16:26 04/05/2007, you wrote: Paul Smith wrote: Why doesn't it use the other index? If use 'set enable_seqscan=0' then it does. Just a guess, but is the table clustered on column a? Maybe not explicitly, but was it loaded from data that was sorted by a? I wouldn't ha

[PERFORM] Index not being used in sorting of simple table

2007-05-04 Thread Paul Smith
This is in Postgres 8.1.5 I have a table like CREATE TABLE x (a VARCHAR, b VARCHAR, c VARCHAR); CREATE INDEX y on x(a); CREATE INDEX z on x(b); There are over a million rows in 'x'. Neither a nor b are unique. There are probably about 20 or so distinct values of a and 30 or so distinct values