ThearchyHelios
6b3c737fb8
数据剖析改成逐表的后台任务:引擎改编排、剖析任务、接口、设置换新键
以前剖析是一次同步长请求,预算按整次算(max_queries 60、max_total_s 120),选 50 张表只做得完前两三张,其余整张记「查询次数用完」;不能停,关掉页面报告就没了,对业务库查了什么无从查。
- data/catalog_profile.py:检查逻辑和 _apply 并入规则原样保留,只换编排。公开的逐表入口 profile_table:先列全检查项(plan_checks,纯函数,范围的 profile_checks、建任务时列的检查项、执行用同一份;遮罩、多列、不在表结构里、指向视图的关系在这里就列成按规则跳过),第一条查询估行数(确知空表整张表跳过),逐项执行、进度回调,整张表结束写目录并和回调在同一次库操作里;停止时做完的项照常写、没做的记 cancelled 保留旧结论。_Runner 拆成整个任务一个的 SourceRunner(只读守卫、单条时限、任务级止损:连续 3 条失败、最近 10 条 7 条超时;最近 6 条 4 条超时提醒;每条查询留痕,SQL 经 normalize_sql 去掉字面量)和每张表一个的 TableBudget(用完只停这张表)。删掉同步的 profile_catalog、挑表前批量估行数(_skip_empty、PROFILE_DEFAULT_TABLES、PROFILE_PROBE_TABLES)和进程内 _RUNNING。设置换成 table_max_queries(1–200,缺省 40)、table_max_s(10–600,缺省 60),旧键 max_queries、max_total_s 启动时从库里删掉(migrate_settings,不折算:旧值按整次算,含义不同),保存时只摘掉不报错(without_legacy)。表助手的 run_query 和起草时核对有效记录条件改走单条查询入口 run_single_query,行为不变。
- data/catalog_profile_jobs.py:剖析任务的建(selected / needed / all 三种范围,排序同前:有待核实关系的在前、使用次数、表结构顺序;挑出 0 张 ProfileNothing)、排队(和同源起草按建立先后串行,waiting_for)、执行(每张表开始前重读数据源:停用或关掉剖析就停下;遮罩按最新设置)、停止、重试、启动标中断不续跑、保留最近 50 个结束的任务(某张表最近一次剖析所在的不删)、last_profile / profile_due 的查询、任务和逐表的接口形状。
- api/catalog.py:加 /profile-jobs(建、active、latest、{job_id}、tasks/{seq}、cancel、retry),登记在 /{table} 前面;删掉 POST /catalog/profile;清单每行加 last_profile、profile_due、profile_due_reason、profile_checks,顶层加 active_profile_job;单表加 last_profile;导入目录、同步起草遇到剖析任务 409 profile_busy。api/coded.py 加 profile_nothing、catalog_profile_finished;api/datasources.py 保存时摘掉旧键;main.py 启动时标中断加设置迁移,关停时停掉进行中的剖析。
- 测试:test_catalog_profile.py、test_catalog_profile_units.py、test_catalog_semantics.py 里打同步接口和旧设置键的改走任务和新键,检查逻辑的断言保留;同步接口的整次总量上限一条改成逐表次数、逐表时长两条。
2026-10-15 18:30:48 +08:00
..
2026-10-15 07:15:37 +08:00
2026-10-13 20:30:02 +08:00
2026-10-15 12:09:29 +08:00
2026-10-13 10:03:24 +08:00
2026-10-04 23:40:20 +08:00
2026-10-06 11:44:58 +08:00
2026-10-14 21:55:51 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-14 21:55:51 +08:00
2026-10-14 21:55:51 +08:00
2026-10-15 12:09:29 +08:00
2026-10-14 21:55:51 +08:00
2026-10-15 07:15:37 +08:00
2026-10-15 08:35:28 +08:00
2026-10-15 07:15:37 +08:00
2026-10-14 21:55:51 +08:00
2026-10-15 08:35:28 +08:00
2026-10-15 12:09:29 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 08:35:28 +08:00
2026-09-29 05:26:34 +08:00
2026-10-04 12:03:14 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 08:35:28 +08:00
2026-10-15 07:15:37 +08:00
2026-10-14 20:05:23 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 14:32:25 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 17:31:20 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 13:55:19 +08:00
2026-09-30 09:48:16 +08:00
2026-10-12 17:23:27 +08:00
2026-10-13 10:03:24 +08:00
2026-10-12 17:23:27 +08:00
2026-10-12 19:09:50 +08:00
2026-10-06 19:21:23 +08:00
2026-10-12 19:09:50 +08:00
2026-10-12 23:01:09 +08:00
2026-10-14 22:08:33 +08:00
2026-10-15 14:44:26 +08:00
2026-10-14 21:55:51 +08:00
2026-10-04 02:19:26 +08:00
2026-10-14 15:38:15 +08:00
2026-10-14 09:59:19 +08:00
2026-10-14 10:00:10 +08:00
2026-10-14 14:07:14 +08:00
2026-10-14 22:17:00 +08:00
2026-10-13 20:30:02 +08:00
2026-10-14 20:05:23 +08:00
2026-10-13 20:30:02 +08:00
2026-10-14 15:38:15 +08:00
2026-10-15 18:30:48 +08:00
2026-10-15 18:30:48 +08:00
2026-10-04 01:07:15 +08:00
2026-10-14 16:11:04 +08:00
2026-10-04 02:00:17 +08:00
2026-10-14 09:51:49 +08:00
2026-10-03 11:09:09 +08:00
2026-10-14 20:05:23 +08:00
2026-10-15 18:30:48 +08:00
2026-10-04 02:19:26 +08:00
2026-10-03 12:14:17 +08:00
2026-10-14 16:11:04 +08:00
2026-10-07 01:09:36 +08:00
2026-10-14 20:05:23 +08:00
2026-10-12 15:55:19 +08:00
2026-09-29 11:10:53 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 16:42:29 +08:00
2026-10-05 16:41:59 +08:00
2026-10-05 16:41:59 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 19:51:29 +08:00
2026-09-30 10:04:52 +08:00
2026-10-15 13:55:19 +08:00
2026-09-28 02:42:40 +08:00
2026-10-14 21:55:51 +08:00
2026-10-14 20:05:23 +08:00
2026-10-04 11:07:40 +08:00
2026-10-15 13:55:19 +08:00
2026-10-05 15:08:53 +08:00
2026-10-04 11:10:28 +08:00
2026-10-14 20:05:23 +08:00
2026-09-29 11:10:53 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 12:09:29 +08:00
2026-10-14 20:05:23 +08:00
2026-10-14 20:05:23 +08:00
2026-09-30 08:05:15 +08:00
2026-10-14 20:05:23 +08:00
2026-09-27 10:16:32 +08:00
2026-10-14 20:05:23 +08:00
2026-10-15 17:31:20 +08:00
2026-10-15 14:59:40 +08:00
2026-09-30 18:05:33 +08:00
2026-09-27 10:16:32 +08:00
2026-09-30 08:05:15 +08:00
2026-10-05 00:26:04 +08:00
2026-09-27 23:37:32 +08:00
2026-09-30 08:05:15 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 14:38:10 +08:00
2026-10-05 15:54:03 +08:00
2026-10-05 15:54:03 +08:00
2026-10-14 15:38:15 +08:00
2026-10-07 01:34:59 +08:00
2026-10-15 07:15:37 +08:00
2026-10-12 12:24:14 +08:00
2026-10-06 18:03:12 +08:00
2026-10-15 07:15:37 +08:00
2026-10-01 13:42:04 +08:00
2026-09-28 11:47:23 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 12:02:03 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 12:58:37 +08:00
2026-10-06 12:58:37 +08:00
2026-09-29 05:26:34 +08:00
2026-09-29 05:26:34 +08:00
2026-09-30 08:05:15 +08:00
2026-10-12 13:50:31 +08:00
2026-10-12 17:23:27 +08:00
2026-10-12 13:50:31 +08:00
2026-10-12 17:23:27 +08:00
2026-10-12 10:48:19 +08:00
2026-10-04 02:35:33 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-12 12:24:14 +08:00
2026-09-30 15:03:31 +08:00
2026-10-01 13:42:04 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 11:37:22 +08:00
2026-10-01 13:42:04 +08:00
2026-09-30 08:05:15 +08:00
2026-10-04 11:02:06 +08:00
2026-10-15 13:55:19 +08:00
2026-10-02 07:38:44 +08:00
2026-10-15 13:55:19 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 10:04:52 +08:00
2026-09-30 08:05:15 +08:00
2026-09-27 10:16:32 +08:00
2026-09-30 08:05:15 +08:00
2026-09-27 10:16:32 +08:00
2026-10-12 15:55:19 +08:00
2026-10-07 01:09:36 +08:00
2026-10-06 22:52:28 +08:00
2026-10-12 15:55:19 +08:00
2026-10-05 01:18:03 +08:00
2026-10-01 13:42:04 +08:00
2026-10-03 09:30:50 +08:00
2026-09-28 11:47:23 +08:00
2026-09-28 11:47:23 +08:00
2026-10-05 18:45:59 +08:00
2026-09-29 16:07:19 +08:00
2026-10-12 13:50:31 +08:00
2026-10-02 14:38:10 +08:00
2026-09-30 10:04:52 +08:00
2026-09-30 10:04:52 +08:00
2026-09-30 10:04:52 +08:00
2026-10-06 12:58:37 +08:00
2026-10-06 14:30:15 +08:00
2026-09-27 10:16:32 +08:00
2026-09-28 11:47:45 +08:00
2026-09-30 08:05:15 +08:00
2026-10-14 20:05:23 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-12 10:48:19 +08:00
2026-10-12 10:48:19 +08:00
2026-10-07 01:09:36 +08:00
2026-10-12 13:14:36 +08:00
2026-10-06 19:11:14 +08:00
2026-10-06 21:50:48 +08:00
2026-10-12 10:50:40 +08:00
2026-10-13 16:59:58 +08:00
2026-10-12 12:18:34 +08:00
2026-10-07 01:09:36 +08:00
2026-10-14 20:05:23 +08:00
2026-10-04 01:08:42 +08:00
2026-10-04 02:17:32 +08:00
2026-10-03 09:36:20 +08:00
2026-10-03 10:40:47 +08:00
2026-09-28 11:47:23 +08:00
2026-10-15 07:15:37 +08:00
2026-10-05 03:26:43 +08:00
2026-10-15 07:15:37 +08:00
2026-09-30 11:19:25 +08:00
2026-10-06 14:29:48 +08:00
2026-09-30 08:05:15 +08:00
2026-10-01 13:42:04 +08:00
2026-09-30 08:05:15 +08:00
2026-10-14 20:05:23 +08:00
2026-10-04 12:27:38 +08:00
2026-10-02 07:38:44 +08:00
2026-10-15 13:55:19 +08:00
2026-10-15 12:09:29 +08:00
2026-10-15 07:15:37 +08:00
2026-10-15 07:15:37 +08:00
2026-10-14 22:08:33 +08:00
2026-10-14 22:08:33 +08:00
2026-10-02 14:38:10 +08:00
2026-10-02 14:38:10 +08:00
2026-10-03 09:36:20 +08:00
2026-10-02 14:38:10 +08:00
2026-10-12 10:17:40 +08:00
2026-10-02 14:38:10 +08:00
2026-10-06 19:43:44 +08:00
2026-10-06 19:43:44 +08:00
2026-10-06 17:29:18 +08:00
2026-10-06 19:43:44 +08:00
2026-10-06 19:43:44 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 17:31:20 +08:00
2026-10-04 02:52:43 +08:00
2026-09-28 21:20:04 +08:00
2026-09-30 08:05:15 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-01 22:00:07 +08:00
2026-10-01 22:00:07 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-01 22:00:07 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 14:38:10 +08:00
2026-10-02 07:38:44 +08:00
2026-10-01 22:00:07 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-01 22:00:07 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-05 18:50:34 +08:00
2026-10-06 09:20:09 +08:00
2026-10-15 13:55:19 +08:00
2026-10-14 20:05:23 +08:00
2026-10-04 11:28:23 +08:00
2026-10-04 12:28:07 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-04 11:33:09 +08:00
2026-10-12 14:26:43 +08:00
2026-10-13 10:04:30 +08:00
2026-10-10 12:59:21 +08:00
2026-10-06 13:32:38 +08:00
2026-09-30 10:04:52 +08:00
2026-10-12 13:50:31 +08:00
2026-10-12 23:01:09 +08:00
2026-10-12 12:33:32 +08:00
2026-10-12 23:01:09 +08:00
2026-10-12 23:01:09 +08:00
2026-10-12 19:09:50 +08:00
2026-10-12 17:23:27 +08:00
2026-10-12 13:50:31 +08:00
2026-10-12 17:23:27 +08:00
2026-09-30 15:03:31 +08:00
2026-09-30 08:05:15 +08:00
2026-10-04 02:24:49 +08:00
2026-10-04 02:33:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 09:31:00 +08:00
2026-09-30 08:05:15 +08:00
2026-10-05 01:18:03 +08:00
2026-10-05 18:45:59 +08:00
2026-10-06 14:32:30 +08:00
2026-10-14 22:08:33 +08:00
2026-10-05 00:07:07 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-14 20:05:23 +08:00
2026-09-27 10:16:32 +08:00
2026-10-14 20:05:23 +08:00
2026-10-14 21:55:51 +08:00
2026-10-04 01:52:24 +08:00
2026-09-27 23:37:32 +08:00
2026-10-07 00:02:15 +08:00
2026-10-06 08:48:56 +08:00
2026-10-06 16:42:29 +08:00
2026-10-05 08:50:57 +08:00
2026-10-05 08:37:57 +08:00
2026-10-15 07:15:37 +08:00
2026-10-05 18:39:10 +08:00
2026-10-06 08:48:56 +08:00
2026-10-06 08:48:56 +08:00
2026-10-15 07:15:37 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 12:09:29 +08:00
2026-10-05 08:37:57 +08:00
2026-10-02 07:38:44 +08:00
2026-10-06 08:10:41 +08:00
2026-09-29 05:26:34 +08:00
2026-10-07 01:34:59 +08:00
2026-10-07 01:34:59 +08:00
2026-10-04 02:19:26 +08:00
2026-10-01 13:42:04 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-02 07:38:44 +08:00
2026-10-01 22:00:07 +08:00
2026-10-14 21:55:51 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 07:15:37 +08:00
2026-09-28 21:20:04 +08:00
2026-10-07 00:02:15 +08:00
2026-10-14 20:05:23 +08:00
2026-10-15 07:15:37 +08:00
2026-10-14 21:55:51 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-03 11:09:09 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-15 13:55:19 +08:00
2026-09-27 10:16:32 +08:00
2026-09-30 08:05:15 +08:00
2026-09-30 08:05:15 +08:00
2026-10-06 21:50:48 +08:00
2026-10-05 01:46:55 +08:00
2026-10-06 14:32:30 +08:00
2026-10-05 18:45:44 +08:00
2026-10-12 12:24:14 +08:00
2026-10-07 00:02:15 +08:00
2026-10-14 22:17:00 +08:00
2026-10-07 01:19:26 +08:00
2026-10-05 00:06:03 +08:00
2026-10-06 14:30:03 +08:00
2026-09-29 05:26:34 +08:00
2026-09-30 09:48:16 +08:00
2026-10-15 07:15:37 +08:00
2026-10-12 17:23:27 +08:00
2026-10-05 06:49:33 +08:00
2026-10-14 21:55:51 +08:00
2026-09-28 02:42:40 +08:00
2026-10-06 23:56:31 +08:00
2026-10-01 22:00:07 +08:00
2026-10-01 13:42:04 +08:00