I have mysql DB in which a single table has 7 million records, the table needs to be optimized, i am little bit hesitant to add index as that is going to take much time to add across 7 million records. I keep getting this table queries in slow query log, along the query is written in optimistic manner.
What is the best approach to handle this so that table query does not come up in slow query?
Delete from table1 where column1 in (select column1 from table2); is not optimal.
Try
I believe it should perform better