get query execution time in command prompt [duplicate]
-
30-09-2020 - |
Question
I'm doing this query select * from rentals
. This table has more than 10,000 rows and it takes more than 4 minutes to retrieve the results.
But I get this time after I get the results: 10000 rows in set (0,05 sec).
Do you know how to get the real execution time?
I try with:
set profiling = 1;
select * from rentals;
show profiles;
But also appears that the query duration is: 0,5080950.
Solution
In all probability, your query takes half a second to run, but it takes a lot more time to display all the results.
The latter depends on the speed of your network and that of your computer and is not really relevant from a performance tuning perspective.
To answer your question, the query execution time (0.5 seconds) is the execution time.
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange