Re: work_mem = 900MB but Sort Method: external merge Disk: 304008kB
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: work_mem = 900MB but Sort Method: external merge Disk: 304008kB |
| Дата | |
| Msg-id | 3175.1298396342@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: work_mem = 900MB but Sort Method: external merge Disk: 304008kB (Andreas Kretschmer <akretschmer@spamfence.net>) |
| Список | pgsql-general |
Andreas Kretschmer <akretschmer@spamfence.net> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Reid Thompson <Reid.Thompson@ateb.com> writes:
>>> What am I missing that causes this to resort to sorting on disk?
>>
>> The in-memory space required to sort N tuples can be significantly
>> larger than the on-disk space,
> Question: when is the planner making the decision between in-memory and
> on-disk, at planning-time or at execution time with the knowledge about
> the real amount of tuples?
The planner doesn't make that decision. tuplesort.c always starts in
in-memory mode, and flips to on-disk when the actual amount of data in
its care exceeds work_mem. The planner guesses whether that will happen
while making cost estimates, but it's only an estimate.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера