Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 7A4EB2E00A8 for ; Thu, 22 May 2008 10:38:42 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71390-07 for ; Thu, 22 May 2008 10:38:32 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by developer.postgresql.org (Postfix) with ESMTP id 34C002E00A6 for ; Thu, 22 May 2008 10:38:27 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id n4so55134wag.5 for ; Thu, 22 May 2008 06:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=gXGJBSWkv1PpVEk1oCNMIWhXCmhmSCru55f7WdTzILk=; b=D2ZgY9DT6ha4FOJiLIMmULZSRuiE+bjgeJC32wZ0C+PobN3ImLCVjOShyjBA9XHwL1CX6AceD7TmUgMhsip7IR7HpfPo9ZV/AVmEzpdE4cU5Vo4boSRxTNLK49nvfH27slLR27XUpILlW9IvJ0U4LN2V6u5n7t67Nr8VSJSIknc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PB0M05NNwGWl2s6ii6wYhAQWLERjdmd+NHMXSMtLoe3RiIUULQORdbtIJ7qwZPFtdI/abMebex7ZZS+2oB39GHrFps+CBbQgvhZEndCgAy9/JuKCK1LDn6+z0Xls206KSKhyzuo42D8RLDTTnrB2goUnhY/CjLtgTPUVtaowSO0= Received: by 10.114.111.1 with SMTP id j1mr77037wac.141.1211463505938; Thu, 22 May 2008 06:38:25 -0700 (PDT) Received: by 10.114.155.9 with HTTP; Thu, 22 May 2008 06:38:25 -0700 (PDT) Message-ID: <1d4e0c10805220638x64f80609ob9a6fe00e4587362@mail.gmail.com> Date: Thu, 22 May 2008 15:38:25 +0200 From: "Guillaume Smet" To: "Tom Lane" Subject: Re: Index creation time and distribution Cc: pgsql-performance In-Reply-To: <29529.1211462076@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1d4e0c10805220532v514c2bd5je4c6c20ceb485495@mail.gmail.com> <29529.1211462076@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/305 X-Sequence-Number: 30273 On Thu, May 22, 2008 at 3:14 PM, Tom Lane wrote: > Do you have maintenance_work_mem set large enough that the index > creation sort is done in-memory? 8.1 depends on the platform's qsort > and a lot of them are kinda pessimal for input like this. FWIW, it's a 32 bits CentOS 4.6 box. maintenance_work_mem is set to 256 MB and the size of the index is 400 MB. Should I try to raise it up to 512 MB? The server only has 2GB of RAM so it seems a bit high. > 8.2 (which uses our own qsort) seems to perform better in a quick > test. Mmmmh OK. I was considering an upgrade to 8.3 in the next months anyway. Do we agree that in the case of unnamed prepared statement, 8.3 plans the query after the BIND? The partial index seems to be a better solution anyway, considering that it's 12 MB vs 400 MB. Thanks. -- Guillaume