6 lines
251 B
SQL
6 lines
251 B
SQL
CREATE INDEX audit_events_order_decision ON audit_events
|
|
(tenant_id, (data->>'operation_id'), created_at, event_id)
|
|
WHERE event_type IN ('plan_authorization', 'plan_revoked');
|
|
|
|
CREATE INDEX jobs_order_lookup ON jobs (tenant_id, operation_id);
|