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 9ACD3D1B198 for ; Wed, 30 Jun 2004 04:34:55 -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 91187-06 for ; Wed, 30 Jun 2004 07:34:54 +0000 (GMT) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.243]) by svr1.postgresql.org (Postfix) with SMTP id 6BA8DD1B193 for ; Wed, 30 Jun 2004 04:34:51 -0300 (ADT) Received: by mproxy.gmail.com with SMTP id w29so1639365cwb for ; Wed, 30 Jun 2004 00:34:52 -0700 (PDT) Received: by 10.38.164.38 with SMTP id m38mr31505rne; Wed, 30 Jun 2004 00:34:52 -0700 (PDT) Message-ID: Date: Wed, 30 Jun 2004 00:34:52 -0700 From: Chris Cheston To: Christopher Kings-Lynne Subject: Re: postgres 7.4 at 100% Cc: pgsql-performance@postgresql.org In-Reply-To: <40E26C2C.9080601@familyhealth.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1088397641.1105.10.camel@localhost> <17884.1088399982@sss.pgh.pa.us> <200406280947.59420.josh@agliodbs.com> <40E1266D.3040607@familyhealth.com.au> <40E192CC.90707@ehpg.net> <40E26C2C.9080601@familyhealth.com.au> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/320 X-Sequence-Number: 7378 I see - thanks very much. I created an index for column 'oid' which I was using in a WHERE. So rule of thumb- create an index for column(s) which I use in WHERE queries. Thanks, Chis On Wed, 30 Jun 2004 15:30:52 +0800, Christopher Kings-Lynne wrote: > > > > Why would I or would I not create multiple indexes in a table? I > > created another index in the same table an it's improved performance > > even more. > > You create indexes when you need indexes. Indexes are most helpful when > they match the WHERE clause of your selects. > > So, if you commonly do one query that selects on one column, and another > query that selects on two other columns - then create one index on the > first column and another index over the second two columns. > > Chris >