Re: Re: the opposite of a join?

From: Date: Thu, 04 Oct 2007 04:43:46 +0000
Subject: Re: Re: the opposite of a join?
References: 1 2 3 4 5  Groups: php.db php.general 
Request: Send a blank email to php-db+get-44135@lists.php.net to get a copy of this message
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a year or so. But one problem that I have always ran into with MySQL is that when JOIN'ing tables that have large data sets is a PITA.
Were you doing left joins when you experienced those problems? Left joins are usually very fast.
So, if I was running MySQL, I would use SQL #1, but if I were using PostgreSQL, I would use SQL #2
I'd use the left join whenever available. Cheers, Rob.
Honestly, I cannot remember. It was right when I first started with PHP/mysql back in 1999. I think we were using a JOIN (without the LEFT) Which I think the default is an INNER JOIN if I do recall. I really have never played with performance over the past few years. This past year I have been working on a new DB with Call Detail Records for a phone company. On average we have to deal with processing 2 - 4 million records each billing cycle. So, having to work with that amount of CDR's and a couple thousand client records that are associated with them, makes for a good performance test on SQL statements. -- Jim Lucas "Perseverance is not a long race; it is many short races one after the other" Walter Elliot "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare

« previous php.db (#44135) next »