schema_version: 1
id: inconsistent-query-result-with-subquery
title: Inconsistent query result with subquery
status: draft
owner: codex
source: jira
environment:
  profile: stable-premium
  cluster_id: '10151699876625474756'
  cluster_type: premium
  tidb_version: 8.0.11-TiDB-CLOUD.202603.7
time_window:
  incident_at: '2026-08-04T06:00:00Z'
  allowed:
  - id: reported_incident_window
    start: '2026-08-04T05:50:00Z'
    end: '2026-08-04T06:20:00Z'
prompt:
  text: 请分析 Premium 集群 10151699876625474756 在同一 snapshot 下的查询结果不一致：`NOT IN` 子查询带 `DISTINCT` 时结果偶发多 1 行，移除 `DISTINCT` 或强制 HashAgg 后结果正确；admin check 未发现索引与表数据不一致。请根据执行计划和结果差异判断根因、风险和规避方案。
tags:
- sql
- incorrect-result
- subquery
case_tier: P1
cost_tier: medium
followup:
  scheduled_max_followups: 0
execution:
  acp_bash_timeout_s: 900
