Re: Unable to use index?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unable to use index?
Дата
Msg-id 20319.1083297675@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unable to use index?  (Edmund Dengler <edmundd@eSentire.com>)
Список pgsql-general
Edmund Dengler <edmundd@eSentire.com> writes:
> Hmm, interesting as I have that table clustered starting with the
> rep_component, so 'ps_probe' will definitely appear later in a sequential
> scan. So why does the <order by> force the use of the index?

It does not "force" anything, it simply alters the cost estimates.  The
seqscan-based plan requires an extra sort step to meet the ORDER BY,
while the indexscan plan does not.  In this particular scenario the
indexscan plan is estimated to beat seqscan+sort, but in other cases the
opposite decision might be made.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: postgresql idle
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TCP only listening on localhost???