Re: question about indexing.

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: question about indexing.
Дата
Msg-id m3eloota4c.fsf@belphigor.mcnaught.org
обсуждение исходный текст
Ответ на question about indexing.  ("Brian Hirt" <bhirt@mobygames.com>)
Ответы Abort State sensitivity?  ("Command Prompt, Inc." <pgsql-general@commandprompt.com>)
Список pgsql-general
"Brian Hirt" <bhirt@mobygames.com> writes:

> 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.

> Yes, i do vacuum the table.
>
> Does anyone know how to avoid all these table scans?

Cast the value you're testing against in the query to int2 and you may
see an improvement.  The planner isn't currently smart enough to
realize it can use the index when the test value in the query is an
int4.

-Doug
--
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm.    -Dylan

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

Предыдущее
От: "Brian Hirt"
Дата:
Сообщение: Re: question about indexing.
Следующее
От: 진희 김
Дата:
Сообщение: Thank you for your service....