Quote:
Originally posted by jsze
I know that instead of writing like this I can just join the tables in the where clause, but when it comes to tables with tens of thousands of records, this statement has reduced the retrieval time significantly.
|
Hey, Jsze. I'm glad your problem is resolved. The statement above bothers me though. Have you (or your dba) analyzed the tables? This seems very odd, even if the statistics are missing and the query is defaulting to "rule-based". As long as an index exists on the join column(s) of each table, I wouldn't expect to see a difference in execution plan. Of course if an index doesn't exist on the join column(s), it might make a little more sense to me. It's possible that by writing the query with a nested subquery, you're forcing the driving table and picking the "correct one".
I know this isn't your original issue, but if you have the time, it might be worth resolving this weird behavior.