X-Original-To: pgsql-admin@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id CBDEA925E73; Thu, 22 May 2003 21:03:07 -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 17333-08; Thu, 22 May 2003 21:02:36 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by developer.postgresql.org (Postfix) with ESMTP id 428D7925E71; Thu, 22 May 2003 18:53:01 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h4MMr1U6011952; Thu, 22 May 2003 18:53:01 -0400 (EDT) To: Ernest E Vogelsinger Cc: "pgsql-admin" , "pgsql-general" , "pgsql-performance" Subject: Re: Q: Structured index - which one runs faster? In-reply-to: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> Comments: In-reply-to Ernest E Vogelsinger message dated "Thu, 22 May 2003 22:41:22 +0200" Date: Thu, 22 May 2003 18:53:00 -0400 Message-ID: <11951.1053643980@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/324 X-Sequence-Number: 8886 Ernest E Vogelsinger writes: > (a) creating an index on all three columns, or > (b) create a single varchar column combining all three components into a > single string, like "ident1:ident2:nodeid" and indexing this column only. I can't imagine that (b) is a good idea ... it's dubious that you are saving anything on the indexing, and you're sure adding a lot of space to the table, not to mention maintenance effort, potential for bugs, etc. It might be worth creating the index so that the "least non-unique" column is mentioned first, if there's a clear winner in those terms. That would minimize the number of times that comparisons have to look at the additional columns. regards, tom lane