Controlling Switchable Optimizations
来源:互联网 发布:windows界面 编辑:程序博客网 时间:2024/06/14 06:22
The optimizer_switch
system variable enables control over optimizer behavior. Its value is a set of flags, each of which has a value ofon
or off
to indicate whether the corresponding optimizer behavior is enabled or disabled. This variable has global and session values and can be changed at runtime. The global default can be set at server startup.
To see the current set of optimizer flags, select the variable value:
mysql> SELECT @@optimizer_switch\G
*************************** 1. row ***************************@@optimizer_switch: index_merge=on,index_merge_union=on, index_merge_sort_union=on, index_merge_intersection=on
To change the value of optimizer_switch
, assign a value consisting of a comma-separated list of one or more commands:
SET [GLOBAL|SESSION] optimizer_switch='command
[,command
]...';
Each command
value should have one of the forms shown in the following table.
default
Reset every optimization to its default valueopt_name
=default
Set the named optimization to its default valueopt_name
=off
Disable the named optimizationopt_name
=on
Enable the named optimizationThe order of the commands in the value does not matter, although thedefault
command is executed first if present. Setting anopt_name
flag to default
sets it to whichever of on
or off
is its default value. Specifying any given opt_name
more than once in the value is not permitted and causes an error. Any errors in the value cause the assignment to fail with an error, leaving the value of optimizer_switch
unchanged.
The following table lists the permissibleopt_name
flag names.
index_merge
Controls all Index Merge optimizationsindex_merge_intersection
Controls the Index Merge Intersection Access optimizationindex_merge_sort_union
Controls the Index Merge Sort-Union Access optimizationindex_merge_union
Controls the Index Merge Union Access optimizationFor information about Index Merge, seeSection 8.3.1.4, “Index Merge Optimization”.
When you assign a value to optimizer_switch
, flags that are not mentioned keep their current values. This makes it possible to enable or disable specific optimizer behaviors in a single statement without affecting other behaviors. The statement does not depend on what other optimizer flags exist and what their values are. Suppose that all Index Merge optimizations are enabled:
mysql> SELECT @@optimizer_switch\G
*************************** 1. row ***************************@@optimizer_switch: index_merge=on,index_merge_union=on, index_merge_sort_union=on, index_merge_intersection=on
If the server is using the Index Merge Union or Index Merge Sort-Union access methods for certain queries and you want to check whether the optimizer will perform better without them, set the variable value like this:
mysql> SET optimizer_switch='index_merge_union=off,index_merge_sort_union=off';
mysql> SELECT @@optimizer_switch\G
*************************** 1. row ***************************@@optimizer_switch: index_merge=on,index_merge_union=off, index_merge_sort_union=off, index_merge_intersection=on
- Controlling Switchable Optimizations
- switchable插件
- Direct3D Performance Optimizations
- Handling IRPs 10: Optimizations
- Easy UITableView optimizations
- Performance Optimizations (Direct3D 9)
- LLVM+WCET optimizations
- Optimizations On Mobile[Unity]
- Controlling Companies
- Controlling Execution
- Controlling Area
- Controlling serialization
- Controlling Companies
- Controlling Execution
- Controlling Companies
- controlling nginx
- Switchable Deep Network for Pedestrian Detection(泛读)
- [4_1_fence8] Search problem: Optimizations
- SVN的安装笔记和要注意的问题
- mysql 5中遭遇data too long问题
- sql 2005学习笔记1
- SCA学习之2--SCA中使用SPRING笔记
- 剖析用户权限系统的URL整合方法
- Controlling Switchable Optimizations
- 数据调优好的文章收集1
- 策略模式笔记
- (转)遭遇PHP has encountered an Access Violation
- TOMCAT 5的一些优化笔记
- asp.net 2.0中显示主从关系另一个方法
- asp.net 2.0常见问题技巧1
- asp.net 2.0 技巧2
- (转)SQL Server高可用性部署实施