Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
taroface committed Aug 6, 2024
1 parent 9f7ba73 commit 9e22e6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/current/v24.2/cost-based-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ Two types of plans can be cached: custom and generic. Refer to [Query plan type]

The following types of plans can be cached:

- *Custom* query plans are generated for a given query structure and optimized for specific parameter values, and are re-optimized on subsequent executions. By default, the optimizer uses custom plans.
- {% include_cached new-in.html version="v24.2" %} *Generic* query plans are generated and optimized once without considering specific parameter values, and are **not** regenerated on subsequent executions, unless the plan becomes stale due to [schema changes]({% link {{ page.version.version }}/online-schema-changes.md %}) or new [table statistics](#table-statistics) and must be re-optimized. Once a generic plan is optimized for a given statement, the CPU utilization associated with query planning for all subsequent executions of that statement should be 0%.
- *Custom* query plans are generated for a given query structure and optimized for specific placeholder values, and are re-optimized on subsequent executions. By default, the optimizer uses custom plans.
- {% include_cached new-in.html version="v24.2" %} *Generic* query plans are generated and optimized once without considering specific placeholder values, and are **not** regenerated on subsequent executions, unless the plan becomes stale due to [schema changes]({% link {{ page.version.version }}/online-schema-changes.md %}) or new [table statistics](#table-statistics) and must be re-optimized. Once a generic plan is optimized for a given statement, the CPU utilization associated with query planning for all subsequent executions of that statement should be 0%.

{{site.data.alerts.callout_success}}
Generic query plans can reduce latency and CPU utilization for prepared statements whose parameters change frequently and for complex queries that are costly to optimize.
{{site.data.alerts.end}}

To change the type of plan that is cached, use the [`plan_cache_mode`]({% link {{ page.version.version }}/session-variables.md %}#plan-cache-mode) session setting. This setting applies when a statement is executed, not when it is prepared. Statements are therefore not associated with a specific query plan type upon creation.
To change the type of plan that is cached, use the [`plan_cache_mode`]({% link {{ page.version.version }}/session-variables.md %}#plan-cache-mode) session setting. This setting applies when a statement is executed, not when it is prepared. Statements are therefore not associated with a specific query plan type when they are prepared.

The following modes can be set:

Expand Down

0 comments on commit 9e22e6a

Please sign in to comment.