Q: Structured index - which one runs faster? - Mailing list pgsql-general

From Ernest E Vogelsinger
Subject Q: Structured index - which one runs faster?
Date
Msg-id 5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at
Whole thread Raw
Responses Re: Q: Structured index - which one runs faster?
Re: [ADMIN] Q: Structured index - which one runs faster?
Re: Q: Structured index - which one runs faster?
List pgsql-general
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/



pgsql-general by date:

Previous
From: Yolanda Valverde
Date:
Subject:
Next
From: Mark Wilson
Date:
Subject: Re: PRIMARY KEYS