If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Stored Procedure Caching and Performance comparison of 2 stored Procedures

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-09, 13:20
sql_er sql_er is offline
Registered User
 
Join Date: Jan 2007
Posts: 48
Stored Procedure Caching and Performance comparison of 2 stored Procedures

Hello,

We are using MySQL 5.0.44. When I run a stored procedure first time, it might take over a second. If I immediately rerun it, it takes milliseconds. Each subsequent rerun is also super fast.

Why is this happening? Is there some caching?

I thought there is no stored procedure caching in mysql 5.0.

The reason I'm asking is because I am trying to optimize a stored procedure 'A'. So I created a modified version 'B'. I then randomly choose 1000 inputs, and run A on all of them and then run B on all of them. I wonder if B performs better because I just ran A on the same input and something got cached.

Can someone shed a light on what could cause 2nd run of same stored procedure on same input be much faster than first one?

And also, what is the best way to perform performance comparison of 2 different stored procedures?


Thanks a lot!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On