17 lines
662 B
SQL
17 lines
662 B
SQL
-- =============================================================
|
|
-- 巡检 02:孤儿结果记录(biz_file_result 无对应任务)— 只读报表(task-195)
|
|
-- 结果(payload)行丢失父任务即为孤儿;仅副本库只读执行,无副作用。
|
|
-- 结果按 updated_at 升序;每批建议 limit <= 500。
|
|
-- =============================================================
|
|
SELECT r.id,
|
|
r.task_id,
|
|
r.module_type,
|
|
r.source_file_url,
|
|
r.result_file_url,
|
|
r.user_id,
|
|
r.updated_at
|
|
FROM biz_file_result r
|
|
WHERE NOT EXISTS (SELECT 1 FROM biz_file_task t WHERE t.id = r.task_id)
|
|
ORDER BY r.updated_at ASC
|
|
LIMIT 200;
|