j'ai une requette SQL qui met un peu plus de 30 seconde, pourrier vous m'aider a lâmeliorer ?
la reqette :
SELECT tnw_event_control_test_mark.id, tnw_event_control_test_mark.event_control_test_id, tnw_event_control_test_mark.job_description_control_test_mark_id, tnw_event_control_test_mark.checked,
tnw_event_control_test_mark.corrected, tnw_event_control_test_mark.correction_date, tnw_event_control_test_mark.comment, tnw_room_control_test_mark.coefficient, tnw_room_control_test_mark.position,
tnw_control_test_mark.name
FROM tnw_event_control_test_mark
LEFT JOIN tnw_job_description_control_test_mark ON tnw_event_control_test_mark.job_description_control_test_mark_id = tnw_job_description_control_test_mark.id
LEFT JOIN tnw_room_control_test_mark ON tnw_job_description_control_test_mark.room_control_test_mark_id = tnw_room_control_test_mark.id
LEFT JOIN tnw_control_test_mark ON tnw_room_control_test_mark.control_test_mark_id = tnw_control_test_mark.id
WHERE tnw_event_control_test_mark.event_control_test_id BETWEEN 3621 AND 3722 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 4081 AND 4475 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 5199 AND 5657 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 5952 AND 9623 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 9793 AND 9950 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 10808 AND 10935 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 14686 AND 14896 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 19567 AND 19976 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 14897 AND 15254 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 17139 AND 18358 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 18527 AND 18702 OR
tnw_event_control_test_mark.event_control_test_id BETWEEN 20365 AND 21293
ORDER BY tnw_room_control_test_mark.position ASC;
le retour du explain dessu id : 1
select_type : SIMPLE
table : tnw_event_control_test_mark
type : ALL
possible_keys : event_control_test_id
key : NULL
key_len : NULL
ref : NULL
rows : 45936
Extra : Using where; Using temporary; Using filesort
id : 1
select_type : SIMPLE
table : tnw_job_description_control_test_mark
type : eq_ref
possible_keys : PRIMARY
key : PRIMARY
key_len : 8
ref : topnet.tnw_event_control_test_mark.job_description_control_test_mark_id
rows : 1
Extra : NULL
id : 1
select_type : SIMPLE
table : tnw_room_control_test_mark
type : eq_ref
possible_keys : PRIMARY
key : PRIMARY
key_len : 8
ref : topnet.tnw_job_description_control_test_mark.room_control_test_mark_id
rows : 1
Extra : NULL
id : 1
select_type : SIMPLE
table : tnw_control_test_mark
type : eq_ref
possible_keys : PRIMARY
key : PRIMARY
key_len : 8
ref : topnet.tnw_room_control_test_mark.control_test_mark_id
rows : 1
Extra : NULL