Re: JOIN vs. LEFT JOIN

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: Nico Callewaert <callewaert(dot)nico(at)telenet(dot)be>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: JOIN vs. LEFT JOIN
Date: 2009-01-28 13:00:26
Message-ID: 498056EA.3050102@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nico Callewaert schrieb:
>
>> Ok please don't get me wrong for asking again: one customer can have
>> two tax rates? Why?
>> Because he's living in the USA and has a taxrate of 25% and lives also
>> in Germany and has
>> 19%? Hm ... strange ... ;-) . And also the custumer is 'prospect' OR
>> 'not active' ... but
>> not both ... ;-)
>>
>>> drop downs in the application, so the customer can easily select a
>>> value.
>>
>> So all these dropdowns are multiselect ...?
>>
>> I am not sure if I can help you with this. My idea is really to think
>> about the design of
>> the application and / or the database ... again - please don't get me
>> wrong ...
>
>
> Hi Andreas,
>
> I think we are not understanding each other :-)

sometimes I am good with that ;-)

> It's al the time just 1 value, 1 value for tax, 1 value for customer
> type. No multiselect drop downs. But all these fields are of course
> referencing a lookup table by ID. But like Regina also said, the
> performance hit of the LEFT JOIN seems not worth considering putting
> junk data in the database that should be NULL (if the drop down is left
> blanc)...
> I don't know if I made myself clear ?

yes you did - don't worry. I have just another idea how I would do that. But anyway I
think the basic question was if a LEFT JOIN has less performance comparing with a JOIN. So
now we have the answer for your case and that hopefully helps you to get your software
work well.

In all cases EXPLAIN ANALYZE is a good idea to use ...

> Thanks !
> Nico
>
Cheers

Andy

- --
St.Pauli - Hamburg - Germany

Andreas Wenk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgFbqVa7znmSP9AwRAiqfAJ9TG2B+oqjvItHz9eIEk26oQkdBRQCgnpNc
NlJbJKUmidRrHk7b8k624DM=
=uliw
-----END PGP SIGNATURE-----

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Morris, Roy 2009-01-28 14:10:04 UUId or Similar
Previous Message Nico Callewaert 2009-01-28 12:49:35 Re: JOIN vs. LEFT JOIN