Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
В списке pgsql-committers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first |
| Дата | |
| Msg-id | 18677.1178287448@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first (Magnus Hagander <magnus@hagander.net>) |
| Ответы |
Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
|
| Список | pgsql-committers |
Magnus Hagander <magnus@hagander.net> writes:
> Is there some way to see in the generated query plan if this optimisation
> is used?
If there's a SORT just below a LIMIT (that has a limit, ie it's not just
an OFFSET), then it's potentially used. Whether it's actually used
depends on actual row counts and widths at runtime --- you'd have to
turn on trace_sort and look at the log output to determine that.
Also, if you want to experiment, you can compile with -DDEBUG_BOUNDED_SORT
to have a GUC variable optimize_bounded_sort that disables the new code
for comparison purposes.
regards, tom lane
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера