Re: Q: Structured index - which one runs faster?

From: Ernest E Vogelsinger <ernest(at)vogelsinger(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Q: Structured index - which one runs faster?
Date: 2003-05-22 23:43:06
Message-ID: 5.1.1.6.2.20030523013910.03095bb8@mail.vogelsinger.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-performance

At 00:53 23.05.2003, Tom Lane said:
--------------------[snip]--------------------
>Ernest E Vogelsinger <ernest(at)vogelsinger(dot)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/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-05-23 00:00:14 Re: Q: Structured index - which one runs faster?
Previous Message Ernest E Vogelsinger 2003-05-22 23:36:14 Re: [ADMIN] Q: Structured index - which one runs faster?

Browse pgsql-general by date

  From Date Subject
Next Message Forest Wilkinson 2003-05-22 23:48:28 Empty queries guaranteed to work?
Previous Message Ernest E Vogelsinger 2003-05-22 23:36:14 Re: [ADMIN] Q: Structured index - which one runs faster?

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-05-23 00:00:14 Re: Q: Structured index - which one runs faster?
Previous Message Ernest E Vogelsinger 2003-05-22 23:36:14 Re: [ADMIN] Q: Structured index - which one runs faster?