Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id DEECF2E0140 for ; Mon, 26 May 2008 21:17:10 -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 67649-04-4 for ; Mon, 26 May 2008 21:16:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by developer.postgresql.org (Postfix) with ESMTP id 5E50B2E00CD for ; Mon, 26 May 2008 21:09:36 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 3so1211680ywj.73 for ; Mon, 26 May 2008 17:09:30 -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=u/HLVebRGR6sJ9zxlas2Yk+OHV/xFgMBdkDJ+0zoM/c=; b=u9imohWwc4njAY/SRCawFIBOs+fyYFQck+mrKhgsLQDcws5ZVjkMBc1BcYVa6E84UXpml7xUsih6JGHgYteDuVSB++DS+LOL76bSiOupOANrKMzOJ1h5LscBVnWNcgU9FwxK2jSAyB4r4o7U8pAPU5Ur2BS55EuySREqhUQnt+s= 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=qdIoyqLNJR0asLeAbncTe1uxAThfUx6Gk2Z/8BBCLGS0TP6K+mVWZHwT6DWqkGjA/GNdc6lQt1vyrkLC2JGSgyT4XSNS0iwEjIV7jfjwYUgBHvFx2gy4xWJTfDOdlYIM5M9bNi3xkOL+VxCc+dEVT90wbWmSnn34g4TonCRUJ+8= Received: by 10.150.11.2 with SMTP id 2mr3313128ybk.12.1211846970523; Mon, 26 May 2008 17:09:30 -0700 (PDT) Received: by 10.150.138.11 with HTTP; Mon, 26 May 2008 17:09:30 -0700 (PDT) Message-ID: Date: Mon, 26 May 2008 20:09:30 -0400 From: "David Wilson" To: Justin Subject: Re: select query takes 13 seconds to run with index Cc: mark , pgsql-general@postgresql.org In-Reply-To: <483B4729.7050402@emproshunts.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com> <483B4729.7050402@emproshunts.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/958 X-Sequence-Number: 133357 On Mon, May 26, 2008 at 7:26 PM, Justin wrote: > The estimate is way off, when was the last time Vaccum was on the table? I'm going to second this- run "ANALYZE pokes;" and then test the query again; I'll bet you'll get much better results. It's not the VACUUM that matters so much as the ANALYZE, and it definitely needs to be done on occasion if you're adding a lot of records. Do you have the autovacuum daemon running? (And if not, why not?) -- - David T. Wilson david.t.wilson@gmail.com