pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudi Starcevic <rudi@oasis.net.au>
To: Victor Yegorov <viy@nordlb.lv>
Cc: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: constraint with reference to the same table
Date: Thu, 15 May 2003 12:07:27 +1000
Message-ID: <3EC2F65F.2050004@oasis.net.au> (raw)
In-Reply-To: <20030515015811.GE1549@nordlb.lv>
References: <20030514181136.S52444-100000@megazone23.bigpanda.com>
	<3EC2F1E4.8080706@oasis.net.au>
	<20030515015811.GE1549@nordlb.lv>

Victor,

>> May be it's better to name indexes a bit more clearer? No impact on overall
>> performance, but you'll ease your life, if you project will grow to hundreds
>> of tables and thousands of indicies.

Very true.
Instead of: b_pn_b_id_idx,
I think better would be: busines_person_b_id_idx

Thanks
Rudi.




Victor Yegorov wrote:

>* Rudi Starcevic <rudi@oasis.net.au> [15.05.2003 04:46]:
>  
>
>>Stephen,
>>
>>
>>New:
>>CREATE TABLE business_person
>>(
>>b_id integer REFERENCES business ON UPDATE CASCADE ON DELETE CASCADE NOT 
>>NULL,
>>pn_id integer REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL
>>PRIMARY KEY(b_id,pn_id);
>>);
>>CREATE INDEX b_pn_b_id_idx  ON business_person (b_id);
>>CREATE INDEX b_pn_pn_id_idx ON business_person (pn_id);
>>    
>>
>
>May be it's better to name indexes a bit more clearer? No impact on overall
>performance, but you'll ease your life, if you project will grow to hundreds
>of tables and thousands of indicies.
>
>  
>
>>As I'd like to sometime's look up business's, sometime's look up people and 
>>sometimes
>>look up both I think I should keep the Index's.
>>    
>>
>
>If your lookups are part of business logic, than it's ok. Also, if your
>system generates reports using several table joins that may speed up the
>things.
>
>Otherwise, for curiosity cases, it's better to wait some time for the result
>of one-time queries.
>
>  
>

view thread (18+ messages)  latest in thread

Message-ID: <3EC2F65F.2050004@oasis.net.au>
Permalink:  ../3EC2F65F.2050004@oasis.net.au/
Also on:    postgresql.org/message-id/3EC2F65F.2050004@oasis.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: rudi@oasis.net.au, viy@nordlb.lv, sszabo@megazone23.bigpanda.com
  Subject: Re: constraint with reference to the same table
  In-Reply-To: <3EC2F65F.2050004@oasis.net.au>
  References: <20030514181136.S52444-100000@megazone23.bigpanda.com> <3EC2F1E4.8080706@oasis.net.au> <20030515015811.GE1549@nordlb.lv> <3EC2F65F.2050004@oasis.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox