RSS Forums RSS
Please support our MySQL advertiser: Programming Forums

Static Count vs Dynamic Count (Very advanced, gurus take your shot)

Join Date: Mar 2007
Posts: 28
Reputation: cfAllie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cfAllie cfAllie is offline Offline
Light Poster

Re: Static Count vs Dynamic Count (Very advanced, gurus take your shot)

  #2  
May 12th, 2007
I'll let someone else tackle the issue of expectations, but I did have a few thoughts....

Left joins may be tedious to write, but performance is more important. I could reduce a 10 line query to 1 line. But if the 1 line query takes 45 minutes longer to run, its hardly worth it.

I'm not an expert but I would be leery of using that many correlated subqueries with that kind of volume. Afaik, correlated subqueries execute once for each value in the outer query. So _generally_ subqueries _tend_ to be less efficient than joins.

However, databases and optimizers differ. Some may be capable of generating more efficient plans for subqueries, resulting in better performance. While other optimizers might not, yielding poorer performance for subqueries. Especially when dealing with a large volume of data.

I would read up on your db specifically, and learn how it handles joins versus correlated subqueries. That way you could make more of an informed decision.

I don't know if that helps any, but there it is ;-)
Reply With Quote  
All times are GMT -4. The time now is 12:17 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC