I have a a table of questions in my database here are column and data types of questions table
Field Datatype
QID BIGINT
UserID INT(11)
Question VARCHAR(100)
Description Text
Date DateTime
Status TINYINT
this table is expected to have around 2 Million entries my question is how do i calculate query execution time if i am searching a record based on QID, UserID or Question.
You can use the General Query Log but it has certain disadvantages too so think before running it on some production environment.
You can use it like:
SET profiling = 1;
and then execute your query like
SHOW PROFILES;
EDIT:-
I dont know if that is the best approach to go with but here it goes as it may depend on the CPU and the number of processes running on your system:
declare @start timestamp
declare @stop timestamp
set @start = select NOW();
//Your query
set @stop = select NOW();
Execution time = @stop - @start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With