Hi Everyone,
So, can anyone tell me how to edit these select?
SELECT * FROM documenti, docinfo, mdoccepag2 WHERE documenti.d_id = docinfo.d_id AND docinfo.d_id = mdoccepag2.d_id AND mdoccepag2.d_studio = 'S' AND mdoccepag2.d_azienda = 'S' ORDER BY docinfo.d_data DESC, docinfo.d_id ASC
it's very slow queries .
I have tried to add index docinfo.d_dat and docinfo.d_id but the explain out don't use index in the sort
The explain out..
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE mdoccepag2 ALL PRIMARY NULL NULL NULL 387556 Using where; Using temporary; Using filesort
1 SIMPLE documenti eq_ref PRIMARY PRIMARY 4 portale.mdoccepag2.d_id 1
1 SIMPLE docinfo eq_ref PRIMARY PRIMARY 4 portale.documenti.d_id 1 Using where
Thanks for all
Biondo68
So, can anyone tell me how to edit these select?
SELECT * FROM documenti, docinfo, mdoccepag2 WHERE documenti.d_id = docinfo.d_id AND docinfo.d_id = mdoccepag2.d_id AND mdoccepag2.d_studio = 'S' AND mdoccepag2.d_azienda = 'S' ORDER BY docinfo.d_data DESC, docinfo.d_id ASC
it's very slow queries .
I have tried to add index docinfo.d_dat and docinfo.d_id but the explain out don't use index in the sort
The explain out..
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE mdoccepag2 ALL PRIMARY NULL NULL NULL 387556 Using where; Using temporary; Using filesort
1 SIMPLE documenti eq_ref PRIMARY PRIMARY 4 portale.mdoccepag2.d_id 1
1 SIMPLE docinfo eq_ref PRIMARY PRIMARY 4 portale.documenti.d_id 1 Using where
Thanks for all
Biondo68