Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]
Дата
Msg-id 20458.1018275305@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Seq. scan when using comparison operators, why? [netaktiv.com #150]  (Stephane Bortzmeyer <bortzmeyer@netaktiv.com>)
Ответы Re: Seq. scan when using comparison operators, why? [netaktiv.com #150]  (Stephane Bortzmeyer <bortzmeyer@netaktiv.com>)
Список pgsql-general
Stephane Bortzmeyer <bortzmeyer@netaktiv.com> writes:
> I have an index on column "numero". When, I use a WHERE numero=8,
> PostgreSQL uses an index scan (OK) but no when using comparison
> operators like numero>8.

That is the default behavior in the absence of any VACUUM ANALYZE
stats (and your explains look suspiciously like default stats).

If you have stats then the choice will depend on how much of the table
the planner estimates will be scanned.  An indexscan is generally not
a win for scanning more than a few percent of a table.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: inherited columns as foreign keys WAS "no subject"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: numeric test on RiscPC