← All games

Query Plan Investigator

Investigate PostgreSQL query plans, cardinality gaps, scan choices, join amplification, and rollout evidence.

Concept
SQL query planning and cardinality
Difficulty
Advanced
Play time
9-12 minutes
Path
Data & Performance

Interactive scenario

Playable game area: Make the next backend decision

Use the controls below. Feedback appears immediately and final scores stay in this browser.

Concept notes

Why this decision matters

Query Plan Investigator is focused practice for SQL query planning and cardinality. It explains why each answer is safe, risky, or production-ready.

Investigate the evidence chain from cardinality estimates to the work a query actually performs.

Learning objectives

  • Compare estimated and actual plan rows.
  • Connect selectivity to scan and join choices.
  • Validate query changes across representative workloads.

How to play

  1. Inspect the plan evidence and row counts.
  2. Choose the next evidence-based action.
  3. Review how estimates affect scans and joins.

Scoring

  • Each protected planning boundary adds 250 points.
  • Missed decisions enter local review.
  • A perfect investigation scores 1,000.

Backend concept notes

A plan is a hypothesis built from estimates, costs, predicates, and available access paths.

Production tuning compares estimated and observed work before changing SQL or indexes.

Common mistakes

  • Reading cost as elapsed milliseconds.
  • Adding indexes without checking selectivity.
  • Validating only one parameter value.

Review misses from this game

Related Backend Study Lab tools

Use tools from the main site when you want to inspect real inputs.

FAQ

Short answers for how this game fits backend interview and study practice.

Should I use EXPLAIN ANALYZE in production?

Use it only with understood execution risk and safe representative queries because it executes the statement.

Does a lower estimated cost prove a faster query?

No. Cost is a planner comparison unit; measured execution and workload impact provide the evidence.

Leaderboard

Top 10 scores for the current ruleset. No account required.

Loading leaderboard...

    Finish the game to load your latest local score.