Re: Multiple column indexes

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Garth Keesler" <garthk(at)gdcjk(dot)com>
Cc: PGGeneral <pgsql-general(at)postgresql(dot)org>
Subject: Re: Multiple column indexes
Date: 2007-01-19 19:53:45
Message-ID: b42b73150701191153h36953a97v8e676e82b7897fe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/19/07, Garth Keesler <garthk(at)gdcjk(dot)com> wrote:
> I have a primary key made up of two varchar(128) columns, typically less
> than 16 chars each. Concatenating the two columns would still be unique.
> Would it make sense to concat the two columns, using a unique separator
> like '~' and index on that single column or would that be more trouble
> than the potential performance gains?

yes. use a multiple key index. that is what they are for. or let the
db do it for you:

create table foo (a text, b text, primary key(a,b));

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2007-01-19 19:55:09 Re: Clearing plans
Previous Message Garth Keesler 2007-01-19 19:50:52 Multiple column indexes