id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE ocpp ref product_id,category_id,m_company_id,part_number,category_id1 category_id 4 const 5549 Using where; Using temporary; Using filesort 1 SIMPLE mc eq_ref PRIMARY,active PRIMARY 4 ocpp.m_company_id 1 Using where 1 SIMPLE cnn ref company,active,created_at company 4 ocpp.m_company_id 2 1 SIMPLE cnrr eq_ref PRIMARY PRIMARY 4 cnn.result_id 1 Using where; Using index; Not exists 1 SIMPLE cnc eq_ref PRIMARY,note_id,category_id PRIMARY 8 cnn.id,const 1 Using where; Using index; Not exists 1 SIMPLE atu ref firm_id,ca_k_active firm_id 4 ocpp.m_company_id 1 1 SIMPLE atuc eq_ref PRIMARY,attachment_id,category_id,cac_k_active PRIMARY 8 atu.id,const 1 Using where; Not exists 1 SIMPLE atf ref m_company_id,m_company_function_id,mca m_company_id 4 mc.id 1 1 SIMPLE atfc eq_ref uniq_attachment_id_category_id,attachment_id,fk_category_id,fk_updated_by uniq_attachment_id_category_id 8 atf.id,const 1 Using where; Not exists 1 SIMPLE ocp1 ref m_company_id,part_number m_company_id 4 ocpp.m_company_id 3 Using where; Not exists