Re: simple join problem

Поиск
Список
Период
Сортировка
Искать
От
Matthew Nuzum
Тема
Re: simple join problem
Дата
Msg-id
000001c2d898$264d1650$6900a8c0@mattspc
Ответ на
Список
Дерево обсуждения
simple join problem "Matthew Nuzum" <cobalt@bearfruit.org>
Re: simple join problem Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: simple join problem Josh Berkus <josh@agliodbs.com>
Re: simple join problem "Matthew Nuzum" <cobalt@bearfruit.org>
Re: simple join problem <mallah@trade-india.com>
Re: simple join problem "Matthew Nuzum" <cobalt@bearfruit.org>
Re: simple join problem Richard Huxton <dev@archonet.com>
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 по дате отправления
От:
Дата:
Сообщение: Re: simple join problem
От: jack
Дата:
FAQ