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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ernest E Vogelsinger <ernest(at)vogelsinger(dot)at>
Cc: "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: Re: Q: Structured index - which one runs faster?
Date: 2003-05-22 22:53:00
Message-ID: 11951.1053643980@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-performance
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.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Stephan SzaboDate: 2003-05-22 23:00:54
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
Previous:From: scott.marloweDate: 2003-05-22 22:23:44
Subject: Re: [GENERAL] Q: Structured index - which one runs faster?

pgsql-admin by date

Next:From: Stephan SzaboDate: 2003-05-22 23:00:54
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?
Previous:From: scott.marloweDate: 2003-05-22 22:23:44
Subject: Re: [GENERAL] Q: Structured index - which one runs faster?

pgsql-general by date

Next:From: John GrayDate: 2003-05-22 22:56:53
Subject: Re: Max String length?
Previous:From: Tom LaneDate: 2003-05-22 22:40:26
Subject: Re: Query failed: ERROR: catalog is missing 1 attribute(s) for relid 456086

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