Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-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

pgsql-performance by date

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

pgsql-admin by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group