From a28770bb8d268aa1a71a4bc28bbae3d510a593e5 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 13 Oct 2025 11:47:26 +0200 Subject: [PATCH 1/2] Added EXPLAIN FORMAT="cost_trace" --- sql-statements/sql-statement-explain.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql-statements/sql-statement-explain.md b/sql-statements/sql-statement-explain.md index 2c2f4ef77b9d3..3ccaca9ee2c9d 100644 --- a/sql-statements/sql-statement-explain.md +++ b/sql-statements/sql-statement-explain.md @@ -202,6 +202,8 @@ To specify the format of the `EXPLAIN` output, you can use the `FORMAT = xxx` sy | `tidb_json` | The `EXPLAIN` statement outputs execution plans in JSON and stores the operator information in a JSON array. | | `verbose` | The `EXPLAIN` statement outputs results in the `row` format, with an additional `estCost` column for the estimated cost of the query in the results. For more information about how to use this format, see [SQL Plan Management](/sql-plan-management.md). | | `plan_cache` | The `EXPLAIN` statement outputs results in the `row` format, with the [Plan Cache](/sql-non-prepared-plan-cache.md#diagnostics) information as a warning. | +| `cost_trace` | The `EXPLAIN` statement outputs results in an extended `row` format, with two additional columns, `estCost` for estimated cost, and `costFormula` column for the cost formula. | + From 6d854d528628107a9af6f39a592bd6556c86f52c Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 14 Oct 2025 16:01:05 +0800 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Daniƫl van Eeden --- sql-statements/sql-statement-explain.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-explain.md b/sql-statements/sql-statement-explain.md index 3ccaca9ee2c9d..a2ee90a567982 100644 --- a/sql-statements/sql-statement-explain.md +++ b/sql-statements/sql-statement-explain.md @@ -202,8 +202,7 @@ To specify the format of the `EXPLAIN` output, you can use the `FORMAT = xxx` sy | `tidb_json` | The `EXPLAIN` statement outputs execution plans in JSON and stores the operator information in a JSON array. | | `verbose` | The `EXPLAIN` statement outputs results in the `row` format, with an additional `estCost` column for the estimated cost of the query in the results. For more information about how to use this format, see [SQL Plan Management](/sql-plan-management.md). | | `plan_cache` | The `EXPLAIN` statement outputs results in the `row` format, with the [Plan Cache](/sql-non-prepared-plan-cache.md#diagnostics) information as a warning. | -| `cost_trace` | The `EXPLAIN` statement outputs results in an extended `row` format, with two additional columns, `estCost` for estimated cost, and `costFormula` column for the cost formula. | - +| `cost_trace` | The `EXPLAIN` statement outputs results in an extended `row` format, with two additional columns: `estCost` for the estimated cost and `costFormula` for the cost formula. |