View Single Post
Old 10-07-2004, 05:38 AM   #6 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 287
technobard is on a distinguished road
Thanks for the followup. It sounds like the optimizer isn't doing what it should. Most scalar subqueries can't be rewritten as a single query with a simple join. Typically, as in the link you provided, they allow you to combine different levels of granularity: averages combined with non-average data, for example. When the queries can be rewritten, the execution plan is usually the same (and therefore the execution time). I'm guessing that the statistics in the database are wrong in this case. Those statistics are updated by analyzing each table. No big deal. As long as things are working for you, I'm sure you're not too worried about it. I'm an Oracle DBA by day, so this sort of thing bothers me.
__________________
It takes 2 points to draw a straight line, but at least 3 points to draw a conclusion.
technobard is offline   Reply With Quote