|
OK, I made an, um, ah, assumption in my response. I assumed that "crt_date" is a field on vndmst and not item_master. If that is the case then this isn't a correlated subquery. Current_Date is a reserved value in SQL which holds, oddly enough, the current date. If it wasn't so then the subquery may or may not be correlated depending on where the current_Date value came from. As for the join, I agree that the result would be the same, but I'm not sure they would be executed the same. My first thought is that the original, with the IN clause would execute faster since it is a simpler query (or more appropriately two queries), however the outer query can't start until the inner query finishes. However in the case of the join query with query parallelism I believe you could get rows back faster. The answer to performance probably also depends on which release and PTF level you're on since IBM could, and should, change the optimizer as time goes on to get better and better. -Walden ------------ Walden H Leverich III President Tech Software (516) 627-3800 x11 (208) 692-3308 eFax WaldenL@TechSoftInc.com http://www.TechSoftInc.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.