From: Ernest E Vogelsinger <ernest@vogelsinger.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Q: Structured index - which one runs faster?
Date: Fri, 23 May 2003 01:43:06 +0200
Message-ID: <5.1.1.6.2.20030523013910.03095bb8@mail.vogelsinger.at> (raw)
In-Reply-To: <11951.1053643980@sss.pgh.pa.us>
References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>
<5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>
At 00:53 23.05.2003, Tom Lane said:
--------------------[snip]--------------------
>Ernest E Vogelsinger <ernest@vogelsinger.at> 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.
--------------------[snip]--------------------
Thanks for replying :)
Do you know if there's a general performance difference between numeric
(int4) and character (fixed-size char[5]) columns? The ident1 and ident2
columns are planned to be char[5], only the third column (with least
precedence) will be numeric.
The application is still in the design phase, so I still could fiddle
around that and make that char[5] numeric with an additional mapping
(@runtime, not in the DB) if this will increase performance.
Thanks,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: ernest@vogelsinger.at, tgl@sss.pgh.pa.us
Subject: Re: Q: Structured index - which one runs faster?
In-Reply-To: <5.1.1.6.2.20030523013910.03095bb8@mail.vogelsinger.at>
References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> <5.1.1.6.2.20030523013910.03095bb8@mail.vogelsinger.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox