Abekus — AI learning and job matching platform logo

SQL Query Optimization

  • 77 lessons
  • About 9 hours
  • Self-paced
0%Complete
Guided Mode

Start with lesson 1

77 lessons. The first one is free, no signup needed.

🗺️ Your learning path
First Slow Query
Core Ideas

What you'll learn

  • Read an EXPLAIN ANALYZE plan node by node: startup and total cost, estimated and actual rows, loops and buffers.
  • Explain when PostgreSQL uses a sequential, index, index-only or bitmap scan, and tell an index condition from a filter.
  • Design B-tree, multicolumn, partial, expression, covering, GIN and BRIN indexes, and weigh their write cost.
  • Recognise nested loop, hash and merge joins and the conditions that favour each, including indexes on foreign keys.
  • Fix bad row estimates with ANALYZE, statistics targets and extended statistics on correlated columns.
  • Rewrite slow patterns such as non-sargable filters, OFFSET paging and N+1 queries, and find slow queries with pg_stat_statements and auto_explain.

About this course

A query that returns in a few milliseconds on a laptop can take seconds once a table holds millions of rows, and the usual reaction of adding an index to every column often makes things worse. This online SQL query optimization course on Abekus teaches how PostgreSQL decides how to run a query, how to read that decision in EXPLAIN and EXPLAIN ANALYZE output, and how to fix it with the right index, better statistics or a rewritten query. It uses short reading-card lessons, each followed by an MCQ quiz.

Jobs that ask for SQL

2,127 live openings list SQL as a required skill.

See all SQL jobs ›

Frequently asked questions