The power of Explain will give a detailed information on what our query will do and how much it’ll cost in time when executed. This is one of the most common mistakes that I’ve seen a lot of people doing, regardless of their level of experience or years in the industry.
Table of contents
1. The power of Explain2. Stop running queries in loops3. Select only the fields that you need4. Avoid using WHERE on INNER JOIN5. Use WHERE Instead of HAVING6. Use JOINs in favour of subqueries7. Avoid using SELECT DISTINCT8. Use EXISTS() Instead of COUNT()9. Taking advantage of Indexes10. Data pruning using clustered indexes11. Use JSON/ARRAY columns and LAMBDA12. Table Partitioning/Reduce Table Size3 Comments
Sort: