Skip to content

[Subtask]: D18 [baseline] Define statistics freshness and cost semantics instead of exposing implementation history #32295

Open

Description

@XuPeng-SH

Parent Issue

Parent issue: #32278

Detail of Subtask

Catalog ID: D18
Origin: B - Pre-existing in the 4.2 baseline and retained on main
Evidence level: Implementation history exposed in the API; semantic differences require analysis

4.2 versus main: provenance

The baseline already exposes session mo_table_stats.use_old_impl, CN stats-using-old-impl, and cached/force/reset/relation paths. Main retains them. Main's stateless-callback fix is not an outstanding cross-engine capture defect.

Design problem, impact, and existing responsibility

Choosing an old implementation does not directly explain freshness, visibility, or cost to users. Historical flags and fallback policy are spread across layers. Existing paths may provide different valid semantics, so neither is yet proven redundant.

Acceptance criteria

  • Document actual freshness, precision, snapshots, own-transaction DDL, subscription tables, and force/reset semantics, with a retained implementation for every distinct behavior.
  • Remove equivalent duplicate routing/settings/tests while preserving different semantics; decide the transition or ongoing support contract for public legacy variables.
  • Measure ordinary metadata calls and forced updates without adding synchronous probes to every ordinary SQL statement.

Describe implementation you've considered

Define observable behavior and consumers within the existing statistics owner/API. Retire equivalent historical paths while retaining distinct product semantics and client compatibility. Avoid growing implementation-history controls with additional arbitrary switches.

Additional information

Existing investigation and validation limits

Source inspection of func_mo, variables, and mo_table_stats on both branches confirms public implementation selection and layered policy. Semantic equivalence of the two paths has not been established; this is not blanket authorization to delete the old implementation.

main investigation snapshot: pkg/sql/plan/function/func_mo.go:130; pkg/frontend/variables.go:4502; pkg/vm/engine/disttae/mo_table_stats.go:1500

4.2 baseline snapshot: pkg/sql/plan/function/func_mo.go; pkg/vm/engine/disttae/mo_table_stats.go:417

The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added theissue type on Nov 5, 2026
  3. changed the title [-][Subtask]: D18 [base] 以统计的新鲜度和成本定义接口,收敛 use_old_impl 及历史分流[/-] [+][Subtask]: D18 [baseline] Define statistics freshness and cost semantics instead of exposing implementation history[/+] on Nov 5, 2026
  4. MatrixAdventurer commented on Nov 6, 2026

    @MatrixAdventurer
    Contributor

    分级建议:severity/s-1——use_old_impl 旧实现开关残留的清理类子任务,无证据表明默认路径受影响。
    所属模块:执行层 use_old_impl 兼容路径(vector/batch 相关包)。
    疑似重复:未发现(仓库内无历史同主题 issue)。
    建议负责人:XuPeng-SH(父单 #32278 发起人、本子任务 assignee)。
    本操作由LW授权的MOI智能体提交

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions