PhpMyAdmin - how to get execution time of MySQL Stored Procedure

$0
=
$0
+
$0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

Problem:

PhpMyAdmin tool is showing me query execution time, like "Query took 0.0040 seconds" in the image below)

enter image description here

However, when I am trying to run a stored procedure (stored routine), PhpMyAdmin does NOT show me any data about execution time. enter image description here

Question:

How can I benchmark the execution time of my stored procedure in PhpMyAdmin without writing any additional MySQL code?

Thanks!

.

P.S. Here is an example on how to benchmark MySQL procedure by writing your own benchmarking code, which I do NOT want to do, I just need some very basic idea of the execution time of my procedure and I beleive it should be provided by a client-side tool like PhpMyAdmin

.

Tags: ,

1 Answer - total earned - 0 BTC ($0 USD)

1
=
0
=
$0
Everyone, even non-registered users could send Bitcoin Tips to YOU if they are inspired by your answer!

I dont know how to answer your exact question i.e. how to make PhpMyAdmin show procedure timing without writing any custom benchmarking code. I can only provide a solution where you would need to write some extra MySQL code just to benchmark your other MySQL code

You can measure the execution time (in microseconds i.e. 1 uS = 0.000,001 sec) using the following code (note the "YOUR CODE" part):

CREATE PROCEDURE get_execution_time()
BEGIN
  DECLARE start_time bigint; 
  DECLARE end_time bigint;

  -- Fix start time in microseconds
  SET @start_time = (UNIX_TIMESTAMP(NOW()) * 1000000 + MICROSECOND(NOW(6)));

  -- YOUR CODE

  -- Fix end time in microseconds
  SET @end_time = (UNIX_TIMESTAMP(NOW()) * 1000000 + MICROSECOND(NOW(6)));

  -- Result
  select (@end_time - @start_time) / 1000;
 END
SEND BITCOIN TIPS
0

Post Answer


Will Bitcoin Tipping become a new Internet Culture?


Please share our story! THANK YOU!