From 170630a5f993e70ee9068676066bac57f8f1b9de Mon Sep 17 00:00:00 2001 From: Wenqi Mou Date: Mon, 25 Aug 2025 16:46:59 -0400 Subject: [PATCH] planner: add group ndv risk variables Signed-off-by: Wenqi Mou --- system-variables.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/system-variables.md b/system-variables.md index 379190e5b9c95..efb1b48f27a30 100644 --- a/system-variables.md +++ b/system-variables.md @@ -4861,6 +4861,19 @@ SHOW WARNINGS; +### tidb_opt_group_ndv_skew_ratio New in v9.0.0 + +> **Warning:** +> +> The TiDB query optimizer uses this variable. Do not adjust this variable without guidance from TiDB support or engineering. + +- Scope: SESSION | GLOBAL +- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes +- Type: Float +- Range: `[0, 1]` +- Default value: `0` +- This variable controls the ratio between naive estimation and exponential backoff estimation for group NDV (Number of Distinct Values). When set to `0`, it uses naive estimation. When set to `1`, it uses exponential backoff estimation. Values between `0` and `1` provide a weighted combination of both estimation methods. + ### tidb_opt_scan_factor - Scope: SESSION | GLOBAL