Re: simple join problem - Mailing list pgsql-sql

From Matthew Nuzum
Subject Re: simple join problem
Date
Msg-id 000001c2d898$264d1650$6900a8c0@mattspc
Whole thread Raw
In response to Re: simple join problem  (<mallah@trade-india.com>)
List pgsql-sql
It may not be too off topic...

This database structure allows me to have several means of contact for my
each of my customers.  An insert trigger keeps exactly one email address,
phone number and mailing address marked as the primary one for that account.
I use a view to give my easy access to the customer's primary contact
information.

Previously, I used a table structure like this: users
==========x|username |password |firstname |lastname |billing_email |other_email |phone |fax |tollfree |cellphone |pager
|billing_address1|billing_address2 |billing_address3 |billing_town |billing_state |billing_country |billing_zip
|other_address1|other_address2 |other_address3 |other_state |other_country |other_zip 

As you can see, there are a lot of wasted fields.  Most of my customers have
just one address, phone number and e-mail on file however, some have
several.

By shifting to this structure, my data is more normal(ized).  There are no
limits as to the depth of contact information I can have about my customers.

--
Matthew Nuzum
www.bearfruit.org
cobalt@bearfruit.org
>
> Good to see that you got the answer to ur problem.
>
> But i have a question to u.
>
> Why at all are you keeping 4 tables and joining them too.
> why not have a single table with all the merged columns?
>
> In my place i too have a database stuructue similar to you but lately
> i realized the other option would have been better. becoz for every
> datamining query i am having to join multiple table which is not very
> favourable
> to performance.
>
> i know it may not be the proper forum to discuss this.
>
> regds
> mallah.



pgsql-sql by date:

Previous
From:
Date:
Subject: Re: simple join problem
Next
From: "jack"
Date:
Subject: problem on truncate for v.7.3.2