Files
SBrainCO/server/sql/09_add_indexes.sql
T
freedakgmail 6e0c1bd7a4 feat: 新增门店选址分析功能
- 创建选址分析7个SQL视图+5张物化表(38s→33ms)
- 后端新增5个选址API端点
- 前端新增SiteSelectionPage页面(散点图+4Tab)
- 侧边栏新增门店选址导航入口
- 修复SQL列引用错误(d.→a.,去掉重复列)
- 创建v_store_action_priority_deep_april和v_store_area_efficiency_april基础视图
2026-07-27 08:33:42 +08:00

11 lines
566 B
SQL

-- ============================================================
-- 09_add_indexes.sql
-- 门店详情页性能优化索引
-- ============================================================
-- bill_fact 表:门店+日期复合索引(日度趋势、概览等查询使用)
CREATE INDEX IF NOT EXISTS idx_bill_fact_store_closed ON analytics.bill_fact (store_code, closed_at);
-- bill_fact 物化视图:单独的 store_code 索引(其他视图按 store_code 过滤时使用)
CREATE INDEX IF NOT EXISTS idx_bill_fact_store ON analytics.bill_fact (store_code);