From 8babfe9c3cf35eb75e3973c4a48432516ca0dd18 Mon Sep 17 00:00:00 2001 From: doc-claw-bot Date: Fri, 17 Jul 2026 09:42:02 +0000 Subject: [PATCH 1/4] docs: clarify HYPO_INDEX scope in index advisor --- index-advisor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index-advisor.md b/index-advisor.md index 1fa59221c1332..68e53d0f1de41 100644 --- a/index-advisor.md +++ b/index-advisor.md @@ -192,13 +192,13 @@ WHERE last_access_time IS NOT NULL AND percentage_access_0 + percentage_access_0 ## Hypothetical indexes -Hypothetical indexes (Hypo Indexes) are created using SQL comments, similar to [query hints](/optimizer-hints.md), rather than through the `CREATE INDEX` statement. This approach enables lightweight experimentation with indexes without the overhead of physically materializing them. +Hypothetical indexes (Hypo Indexes) use the same `/*+ ... */` comment syntax as [optimizer hints](/optimizer-hints.md), rather than the `CREATE INDEX` statement. The `HYPO_INDEX` hint is dedicated to hypothetical indexes and currently takes effect only in `EXPLAIN` statements. This approach enables lightweight experimentation with indexes without the overhead of physically materializing them. For example, the `/*+ HYPO_INDEX(t, idx_ab, a, b) */` comment instructs the query planner to create a hypothetical index named `idx_ab` on table `t` for columns `a` and `b`. The planner generates the index's metadata but does not physically materialize it. If applicable, the planner considers this hypothetical index during query optimization without incurring the costs associated with index creation. The `RECOMMEND INDEX` advisor uses hypothetical indexes for "What-If" analysis to evaluate potential benefits of different indexes. You can also use hypothetical indexes directly to experiment with index designs before proceeding to create them. -The following example shows a query using a hypothetical index: +The following example shows an `EXPLAIN` statement using a hypothetical index: ```sql CREATE TABLE t(a INT, b INT, c INT); From 7432f759e452294c2ec2f0c08d171c91998ace03 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 20 Jul 2026 11:33:31 +0800 Subject: [PATCH 2/4] make it clear that HYPO_INDEX is a SQL comment --- index-advisor.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index-advisor.md b/index-advisor.md index 68e53d0f1de41..058ff3fc4df59 100644 --- a/index-advisor.md +++ b/index-advisor.md @@ -192,7 +192,13 @@ WHERE last_access_time IS NOT NULL AND percentage_access_0 + percentage_access_0 ## Hypothetical indexes -Hypothetical indexes (Hypo Indexes) use the same `/*+ ... */` comment syntax as [optimizer hints](/optimizer-hints.md), rather than the `CREATE INDEX` statement. The `HYPO_INDEX` hint is dedicated to hypothetical indexes and currently takes effect only in `EXPLAIN` statements. This approach enables lightweight experimentation with indexes without the overhead of physically materializing them. +In an `EXPLAIN` statement, you can use the `/*+ HYPO_INDEX(...) */` SQL comment syntax to define a hypothetical index for the query planner to consider. This approach enables the Index Advisor to evaluate how the specified index would affect query plans and their estimated costs without physically creating the index. + +> **Note:** + +> + +> The `/*+ HYPO_INDEX(...) */` comment is dedicated to hypothetical indexes and currently takes effect only in `EXPLAIN` statements. For example, the `/*+ HYPO_INDEX(t, idx_ab, a, b) */` comment instructs the query planner to create a hypothetical index named `idx_ab` on table `t` for columns `a` and `b`. The planner generates the index's metadata but does not physically materialize it. If applicable, the planner considers this hypothetical index during query optimization without incurring the costs associated with index creation. From c0f3a6b04c265a5698fca85f6480a8dffcff6ff5 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 20 Jul 2026 11:36:00 +0800 Subject: [PATCH 3/4] Update index-advisor.md --- index-advisor.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/index-advisor.md b/index-advisor.md index 058ff3fc4df59..7110186afe21f 100644 --- a/index-advisor.md +++ b/index-advisor.md @@ -194,12 +194,6 @@ WHERE last_access_time IS NOT NULL AND percentage_access_0 + percentage_access_0 In an `EXPLAIN` statement, you can use the `/*+ HYPO_INDEX(...) */` SQL comment syntax to define a hypothetical index for the query planner to consider. This approach enables the Index Advisor to evaluate how the specified index would affect query plans and their estimated costs without physically creating the index. -> **Note:** - -> - -> The `/*+ HYPO_INDEX(...) */` comment is dedicated to hypothetical indexes and currently takes effect only in `EXPLAIN` statements. - For example, the `/*+ HYPO_INDEX(t, idx_ab, a, b) */` comment instructs the query planner to create a hypothetical index named `idx_ab` on table `t` for columns `a` and `b`. The planner generates the index's metadata but does not physically materialize it. If applicable, the planner considers this hypothetical index during query optimization without incurring the costs associated with index creation. The `RECOMMEND INDEX` advisor uses hypothetical indexes for "What-If" analysis to evaluate potential benefits of different indexes. You can also use hypothetical indexes directly to experiment with index designs before proceeding to create them. From 3576f25bc6821d94826a1435d5e2fa1b68664b90 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 20 Jul 2026 11:37:52 +0800 Subject: [PATCH 4/4] Update index-advisor.md --- index-advisor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index-advisor.md b/index-advisor.md index 7110186afe21f..8599feb32d15a 100644 --- a/index-advisor.md +++ b/index-advisor.md @@ -192,7 +192,7 @@ WHERE last_access_time IS NOT NULL AND percentage_access_0 + percentage_access_0 ## Hypothetical indexes -In an `EXPLAIN` statement, you can use the `/*+ HYPO_INDEX(...) */` SQL comment syntax to define a hypothetical index for the query planner to consider. This approach enables the Index Advisor to evaluate how the specified index would affect query plans and their estimated costs without physically creating the index. +In an `EXPLAIN` statement, you can use the `/*+ HYPO_INDEX(...) */` SQL comment syntax to define a hypothetical index for the query planner to consider. This approach enables lightweight experimentation with indexes without the overhead of physically materializing them. For example, the `/*+ HYPO_INDEX(t, idx_ab, a, b) */` comment instructs the query planner to create a hypothetical index named `idx_ab` on table `t` for columns `a` and `b`. The planner generates the index's metadata but does not physically materialize it. If applicable, the planner considers this hypothetical index during query optimization without incurring the costs associated with index creation.