SELECT mt.Test_ID,
mtp.Test_Plan_Doc_No,
mp.Group_Name,
mp.Point_Name,
mp.Limit_1,
mp.Limit_2,
mp.Datatype,
mt.Start_Date,
mv.Measurement_Value,
mv.Status_Value
FROM measurement_test mt
INNER JOIN measurement_values mv
ON mt.Test_ID = mv.Test_ID
INNER JOIN measurement_point mp
ON mv.Point_ID = mp.Point_ID
INNER JOIN measurement_test_plan mtp
ON mtp.Test_ID = mt.Test_ID
WHERE mtp.Test_Plan_Doc_No IN ( 'test1', 'test2' )
AND mp.Group_Name = 'gp_name'
hello guys.
The above is the query that i am executing to create a view.
But i have a problem as follows:
the measurement value table has around 82 million rows. the measurement point table has around say 5 million rows measurement test plan and measurement test tables have around 9000 - 100000 rows.
My problem is when i execute the above query the execution time is 8 minutes and the result that is generated has only 400 rows.
Is there any possible way to reduce the execution time of the above query?
NOTE : I am using the above query in my web page
SHOW CREATE TABLE xxx
withxxx
in(measurement_test, measurement_values, measurement_point, measurement_test_plan)