| 1 | -- This month's users, read every fifteen minutes for autopay and the limit |
| 2 | -- warnings: usage entries from a date on, by kind and time, and the |
| 3 | -- workspace in the index so the read never touches the ledger itself. |
| 4 | CREATE INDEX IF NOT EXISTS ledger_usage_by_time ON ledger (kind, created_at, workspace); |