
8 May
2012
8 May
'12
2:30 a.m.
On Tue, 8 May 2012 12:10:15 pm Russell Coker wrote:
Thanks for the suggestion, I tried a join and it didn't do much good. I've attached the result of the explain commands. A default join sorts through 18M rows. A right join is better and only sorts through 1M rows but gets the data four times (that account has four aliases) which adds to processing for the program that receives it.
Going on a slight tangent, if a query could result in the same record multiple times you can use the DISTINCT keyword (ie "SELECT DISTINCT ... FROM ..). Of course this will only work if you're only returning data from the main record not different join data in the SELECT field set.