Обсуждение: index does not help on ranges

Поиск
Список
Период
Сортировка

index does not help on ranges

От
Peter Pilsl
Дата:
Assuming a simple table with 1.000.000 entries. One column is type
integer and running from 1 to 1.000.000 (sequence). There is an index
on this column, so queries like

select * from many where serial=784193;

are pretty fast. However, such simple queries like

select * from many where serial<10;

take very long time. The query doesnt use the index in this case. Is
this a problem on my side or is this a prinicipal thing ?

thnx,
peter

--
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: pilsl@goldfisch.at
sms  : pilsl@max.mail.at

pgp-key available