X-Original-To: pgsql-admin@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 3AB9D9259C6; Thu, 22 May 2003 18:17:37 -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 64571-10; Thu, 22 May 2003 18:17:06 -0400 (EDT) Received: from relay11.austria.eu.net (relay11.Austria.eu.net [193.154.160.115]) by developer.postgresql.org (Postfix) with ESMTP id 006F8925E78; Thu, 22 May 2003 16:40:47 -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 h4MKekc8011660; Thu, 22 May 2003 22:40:47 +0200 Message-Id: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> X-Sender: homebird@mail.vogelsinger.at X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Thu, 22 May 2003 22:41:22 +0200 To: "pgsql-admin" , "pgsql-general" , "pgsql-performance" 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/316 X-Sequence-Number: 8878 Hi all, sorry for reposting this to the lists, but I feel I posted this at the wrong time of day, since now a lot more of you gurus are reading, and I really need some knowledgeable input... thanks for consideration :) 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/ ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/