Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Skill

Indexing & Query Optimization

Read execution plans, design indexes and rewrite queries so database workloads meet latency targets without wasting write throughput or storage.

Intermediate2 roadmaps

4 objectives 6 steps about 145 min

Learn it step by step

Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.

Start learning

This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.

Learning objectives

  • Read EXPLAIN (ANALYZE, BUFFERS) output to identify scan and join methods, row-estimate errors and the most expensive plan node.
  • Choose B-tree, composite, partial, covering or expression indexes (and recognize when GIN or BRIN fit, including GIN for full-text and trigram search) for a query pattern, accounting for write overhead.
  • Rewrite queries to be index-friendly (sargable predicates, keyset pagination, set-based instead of row-by-row access) and keep planner statistics current.
  • Find the most expensive statements with pg_stat_statements and verify an optimization with before-and-after measurements.

Lesson plan

6 steps, about 145 min · 5 of 5 lessons available so far

Practise it

Generate a 10-million-row orders table, replay a provided query workload and use pg_stat_statements to find the three costliest queries; make each at least five times faster with indexes or rewrites, serve a ranked product-name search from a full-text or trigram GIN index, and submit before-and-after EXPLAIN ANALYZE output plus the insert-throughput cost of every index you added.

Build it from scratch

Practice builds that exercise this skill by re-creating a real technology.

Browse 4 tutorials that practise it

References

Hard prerequisites

Unlocks

Nothing depends on this skill yet.

On these roadmaps

Progress and evidence for this skill are shared across all of them.