Re: why my query is not using index??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: why my query is not using index??
Дата
Msg-id 28283.1097558813@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: why my query is not using index??  (Francisco Reyes <lists@natserv.com>)
Список pgsql-performance
Francisco Reyes <lists@natserv.com> writes:
> With explain analyze I have with sequential scan on
> Sort  (cost=382.01..382.15 rows=56 width=196)
> (actual time=64.346..64.469 rows=24 loops=1)

> And with seqscan off
> Sort  (cost=490.82..490.96 rows=56 width=196)
> (actual time=56.668..56.789 rows=24 loops=1)

> So I guess that for this particular query I am better off setting the
> seqscan off.

For that kind of margin, you'd be a fool to do any such thing.

You might want to look at making some adjustment to random_page_cost
to bring the estimated costs in line with reality (though I'd counsel
taking more than one example into account while you tweak it).  But
setting seqscan off as a production setting is just a recipe for
shooting yourself in the foot.

            regards, tom lane

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

Предыдущее
От: Gabriele Bartolini
Дата:
Сообщение: Re: Normal case or bad query plan?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Normal case or bad query plan?