Q: Structured index - which one runs faster?

From: Ernest E Vogelsinger <ernest(at)vogelsinger(dot)at>
To: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>, "pgsql-performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Q: Structured index - which one runs faster?
Date: 2003-05-22 20:41:22
Message-ID: 5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-performance

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(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Larry Rosenman 2003-05-22 21:02:06 Re: audit trail
Previous Message Alex.H.Pollock 2003-05-22 18:46:24 audit trail

Browse pgsql-general by date

  From Date Subject
Next Message Corey W. Gibbs 2003-05-22 20:49:19 ILIKE Problem?
Previous Message Fernando Papa 2003-05-22 20:19:33 UFS Logging on Solaris 8

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2003-05-22 21:23:41 Re: postgres on a beowulf? (AMD)opteron?
Previous Message SZŰCS Gábor 2003-05-22 16:32:48 Re: ugly query slower in 7.3, even slower after vacuum full analyze