Paths/Data Engineer/SQL & Query Craft / Indexes & Query Plans
Index the Warehouse
An index is a bet on the queries you actually run. Write the 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 ~/warehouse/indexes.sql exists○
- The file creates a composite index over the status and the created_at column○
- The file creates an index on the customer column○
02Walkthrough
1 of 3 revealed- 01
Write the composite 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); > ~/warehouse/indexes.sql - 2 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