Out of memory during index creation

From: Alanoly Andrews <alanolya(at)invera(dot)com>
To: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Out of memory during index creation
Date: 2011-04-11 18:49:33
Message-ID: 09B23E7BF70425478C1330D893A722C603075D2A98@MailSVR.invera.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

PG version 8.4.7 on AIX 6.1.
While creating a large multi-column index on a table of about 2.5 million rows, I got the following error:
ERROR: out of memory
DETAIL: Failed on request of size 50331648.

I doubled the value of the "shared_buffers" parameter (from 512Mb to 1024Mb), recycled the PG instance and then was able to run the "create index" statement successfully.

Question: Does PG use a main memory sort algorithm for the creation of indexes? Can it not make do with whatever memory is available and supplement it with disk space (external sort)? I have a temporaray tablespace defined (with the "temp_tablespaces") parameter. The disk area for this tablespace had about 2GB of free space available. But the sort does not seem to have used it.

Thanks.

Alanoly Andrews.

****************************************************
This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courriel est confidentiel et protg. L'expditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) dsign(s) est interdite. Si vous recevez ce courriel par erreur, veuillez m'en aviser immdiatement, par retour de courriel ou par un autre moyen.
****************************************************

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2011-04-11 19:06:40 Re: Re: multiple hot standby streaming replication scenario with "rotating" the primary server
Previous Message Gerhard Hintermayer 2011-04-11 18:45:39 Re: Re: multiple hot standby streaming replication scenario with "rotating" the primary server