Re: Primary Key and Indices

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key and Indices
Date: 2005-04-24 18:47:00
Message-ID: 1114368420.30043.26.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2005-04-24 at 09:49 -0700, Rich Shepard wrote:
> I'm converting mysql tables to postgres. One of the tables has this:
>
> PRIMARY KEY (org_id, contact_id),
> KEY contact (contact_id, org_id)
>
> Is there really a difference in the two indices if the sequence of fields
> is reversed?

yes.
for example, only the first one can be used for ORDER BY org_id

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Antoine Solomon 2005-04-24 18:48:03 Re: New PostgreSQL book coming
Previous Message Karsten Hilbert 2005-04-24 17:09:44 Re: timezone() with timeofday() converts the wrong direction?