View Single Post
  #2 (permalink)  
Old July 18th, 2008, 06:49
Srivathsana Srivathsana is offline
Member
 
Join Date: May 2007
Posts: 37
Groans: 0
Groaned at 0 Times in 0 Posts
Thanks: 3
Thanked 3 Times in 3 Posts
Rep Power: 0
Srivathsana is on a distinguished road
Re: Simple queries locking up DB Server CPU

Hi Andy,

I would simplify the mentioned query as below :

select count(order_base_gid) from ob_order_base

I am also attaching a screenshot which shows the difference in elapsed time between count(*) and count(column_name).
This difference could become very significant in terms of sql performance when many number of queries are running in the system.It is also a possibility that the queries run for a long time and lock the DB,if run on unindexed tables at peak business hours where the application gets hit with lots of user queries.
A humble suggestion would be to analyse all the queries running in BMs and tune them down.
Attached Files
File Type: doc count_performance.doc (38.5 KB, 24 views)
__________________
Warm Regards,
Srivathsana
Reply With Quote