Setup

A Postgres table events has 10 million rows:

CREATE TABLE events (
  id         bigserial PRIMARY KEY,
  user_id    bigint NOT NULL,
  type       text NOT NULL,
  payload    jsonb NOT NULL,
  created_at timestamptz NOT NULL
);
CREATE INDEX events_user_id ON events (user_id);

The activity feed runs this query:

SELECT * FROM events
WHERE user_id = $1
ORDER BY created_at DESC
LIMIT 20;

A typical user has about 2,000 events. The heaviest user has 400,000. The database runs on a mid-sized cloud instance, the table fits in memory, and nothing else is running.

Commit before you see the outcome

Your call

For the user with 400,000 events, roughly how long does this query take?

Your answer

Move the slider (or use the arrow keys) to set it. 0% is a pure guess; 100% means you'd bet on it.

After you reveal, your answer and confidence are locked. That's the point.