I am working on large data set While fetching data using two table join. I don’t need to add any order as i have stored my data in sequence what i wanted but now the data sequence has been change as i have added a composite key to make query faster.
But now the order has been changed.
I have tried to removing the index then i am getting the data correctly like previously.
I have tried to reorder column in composite index but didn’t work out.
Here are the more details for reference.
Select a.SubjectID, B.SubjectName from subject_marks a inner join on subject_master b on a.subjectId=b.subjectId where testid=2321 group by subject_id;
added index
Alter table subject_master add index Subject_IDX (subjectId);
Alter table subject_marks add index SubjectTest_IDx (SubjectID,testid);
Alter table subject_marks add index test_Idx (testid);
Any help will be great support.
Deepak Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1