question about indexing.

Поиск
Список
Период
Сортировка
От Brian Hirt
Тема question about indexing.
Дата
Msg-id 004101c14a08$2b1d0340$640b0a0a@berkhirt.com
обсуждение исходный текст
Ответы Re: question about indexing.  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
I have a table with about 1 million rows in it.  One of the columns in this
table is some sort of status (it's an int2).  Out of the million rows, only
about 100 of the rows have a status that is not like the rest.

for example:
 999,900 have the value 1
           23 have the value 2
           67 have the value 3
           10 have the value 4

I often want to fetch the rows within that subset of 100.  When i index this
column, the planner always seems to choose a table scan when i query it.
I've tried BTREE and HASH indexes and both do the same thing.

Yes, i do vacuum the table.

Does anyone know how to avoid all these table scans?

Thanks,

Brian




В списке pgsql-general по дате отправления:

Предыдущее
От: R Talbot
Дата:
Сообщение: [Fwd: Dir /pgsql/lib Files?]
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: question about indexing.