X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7FBC1D1D606 for ; Fri, 2 Apr 2004 04:59:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49526-01 for ; Fri, 2 Apr 2004 00:59:48 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 77B85D1D2B5 for ; Fri, 2 Apr 2004 00:59:47 -0400 (AST) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id EB42217C464; Thu, 1 Apr 2004 23:59:46 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1B9GmQ-0005Ss-00; Thu, 01 Apr 2004 23:59:46 -0500 To: Palle Girgensohn Cc: pgsql-performance@postgresql.org Subject: Re: single index on more than two coulumns a bad thing? References: <24070000.1080860445@palle.girgensohn.se> In-Reply-To: <24070000.1080860445@palle.girgensohn.se> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 01 Apr 2004 23:59:46 -0500 Message-ID: <871xn7otz1.fsf@stark.xeocode.com> Lines: 17 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 postgresql.org X-Archive-Number: 200404/6 X-Sequence-Number: 6306 Palle Girgensohn writes: > Is it always bad to create index xx on yy (field1, field2, field3); All generalisations are false... Seriously, it's true that as the length of your index key gets longer the harder and harder it is to justify it. That doesn't mean they're always wrong, but you should consider whether a shorter key would perform just as well. The other problem with long index keys is that they often show up in the same place as having dozens of indexes on the same table. Usually in shops where the indexes were created after the fact looking at specific queries. -- greg