Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 744529FB7FC for ; Tue, 3 Apr 2007 02:39:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45873-06 for ; Tue, 3 Apr 2007 02:39:15 -0300 (ADT) X-Greylist: delayed 18:12:38.626244 by SQLgrey-1.7.4 Received: from mi1.bluebottle.com (mi1.bluebottle.com [206.188.25.14]) by postgresql.org (Postfix) with ESMTP id A5B3B9FB7CE for ; Tue, 3 Apr 2007 02:39:14 -0300 (ADT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mi1.bluebottle.com (8.13.1/8.13.1) with ESMTP id l335dDh1011778 for ; Mon, 2 Apr 2007 22:39:13 -0700 DomainKey-Signature: a=rsa-sha1; s=mail; d=bluebottle.com; c=simple; q=dns; h=received:to:cc:date:from:subject:references:in-reply-to: mime-version:content-type:content-transfer-encoding:user-agent; b=Xonl8AVYKUPyAMltwvOz/oKWc92YjrHYiXiKI9evgfIuDRcNNl/0h5I+MSCNNOfVU TQlgC0G5Du+x52KQ8HuHIAaNwckyw8cp83/+Q8REKmLf0h+XqJKTtO0bsmUVLRj Message-Id: <200704030539.l335dDh1011778@mi1.bluebottle.com> Received: from localhost (internal.bluebottle.com [206.188.24.43]) (authenticated bits=0) by fe1.bluebottle.com (8.13.1/8.13.1) with ESMTP id l335dArP031479; Mon, 2 Apr 2007 22:39:13 -0700 Received: from alv-global.enator.se (alv-global.enator.se [193.15.240.60]) by mail.bluebottle.com (IMP) with HTTP for ; Mon, 02 Apr 2007 22:39:10 -0700 To: Tom Lane Cc: pgsql-admin@postgresql.org Date: Mon, 02 Apr 2007 22:39:10 -0700 From: Rickard =?iso-8859-1?b?U2r2c3Ry9m0=?= Subject: Re: PG does not use my index References: <1175253570.460cf2427984c@mail.bluebottle.com> <20418.1175271262@sss.pgh.pa.us> <1175513194.4610e86a2ffab@mail.bluebottle.com> <10497.1175529917@sss.pgh.pa.us> In-Reply-To: <10497.1175529917@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on localhost X-Virus-Status: Clean X-Trusted-Delivery: <9e949fbb1f67ce162ef6c3bc75d466d4> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.572 tagged_above=0 required=5 tests=AWL=0.572, BAYES_50=0.001, MSGID_FROM_MTA_HEADER=0, SPF_PASS=-0.001 X-Spam-Level: X-Archive-Number: 200704/20 X-Sequence-Number: 25084 Hi! I eventually tried with an 'vacuum analyse' which made postgres to use my index and the query was completed in 200 ms (insted of tens of seconds) and I was happy again! Thanks! /Rickard Citerar Tom Lane : > Rickard =?iso-8859-1?b?U2r2c3Ry9m0=?= > writes: > > fast db: > > ------------------------- > > -> Index Scan using testcase_b_bid_index on testcase > (cost=0.00..1656.82 rows=426 width=38) (never executed)" > > ------------------------- > > > slow db: > > ------------------------- > > -> Seq Scan on testcase (cost=0.00..2896.42 rows=33242 > width=64) (actual time=77.027..791.014 rows=37093 loops=1)" > > ------------------------- > > Let's see the query and the *whole* explain analyze output, not the > part > you (mistakenly) think is important. > > regards, tom lane >