pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mallah@trade-india.com
To: cobalt@bearfruit.org
Cc: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: simple join problem
Date: Thu, 20 Feb 2003 09:32:25 +0530 (IST)
Message-ID: <1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com> (raw)
In-Reply-To: <004001c2d85c$05d214c0$6900a8c0@mattspc>
References: <200302191249.26342.josh@agliodbs.com>
	<004001c2d85c$05d214c0$6900a8c0@mattspc>


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.

>> >
>> > Here's my view definition:
>> > SELECT
>> > 	users.uid, users.loginid, users."password", users.title,
>> > 	users.firstname, users.middlename, users.lastname, users.suffix, users.organization,
>> > 	users.job_title, users_address.address1,
>> > 	users_address.address2, users_address.address3, users_address.city,
>> >  	users_address.state, users_address.zip, users_address.country,
>> > 	users_email.email, users_phone.phone
>> > FROM (((users
>> > 	LEFT JOIN users_address ON ((users.uid = users_address.uid AND
>> users_address.primary = TRUE)))
>> > 	LEFT JOIN users_email ON ((users.uid = users_email.uid and
>> users_email.primary = TRUE)))
>> > 	LEFT JOIN users_phone ON ((users.uid = users_phone.uid and
>> users_phone.primary = TRUE))) ;
>>
>> It's a neat trick that join conditions can be *any* expression that evaluates
>> to a boolean value.
>
> That is a neat trick.  Thanks for the info everyone.  I feel better knowing that even though it
> was a simple problem it's not quite as obvious as I thought.
>
> --
> Matthew Nuzum
> www.bearfruit.org
> cobalt@bearfruit.org
>
>
>
> ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9'
> the postmaster



-----------------------------------------
Get your free web based email at trade-india.com.
   "India's Leading B2B eMarketplace.!"
http://www.trade-india.com/





view thread (7+ messages)  latest in thread

Message-ID: <1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com>
Permalink:  ../1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com/
Also on:    postgresql.org/message-id/1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mallah@trade-india.com, cobalt@bearfruit.org, josh@agliodbs.com
  Subject: Re: simple join problem
  In-Reply-To: <1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com>

* 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