I have been working with mysql almost 3 years and now i am struck very badly and it is all about the query performance because the tables i am dealing with having records in millions so please suggest me what to do.
I have to fetch dada from 6 tables
table_1
table_2
table_3
table_4
table_5
table_6
Now i tell you how -
table_1/table_2/table_3/table_4 have left join and fetching id
out of it. - Lets say this is step A
.
Then I fetch all order_id from table_6 - Let’s say this is step B
.
Now i search step A
using IN(id) AND step B
using NOT IN(order_id) into table_5 which screw my query because table_5 has 300k records and table_6 has 200k records so please can someone suggest me what to do?
If my question is not clear then i can send screenshot also.
Looking forward to hear from you soon and thanks in advance!