Re: Why my query not using index to sort?
| От | Tom Lane |
|---|---|
| Тема | Re: Why my query not using index to sort? |
| Дата | |
| Msg-id | 20311.1538141875@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Why my query not using index to sort? (Arup Rakshit <ar@zeit.io>) |
| Ответы |
Re: Why my query not using index to sort?
Re: Why my query not using index to sort? |
| Список | pgsql-general |
Arup Rakshit <ar@zeit.io> writes:
> My query is not using name index to sort the result.
Given the rowcounts here, I think the planner is making the right choice.
Sorting 70-some rows with a Sort node is probably cheaper than doing
random disk I/O to get them in sorted order. With more rows involved,
it might make the other choice.
As a testing measure (don't do it in production!), you could set
enable_sort = off, which will force the planner to pick a non-Sort
plan if possible. Then you could see whether that's actually faster
or slower, and by how much.
regards, tom lane
В списке pgsql-general по дате отправления: