pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ernest E Vogelsinger <ernest@vogelsinger.at>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Q: Structured index - which one runs faster?
Date: Thu, 22 May 2003 18:53:00 -0400
Message-ID: <11951.1053643980@sss.pgh.pa.us> (raw)
In-Reply-To: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>
References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at>

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



view thread (14+ messages)  latest in thread

Message-ID: <11951.1053643980@sss.pgh.pa.us>
Permalink:  ../11951.1053643980@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11951.1053643980@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ernest@vogelsinger.at, pgsql-admin@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: Q: Structured index - which one runs faster?
  In-Reply-To: <11951.1053643980@sss.pgh.pa.us>
  References: <5.1.1.6.2.20030522223909.05929600@mail.vogelsinger.at> <11951.1053643980@sss.pgh.pa.us>

* 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