Lurker News
I too often find myself getting stuck when it comes to more advanced SQL queries. I have never actively learnt SQL and realise that I don't have a great mental model of how it works. I would like to improve this as it is killing my productivity from time to time.

Comments (97) 45 threads

Show all comments

Showing thread 13 of 45

gjkood1 reply#
One of the useful things that I learned as I began to use SQL is to learn how to use and analyze query plans.

This will take you from the theory of indexes to actually seeing how it is used by the SQL engine.
This will go a long way to building the right indexes and SQL tuning in general.
I would suggest learning how to generate the query plans for your SQL engine of choice.

jorgeleo1 reply#
This!

This is key. I cannot count how many times I go to a client that is complaining that their software is slow and ends up that is because they don't have the right indexes

gjkood#
The difference between a poorly performing product that uses an RDBMS backend and a highly performant one is purely down to SQL query tuning and finding the right indexes.

It is the lowest hanging fruit to improve performance.
Even if you don't have the flexibility to change the SQL on a project, you may still have the ability to create/rebuild the indexes to make the query faster.