Re: in-memory sorting

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: in-memory sorting
Date: 2010-08-19 05:45:58
Message-ID: AANLkTi=4U7m-PViREaJxAgXrjdvQ6juJmJEWkSfGSvZ6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Answered my own question. Cranking work_mem up to 350MB revealed that
the in-memory sort requires more memory than the disk sort.

On Wed, Aug 18, 2010 at 10:23 PM, Samuel Gendler
<sgendler(at)ideasculptor(dot)com> wrote:
> I've got this explain: http://explain.depesz.com/s/Xh9
>
> And these settings:
> default_statistics_target = 50 # pgtune wizard 2010-08-17
> maintenance_work_mem = 1GB # pgtune wizard 2010-08-17
> constraint_exclusion = on # pgtune wizard 2010-08-17
> checkpoint_completion_target = 0.9 # pgtune wizard 2010-08-17
> effective_cache_size = 36GB # sam
> work_mem = 288MB # pgtune wizard 2010-08-17
> wal_buffers = 8MB # pgtune wizard 2010-08-17
> #checkpoint_segments = 16 # pgtune wizard 2010-08-17
> checkpoint_segments = 30 # sam
> shared_buffers = 11GB # pgtune wizard 2010-08-17
> max_connections = 80 # pgtune wizard 2010-08-17
> cpu_tuple_cost = 0.0030                 # sam
> cpu_index_tuple_cost = 0.0010           # sam
> cpu_operator_cost = 0.0005              # sam
> #random_page_cost = 2.0                 # sam
>
> 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?
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2010-08-19 05:55:15 Re: in-memory sorting
Previous Message Samuel Gendler 2010-08-19 05:23:52 in-memory sorting