Don't use
like
orilike
with query.
✔️ select * from account where name = 'HBL';
❌ select * from account where name like '%HBL%';
If you are using function in a
where
clause you can't apply index on columncreated_at
❌ select SUM(total) from orders where YEAR(created_at) = 2013; Query actually see something like YEAR(...), string output needs to compare interger value.