From a6d97f6553cf157a8b6697f07bfda57a21b281e9 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 615b9d301f419..be4b1d61b7f50 100644 --- a/sql-statements/sql-statement-explain.md +++ b/sql-statements/sql-statement-explain.md @@ -201,6 +201,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 e04289f82dbcd3585f8df677f95480ec43308693 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 be4b1d61b7f50..f67c61ef966f3 100644 --- a/sql-statements/sql-statement-explain.md +++ b/sql-statements/sql-statement-explain.md @@ -201,8 +201,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. |