Re: in-memory sorting - Mailing list pgsql-performance

From Pavel Stehule
Subject Re: in-memory sorting
Date
Msg-id AANLkTin3oDOHshn29=YgiS9BYHFD2Jt23WPwociKg8qT@mail.gmail.com
Whole thread Raw
In response to Re: in-memory sorting  (Samuel Gendler <sgendler@ideasculptor.com>)
List pgsql-performance
Hello
>>
>> I'm not understanding why it is sorting on disk if it would fit within
>> a work_mem segment - by a fairly wide margin.  Is there something else
>> I can do to get that sort to happen in memory?
>>

Planner working with estimations. So there is some probability so
planner expected a larger result set and used a external sort.
Probably quick sort takes more memory too. Your statistic are probably
out of range - system expecting 0.5 mil rec and get 2 mil rec.

Regards

Pavel

pgsql-performance by date:

Previous
From: Samuel Gendler
Date:
Subject: Re: in-memory sorting
Next
From: Samuel Gendler
Date:
Subject: yet another q