365 Days of Daily Coding: Day 134
I am feeling quite sick today. I think I might have a migraine. This is diminishing my ability to think properly and hence I have not worked on any advanced SQL puzzles today.
In order to continue my streak of daily posting, I decided to read an article on SQL query optimisation instead. Hopefully tomorrow will be a better day.
I followed this article where it highlights some of the areas to look into for optimising queries.
- Avoid using “SELECT *” in your queries
- Avoid using “SELECT DISTINCT”
- Use INNER JOIN instead of WHERE clauses
- Use “LIMIT” command to control the number of rows
- IN operator is more expensive than EXISTS operator
- Do not use Loops, instead use Bulk insert/update
You can read more from the article I read here.

Leave a comment