perf(data-process): 优化SQL查询性能避免笛卡尔积
- 移除门店名称过滤条件防止MySQL优化器异常丢失50%门店数据 - 采用双层GROUP BY结构避免JOIN导致的笛卡尔积问题 - 内层按商户名和订单号分组,订单级字段使用MAX取单次值 - 外层按商户名聚合,所有字段使用SUM进行跨订单汇总 - 更新权益和延保财务成本分项SQL模板适配新查询逻辑 - 在Python层实现门店模糊匹配替代数据库层面的复杂过滤
Showing
5 changed files
with
153 additions
and
103 deletions
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment