X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 24EDC5292C for ; Mon, 13 Jun 2005 17:54:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29628-06 for ; Mon, 13 Jun 2005 20:54:01 +0000 (GMT) Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id C8C325290B for ; Mon, 13 Jun 2005 17:53:59 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1DhvwO-0008Sm-00; Mon, 13 Jun 2005 16:53:52 -0400 To: Madison Kelly Cc: pgsql-performance@postgresql.org, Tom Lane , Bruno Wolff III Subject: Re: Index ot being used References: <1825.216.209.137.1.1118419819.squirrel@mail.alteeve.com> <20050610155535.GO8451@tobias.nordicbet.com> <42AC42CB.8050703@alteeve.com> <24636.1118591783@sss.pgh.pa.us> <42ACBC95.9020404@alteeve.com> <20050613030001.GB17491@wolff.to> <20050613031317.GA18988@wolff.to> <42AD008D.4080600@alteeve.com> <20050613035346.GA20703@wolff.to> <42AD0B94.9090508@alteeve.com> <20050613132852.GA31142@wolff.to> <42ADC77B.7000007@alteeve.com> <22127.1118686403@sss.pgh.pa.us> <42ADD8DC.1000001@alteeve.com> In-Reply-To: <42ADD8DC.1000001@alteeve.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 13 Jun 2005 16:53:51 -0400 Message-ID: <87hdg22d28.fsf@stark.xeocode.com> Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/316 X-Sequence-Number: 12953 Madison Kelly writes: > So the index obiously provides a major performance boost! I just need to > figure out how to tell the planner how to use it... Be careful extrapolating too much from a single query in a single context. Notably you might want to test the same query after not touching this table for a little while. The index is probably benefiting disproportionately from having you repeatedly running this one query and having the entire table in cache. That said, you should look at lowering random_page_cost. The default is 4 but if this query is representative of your system's performance then much of your database is in cache and the effective value will be closer to 1. Try 2 or even 1.5 or 1.2. But like I said, test other queries and test under more representative conditions other than repeating a single query over and over. -- greg