Re: in-memory sorting

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: in-memory sorting
Date: 2010-08-19 05:55:15
Message-ID: AANLkTin3oDOHshn29=YgiS9BYHFD2Jt23WPwociKg8qT@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Samuel Gendler 2010-08-19 06:14:10 yet another q
Previous Message Samuel Gendler 2010-08-19 05:45:58 Re: in-memory sorting