Skip to content
Indexes · drill

One actor's events

Return the id and duration of every event belonging to actor 137, oldest id first. There is an index on actor_id; the budget assumes you let the planner use it.

Tables in this database · Events
CREATE TABLE events (
  id INTEGER PRIMARY KEY,
  actor_id INTEGER NOT NULL,
  kind TEXT NOT NULL,
  email TEXT NOT NULL,
  happened_on DATE NOT NULL,
  duration_ms INTEGER
)
CREATE INDEX events_actor_idx ON events (actor_id);
CREATE INDEX events_kind_happened_idx ON events (kind, happened_on);
CREATE INDEX events_email_idx ON events (email);

Your query

⌘⏎