Quote:
Originally Posted by photon
Interesting.
I do have only one side of my many to many defined in my domain (houses keep track of animals, but animals don't care about houses), I wonder if I added that relationship if it would change that query. Because otherwise that would seem like a pretty basic mistake that would get caught early on.
Unless everyone just manages their own many to many anyway so never actually get this code. Or they all use trivial cases.
|
Often there will only ever be a trivial response and in those cases the fact that it is cartesian is irrelevant. Zx1 = Z.
But prettymuch anything that takes forever is some sort of non-optimized operation, either your correlation is creating an issue (which still might be the case here) or you are triggering a cartesian.
If you have any sore of analyzer you could see. I work with Oracle and explain plans can be a godsend to diagnose these things (even nicer since Oracle release SQL Developer a few years ago with an "explain plan" button)
Edit: I'm still having a bit of trouble seeing the relationships in your query.Too bad there is no ER diagram.
__________________
"The problem with any ideology is that it gives the answer before you look at the evidence."
—Bill Clinton
"The greatest obstacle to discovery is not ignorance--it is the illusion of knowledge."
—Daniel J. Boorstin, historian, former Librarian of Congress
"But the Senator, while insisting he was not intoxicated, could not explain his nudity"
—WKRP in Cincinatti
Last edited by Bobblehead; 03-18-2011 at 11:24 AM.
Reason: Addt'l thought
|