Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1CC85133740B for ; Mon, 11 Apr 2011 17:13:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 57193-04 for ; Mon, 11 Apr 2011 20:12:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qmta14.emeryville.ca.mail.comcast.net (qmta14.emeryville.ca.mail.comcast.net [76.96.27.212]) by mail.postgresql.org (Postfix) with ESMTP id CDB6D133616B for ; Mon, 11 Apr 2011 17:12:38 -0300 (ADT) Received: from omta04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by qmta14.emeryville.ca.mail.comcast.net with comcast id WKp51g00F0lTkoCAELCdb8; Mon, 11 Apr 2011 20:12:38 +0000 Received: from homie ([69.59.255.15]) by omta04.emeryville.ca.mail.comcast.net with comcast id WLBt1g01F0LiXQt8QLC60U; Mon, 11 Apr 2011 20:12:30 +0000 Received: by homie (Postfix, from userid 1000) id 7C51420BA7; Mon, 11 Apr 2011 16:11:52 -0400 (EDT) From: Jerry Sievers To: Alanoly Andrews Cc: "'pgsql-admin\@postgresql.org'" Subject: Re: Out of memory during index creation References: <09B23E7BF70425478C1330D893A722C603075D2A98@MailSVR.invera.com> Date: Mon, 11 Apr 2011 16:11:52 -0400 In-Reply-To: <09B23E7BF70425478C1330D893A722C603075D2A98@MailSVR.invera.com> (Alanoly Andrews's message of "Mon, 11 Apr 2011 14:49:33 -0400") Message-ID: <87fwpo4kfr.fsf@comcast.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.355 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/95 X-Sequence-Number: 37276 Alanoly Andrews writes: > 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 It can and does but for sorting too large to be done in maintenance_work_mem. If your box doesn't have enough virtual mem to support shared_buffers, work_mem on behalf of all live backends, whatever the OS needs... you'll get an error like that while Pg is trying to alloc for the maintenance_work_mem chunk. Inspect your logs for more cases of that error since autovac can run into the same problem. HTH > 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 prot?g?. L'exp?diteur 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) d?sign?(s) est interdite. Si vous recevez ce courriel par erreur, veuillez m'en aviser imm?diatement, par > retour de courriel ou par un autre moyen. > > Mail sent via the Abaca EPG > ------------------------------------------------------------------------------------------------------------------------------ > -- Jerry Sievers e: gsievers19@comcast.net p: 305.321.1144