Re: constraint with reference to the same table - Mailing list pgsql-performance

From Rudi Starcevic
Subject Re: constraint with reference to the same table
Date
Msg-id 3EC2FB82.8070507@oasis.net.au
Whole thread Raw
In response to Re: constraint with reference to the same table  (Victor Yegorov <viy@nordlb.lv>)
List pgsql-performance
Victor,

>> You don't need it. Primary key on that 2 columns will create a unique index
>> on them. Of course, if you left things unchanged - you'll need to create
>> business_people index yourself.
Ahh of course ..

"I see said the blind man !" ..

Thanks heaps.
I think now it's pretty clear to me.
I feel I have pretty much optimised my code / sql schema.

Thank you both,
it's a tremendous help - one learns something every day with this list.

Kind regards
Rudi.

Victor Yegorov wrote:
* Rudi Starcevic <rudi@oasis.net.au> [15.05.2003 05:15]: 
Perhaps I also need a 3rd Index ?

One for Business's
One for People and
One for Business_People.

I think I may need the 3rd Index for query's like   
You don't need it. Primary key on that 2 columns will create a unique index
on them. Of course, if you left things unchanged - you'll need to create
business_people index yourself.

execute:

=> \d business_people

and take a glance on a line, describing primary key.
 

pgsql-performance by date:

Previous
From: Victor Yegorov
Date:
Subject: Re: constraint with reference to the same table
Next
From: Tom Lane
Date:
Subject: Re: INNER JOIN vs WHERE