CREATE INDEX IF NOT EXISTS notifications_user_read_created_idx
  ON notifications (user_id, read, created_at, id);

CREATE INDEX IF NOT EXISTS notifications_user_created_idx
  ON notifications (user_id, created_at, id);

CREATE INDEX IF NOT EXISTS notifications_created_idx
  ON notifications (created_at);

CREATE INDEX IF NOT EXISTS notifications_read_read_at_idx
  ON notifications (read, read_at);

CREATE INDEX IF NOT EXISTS notification_deliveries_occurred_idx
  ON notification_deliveries (occurred_at);
