Paths/Backend Engineer/Relational Databases / Schemas & Indexes
Index the Queries You Run
An index is a bet on the queries you actually run. Write the composite indexes for the two hot paths of the orders table.
Validator
⏱ 0:00
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- File ~/backend/db/indexes.sql exists○
- The file creates a composite index over the status and the created_at column○
- The file creates an index on the foreign key○
02Walkthrough
1 of 4 revealed- 01
Write the first index
The order of the columns matters - equality first, range last. status is filtered on exactly, created_at is sorted on.
echo CREATE INDEX idx_orders_status_created_at ON orders (status, created_at DESC); > ~/backend/db/indexes.sql - 3 locked · each failed submit reveals one
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list