Skip site navigation (1) Skip section navigation (2)

Re: 2GB or not 2GB

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: 2GB or not 2GB
Date: 2008-05-31 19:41:14
Message-ID: 87prr2jm79.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-performance
"Josh Berkus" <josh(at)agliodbs(dot)com> writes:

> Simon,
>
>> There is an optimum for each specific sort.
>
> Well, if the optimum is something other than "as much as we can get", then we 
> still have a pretty serious issue with work_mem, no?

With the sort algorithm. The problem is that the database can't predict the
future and doesn't know how many more records will be arriving and how out of
order they will be.

What appears to be happening is that if you give the tape sort a large amount
of memory it keeps a large heap filling that memory. If that large heap
doesn't actually save any passes and doesn't reduce the number of output tapes
then it's just wasted cpu time to maintain such a large heap. If you have any
clever ideas on how to auto-size the heap based on how many output tapes it
will create or avoid then by all means speak up.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

In response to

pgsql-performance by date

Next:From: Simon RiggsDate: 2008-06-01 09:10:40
Subject: Re: 2GB or not 2GB
Previous:From: Josh BerkusDate: 2008-05-31 18:53:13
Subject: Re: 2GB or not 2GB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group