perf(account-supply): 合并全局库存统计并增加查询索引

This commit is contained in:
yml
2026-11-22 14:04:24 +08:00
parent f2041f2444
commit 7233bdfa50
7 changed files with 395 additions and 99 deletions
+12
View File
@@ -1971,6 +1971,18 @@ class AccountCommodityState(Base):
"platform",
"scope",
),
# 全局供给目标不指定 commodity_id,不能使用上面的 match 索引:
# commodity_id 位于前缀中间,会让 availability/valid_until 退化为过滤列。
Index(
"ix_account_commodity_global_available",
"platform",
"scope",
"availability",
"valid_until",
"account_id",
"available_from",
"available_until",
),
)