On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
OTOH sometimes a correlated subquery that just collects data is faster to execute or more readily optimisable when expressed as a JOIN. I remember such a case, but it wasn't in my code so I paid insufficient attention and now my memory of the details is hazy.
In my last project they were mostly for finding correlated data - What name was on a record that has an identical SSN? So just EXISTS wasn't sufficient.
Generally, I'd approach this the same way as I approach programming in general: try to write the cleanest, most self- documenting code possible, and if practice shows there is a performance problem, then run benchmarks to see what might work better. I see little point in microoptimisations, particularly in absence of a clear need for performance.
That's my approach too, but I thought some basic research to confirm what worked with this engine was probably a good thing. I'm a bit "becalmed" at work now anyway too.