| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера