mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
docs(migrations): explain why the spend index swap is not CONCURRENTLY
Postgres rejects CREATE INDEX CONCURRENTLY on a partitioned table even with IF NOT EXISTS and the index already present (verified on 18.4), so a concurrent build would fail 20260918120000 on every partitioned install, including stable upgrades where 20260823000000 already built the index. Record that, and the pre-create escape hatch, next to the statement.
This commit is contained in:
parent
923f865fd5
commit
3df010cd68
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,13 @@
|
|||
--
|
||||
-- No-op where 20260823000000 already built the covering index. The new index is
|
||||
-- built before the old one is dropped, so reads keep an index throughout.
|
||||
--
|
||||
-- Not CONCURRENTLY on purpose: Postgres rejects CREATE INDEX CONCURRENTLY on a
|
||||
-- partitioned LiteLLM_SpendLogs (db_scripts/partition_spend_logs.sql) even with
|
||||
-- IF NOT EXISTS and the index already present, so it would fail this migration
|
||||
-- on every partitioned install. The blocking build only runs where the earlier
|
||||
-- (api_key, startTime) version of 20260823000000 was applied. To avoid it,
|
||||
-- pre-create the index CONCURRENTLY under the same name; the build then no-ops.
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX IF NOT EXISTS "LiteLLM_SpendLogs_api_key_startTime_spend_idx" ON "LiteLLM_SpendLogs"("api_key", "startTime", "spend");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue