X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3C8C147644F for ; Wed, 14 May 2003 22:24:29 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 91984-02 for ; Wed, 14 May 2003 22:24:27 -0400 (EDT) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by postgresql.org (Postfix) with ESMTP id D1914475F16 for ; Wed, 14 May 2003 22:24:26 -0400 (EDT) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id MAA18229 for ; Thu, 15 May 2003 12:33:57 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3EC2FB82.8070507@oasis.net.au> Date: Thu, 15 May 2003 12:29:22 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: Postgres Performance Subject: Re: constraint with reference to the same table References: <20030514181136.S52444-100000@megazone23.bigpanda.com> <3EC2F1E4.8080706@oasis.net.au> <20030515015811.GE1549@nordlb.lv> <3EC2F65F.2050004@oasis.net.au> <3EC2F81B.10001@oasis.net.au> <20030515022135.GF1549@nordlb.lv> In-Reply-To: <20030515022135.GF1549@nordlb.lv> Content-Type: multipart/alternative; boundary="------------060707030407080409010707" X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/174 X-Sequence-Number: 1953 This is a multi-part message in MIME format. --------------060707030407080409010707 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 [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. > > > --------------060707030407080409010707 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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.

  

--------------060707030407080409010707--