内镜追溯系统 数据库视图批量优化(提速第一步 ect_cycles 转视图,最小代码改动) #316

Open
opened 2025-12-31 11:06:12 +08:00 by bigtran · 2 comments
Owner

v_clean sql 查询速度 3.5s -> 0.33s,页面接口返回速度 15.63s ->5.53s (性能瓶颈不在sql本身,在页面内部)

优化前

image.png
image.png

优化后

image.png
image.png

# v_clean sql 查询速度 3.5s -> 0.33s,页面接口返回速度 15.63s ->5.53s (性能瓶颈不在sql本身,在页面内部) ## 优化前 ![image.png](/attachments/e61e03f9-f393-40ab-a262-aca33ee2cf9f) ![image.png](/attachments/ed450186-031e-467a-9e0e-13982b62bcf5) ## 优化后 ![image.png](/attachments/c0a67319-843e-4f9b-ab3e-afc9cf9fd62f) ![image.png](/attachments/a23f84c8-58fe-419c-8fbe-f948cebbad82)
Author
Owner

v_check 0.821s -> 0.368s

image.png

image.png

# v_check 0.821s -> 0.368s ![image.png](/attachments/d6ac1343-8c86-45ee-bcd4-63cfb3ec6401) ![image.png](/attachments/455ab7be-9489-4d85-8fc1-c97440aa30b4)
Author
Owner

v_report_clean_check_leaktest 5.8s -> 0.157

优化前

image.png

优化后

image.png

image.png

两个sql的结果不同,初步认为以前的有毛病,进一步再验证一下。

# v_report_clean_check_leaktest 5.8s -> 0.157 ## 优化前 ![image.png](/attachments/1394d2d9-ae95-4e76-876a-ccb3eae6172e) ## 优化后 ![image.png](/attachments/b3e4fe23-f043-4c66-8cc3-fb8b8f7e38eb) ![image.png](/attachments/ee19e948-99b7-4416-864c-02aa54dad5aa) # 两个sql的结果不同,初步认为以前的有毛病,进一步再验证一下。
Sign in to join this conversation.