Re: Indexes

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: "Silas Justiniano" <silasju(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexes
Date: 2006-01-19 22:42:17
Message-ID: 866BB615-A42B-4BA4-9EA0-75C91B31CE14@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jan 18, 2006, at 4:53 , Silas Justiniano wrote:

> CREATE UNIQUE INDEX foo ON Intermediate(book_id, author_id);

You'll want this index for normalization.

> CREATE UNIQUE INDEX bar ON Intermediate(book_id);
> CREATE UNIQUE INDEX baz ON Intermediate(author_id);

You probably don't want these two indexes unless you want to have
only one entry for each book, or one entry for each author. Many
books have multiple authors and many authors write more than one
book, so you probably don't want to restrict this.

Michael Glaesemann
grzm myrealbox com

In response to

  • Indexes at 2006-01-17 19:53:37 from Silas Justiniano

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2006-01-19 22:44:43 Re: Upgrade Problem: 7.4.3 -> 8.1.2
Previous Message Vishal Dixit 2006-01-19 22:41:18 Re: pg_dump throws no buffer space available error