X-Original-To: pgsql-admin@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 5B9B19261D1; Thu, 22 May 2003 09:42:11 -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 19667-03; Thu, 22 May 2003 09:41:40 -0400 (EDT) Received: from relay11.austria.eu.net (relay11.Austria.eu.net [193.154.160.115]) by developer.postgresql.org (Postfix) with ESMTP id 5B654925BFC; Thu, 22 May 2003 09:19:42 -0400 (EDT) Received: from sisyphus.vogelsinger.at (vogelsinger.at [193.154.189.26]) by relay11.austria.eu.net (8.12.9/8.12.0.Beta10) with ESMTP id h4MDJac8025636; Thu, 22 May 2003 15:19:37 +0200 Message-Id: <5.1.1.6.2.20030522150710.03f96ab8@mail.vogelsinger.at> X-Sender: homebird@mail.vogelsinger.at X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Thu, 22 May 2003 15:20:13 +0200 To: "pgsql-admin" , "pgsql-general" From: Ernest E Vogelsinger Subject: Q: Structured index - which one runs faster? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/296 X-Sequence-Number: 8858 Hi all, I have a question concerning table/key layout. I need to store an ID value that consists of three numerical elements: - ident1 char(5) - ident2 char(5) - nodeid int4 I need an index on these columns. Insert, delete, and lookup operations this in this need to be as fast as possible. Now I have two options: (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. There will be a couple of million rows in this table, the values in question are not unique. Which would be faster in your opinion? (a) or (b)? Thanks for any insight, -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/