liufumingren
b7feed7e76
perf(order): 补复核时间统计索引,消除大屏复核数全表扫描
大屏「今日复核数」(warehouse_panel.queryFulfillment)固定按 recheck_time 区间 + status 过滤 + dispatch_lane IN ('m4','m5') 做 count,而 dispatch 分表上 recheck_time 无任何索引:EXPLAIN 为 type=ALL / rows=1,400,782,生产 7 天出现 138 次、平均 35.8s(同形状的 delivery_time 版本命中 idx_dispatch_1000028_panel_fulfillment 走 range,可直接对比)。
索引形态:current/outsourced 为 (recheck_time,status);dispatch 为 (recheck_time,status,dispatch_lane),比 current 版本多带 dispatch_lane 以便 count(*) 完全走索引不回表,并由 isPanelRecheckIndexName 保证 dispatch 不继承 current 版本。历史表不参与大屏统计,不建该索引。
依据:抽样 20 万行 recheck_time 非空 97.9%、status<>cancel 98.8%,时间窗口是唯一有效过滤条件。索引仍由模型定义在分表首次访问时懒创建。
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-17 01:47:26 +08:00
..
2026-10-29 15:02:29 +08:00
2026-10-16 05:27:30 +08:00
2026-05-06 01:32:55 +08:00
2026-11-14 17:14:04 +08:00
2026-11-17 01:47:26 +08:00
2026-11-10 02:53:15 +08:00
2026-11-17 01:30:08 +08:00
2026-09-23 02:46:28 +08:00
2026-10-29 15:02:29 +08:00