X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 6F9DA924C1F for ; Fri, 30 May 2003 08:12:12 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 78020-05 for ; Fri, 30 May 2003 08:11:16 -0400 (EDT) Received: from wolff.to (wolff.to [66.93.249.74]) by developer.postgresql.org (Postfix) with SMTP id 3B530924B30 for ; Fri, 30 May 2003 08:11:05 -0400 (EDT) Received: (qmail 8968 invoked by uid 500); 30 May 2003 12:13:11 -0000 Date: Fri, 30 May 2003 07:13:11 -0500 From: Bruno Wolff III To: SZUCS =?iso-8859-1?Q?G=E1bor?= Cc: pgsql-performance@postgresql.org Subject: Re: Select query takes long to execute Message-ID: <20030530121311.GB8920@wolff.to> Mail-Followup-To: SZUCS =?iso-8859-1?Q?G=E1bor?= , pgsql-performance@postgresql.org References: <20030529194451.24416.h006.c001.wm@mail.dilger.cc.criticalpath.net> <001c01c32689$82da1050$0403a8c0@fejleszt4> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <001c01c32689$82da1050$0403a8c0@fejleszt4> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/273 X-Sequence-Number: 2052 On Fri, May 30, 2003 at 10:57:33 +0200, SZUCS Gábor wrote: > Nikolaus, > > I think that shouldn't be any more effective. As I experienced, it's > irrelevant how many cols an index has as long as you only use the first > column. And, after that, if you use another column, how could a missing > second column be any better? Because the index will be more compact and reside on less disk blocks. The planner also makes different guesses for the selectivity whne using the first column of a multicolumn index as opposed to a single column index.