r/learnSQL • u/durgamvano • 2d ago
MySQL Query Optimization in 2026?
How to actually learn because I think they are very important for a SQL engineer in 2026...More so than ever.
I want to learn the details of cost-based and heuristic-based query optimization. The problem is I am from Nepal and we do not have libraries or digital courses service from libraries.
To the USA people: Please consider tell government to help us read and learn in a mass way.
I would really appreciate if you guys could help me out.
I found lots of free resources in google pdfs, but they are lecture slides meant to be accompanied with the lecture. But the problem is that lecture video is not freely accessible.
I am willing to pay huge money to learn this thing.
3
u/durgamvano 2d ago
I am finding really helpful materials for free but My issue is that they are tidbits from hector garcia molina book which I have pdf but not physical copy or lecture video so it is more harder for me to learn in that way.
1
u/Aggressive_Ad_5454 2d ago
Learn to read Actual Execution Plans. EXPLAIN ANALYZE in MySQL. ANALYZE in MariaDb.
Read https://use-the-index-luke.com/
Read this https://stackoverflow.com/tags/query-optimization/info and then ask for specific explanations on here, or on Stack Overflow ( which has gone quiet ).
1
u/Discordbothost 2d ago
CMU 15-445 has free video and notes for lecture 15 on its Fall 2024 schedule. A MySQL exercise to go with it: run EXPLAIN ANALYZE on the same SELECT with a rare value and a common one. Compare estimated and actual rows.
1
u/Least_Ad_1795 11h ago
Start with MySQL's official documentation on EXPLAIN, EXPLAIN ANALYZE, indexes, and query execution plans. Then learn cost-based optimization, cardinality estimation, join algorithms, and index selection. Practise using real datasets and compare query execution times. You can also explore free university lectures on database internals and query optimization on YouTube. Hands-on practice with execution plans is the best way to understand query optimization deeply.