-- Adds indexes for gateway_request_log hot paths.
--
-- Why:
-- - request_id is used for completion updates in request logging
-- - created_at supports recent log reads
-- - (client, created_at) supports tenant-scoped diagnostics
CREATE INDEX IF NOT EXISTS idx_gateway_request_log_request_id ON gateway_request_log (request_id);

CREATE INDEX IF NOT EXISTS idx_gateway_request_log_created_at ON gateway_request_log (created_at DESC);

CREATE INDEX IF NOT EXISTS idx_gateway_request_log_client_created_at ON gateway_request_log (client, created_at DESC)
WHERE
    client IS NOT NULL;