Re: unexpected external sort Disk

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Manuel Kniep <rapimo(at)adeven(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: unexpected external sort Disk
Date: 2013-06-20 18:42:45
Message-ID: CAMkU=1w2y87NJueqwN8-HK2KDb4UOihFAJXpO1NZ3EkHZvBmmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 20, 2013 at 6:12 AM, Manuel Kniep <rapimo(at)adeven(dot)com> wrote:

> Hello,
>
> I have table with 37 million entries the whole table has a size of 2.3 GB
>
> Although I have set the work_mem to 10 GB
>

There is one piece of memory used in in-memory sorting that (currently) has
to be a single contiguous allocation, and that piece is limited to 1GB.
This means you can't always use the entire amount of work_mem declared,
especially when sorting a very large number of very short rows, as you seem
to be doing.

There is another "rounding" issue that means sometimes as little as 512MB
of that 1GB is actually used. This part is probably fixed for 9.3.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2013-06-20 18:54:35 Re: Exporting Data
Previous Message Jeff Janes 2013-06-20 18:07:39 Re: Do not understand high estimates of index scan vs seq scan