
How to optimize sql query in mysql? Thanks!

Optimization of SQL Query depends on what you wanted to do? If you can write you code will work. Or if you just wanted to know how to write perfect query in SQL then see the example given below.. It can be used to retrieve all the data from your table where value is equal to UPPERCASE.
SELECT indexed_text FROM your_table WHERE upper(indexed_text) = 'UPPERCASE TEXT';

in other example ..you can retrieve the existing data from database table.
select * from products where public_id in ( select public_id from products group by public_id having sum(deleted) = 0 ) and online = 1
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.