Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/坑:大表 SQL 性能与各层超时配套.md
T

1.1 KiB
Raw Blame History

title, type, permalink, stable_id, scope, memory_type, project_id, usage_profile_id, status, revision, request_id, created_at, updated_at, tags
title type permalink stable_id scope memory_type project_id usage_profile_id status revision request_id created_at updated_at tags
坑:大表 SQL 性能与各层超时配套 experience main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/坑大表-sql-性能与各层超时配套 0f19c98d-0d69-4702-af18-e75edae6370a project experience d5a7f581-c442-4554-87b9-ee723b8b0258 7aee455b-24cc-4008-bdaf-443721e6f939 active 1 metrix-mig-e6 2026-08-12T17:39:13.660673+00:00 2026-08-12T17:39:13.660673+00:00
pitfall
sql
timeout
performance
  1. 报表 SQL 对无索引文本列(如 小区名称)做 UPDATE...JOIN,570 万行级别曾跑 >2h——属业务 SQL 本身问题,需加索引优化(尚未做),排查慢查询先看执行计划再怀疑平台。2) 超时链配套:DB 引擎 read/write_timeout=3600s(曾因 30s 默认在 CREATE TABLE AS SELECT 570 万行时 Lost connection);CapacityReport HTTP 客户端导入 upload_timeout=1800s、报表 run_timeout=7200s。改超时要整条链路一起看(DB→平台 API→客户端),单点改了其他层还会断。