Re: [ADMIN] Q: Structured index - which one runs faster? - Mailing list pgsql-performance

From Tom Lane
Subject Re: [ADMIN] Q: Structured index - which one runs faster?
Date
Msg-id 11951.1053643980@sss.pgh.pa.us
Whole thread Raw
In response to Q: Structured index - which one runs faster?  (Ernest E Vogelsinger <ernest@vogelsinger.at>)
List pgsql-performance
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.

            regards, tom lane

pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
Next
From: Ernest E Vogelsinger
Date:
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?