Execution time of Queries
I have some queries which executes in MYsql Yog fast. But when the same query is called from java class, it takes a long time. Why is that so? Can anyone explain me the cause of this?
Here's my query
SELECT phymem_util,cpuutil,InBytesPerSec
,uh.time_stamp,hs开发者_StackOverflow.totalrsptime
FROM unix_host_history uh, url_history hs
WHERE uh.HostID='HS001' AND hs.compID='CP013'
AND SUBSTR(uh.time_Stamp,1,15) = SUBSTR(hs.time_stamp,1,15)
AND uh.time_stamp BETWEEN '2011-05-27 12:54:10'
AND '2011-05-27 14:54:10'
ORDER BY uh.time_stamp
Is the query executing slow from Java, or is it taking longer because you're unnecessarily retrieving large, unneeded columns of data over a network?
Perhaps you're creating a connection each time? I've slipped up with this before - use a profiler for more info
精彩评论