← Advanced DBMS learning path
Advanced DBMS · Module 3 of 10

Query processing and optimisation

Understand how SQL is executed efficiently.

📖 Key ideas

  1. Steps: parsing, translation to relational algebra, optimisation, execution.
  2. The optimiser picks the cheapest plan using statistics.
  3. Join algorithms: nested loop, sort-merge, hash join.
  4. Heuristics: push selections and projections down early.
  5. 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