← Advanced DBMS learning pathAdvanced DBMS · Module 3 of 10
Query processing and optimisation
Understand how SQL is executed efficiently.
📖 Key ideas
- Steps: parsing, translation to relational algebra, optimisation, execution.
- The optimiser picks the cheapest plan using statistics.
- Join algorithms: nested loop, sort-merge, hash join.
- Heuristics: push selections and projections down early.
- EXPLAIN shows the chosen plan.
💡 Real-life example: The query optimiser is a GPS choosing the fastest route among many possible roads.
Query planSteps to execute a query
Cost-based optimiserChooses plan with lowest estimated cost
Hash joinJoin using a hash table
Selection pushdownFiltering early