`
宋双旺
  • 浏览: 152779 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

FORCE INDEX/IGNORE INDEX

阅读更多

FORCE INDEX 通常用来对查询强制使用一个或者多个索引。 MySQL 通常会根据统计信息选择正确的索引,但是当查询优化器选择了错误的索引或者根本没有使用索引的时候,这个提示将非常有用。

 

IGNORE INDEX 提示会禁止查询优化器使用指定的索引。在具有多个索引的查询时,可以用来指定不需要优化器使用的那个索引,还可以在删除不必要的索引之前在查询中禁止使用该索引。

 

FORCE INDEX/IGNORE INDEX 的语法:

 

SELECT *** FROM TABLE [{USE|IGNORE|FORCE} INDEX (key_list)] WHERE ……

下面的例子是使用 IGNORE INDEX 以后,执行计划的变化情况,默认的执行计划是按照主键索引进行扫描,如果我们使用 IGNORE INDEX 忽略主键索引,则会按照全表扫描执行

分享到:
评论

相关推荐

    清楚github上的痕迹.txt

    git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch doc/硬件设计/GS03_MB_V3.0设计文件' --prune-empty --tag-name-filter cat -- --all git push origin master --force rm ...

    Sortable前端框架

    forceFallback: false, // ignore the HTML5 DnD behaviour and force the fallback to kick in fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback ...

    MYSQL中常用的强制性操作(例如强制索引)

    强制索引 FORCE INDEX 代码如下:SELECT * FROM TABLE1 FORCE INDEX (FIELD1) …以上的SQL语句只使用建立在FIELD1上的索引,而不使用其它字段上的索引。 忽略索引 IGNORE INDEX 代码如下:SELECT * FROM TABLE1 IGNORE...

    php.ini-development

    ;;;;;;;;... 1.... 2.... 3.... 4.... 5.... 6.... The syntax of the file is extremely simple.... Section headers (e.g.... at runtime.... There is no name validation.... (e.g.... previously set variable or directive (e.g....

    最全的oracle常用命令大全.txt

    SQL>select index_name,index_type,table_name from user_indexes order by table_name; 查看索引被索引的字段 SQL>select * from user_ind_columns where index_name=upper('&index_name'); 查看索引的大小 ...

    ap6212a0_a33_sc3817r_神舟验证版本_借用nvram_ap6210这个配置文件_20170626_1834没有外层目录.7z

    ro.hwa.force=false \ rw.logger=0 \ ro.sys.bootfast=true \ debug.hwc.showfps=0 \ debug.hwui.render_dirty_regions=false #ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \...

    ap6212a0_a33_sc3817r_服务器验证通过_bt已经通了_wifi需要修改配置_需要再次验证_20170626_1549.7z

    ro.hwa.force=false \ rw.logger=0 \ ro.sys.bootfast=true \ debug.hwc.showfps=0 \ debug.hwui.render_dirty_regions=false #ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \...

    rm rmvb 修复工具(RealMedia Analyzer)

    ‘,‘ 2 means mark only, 3 means suppress completely (default)‘,‘ n<n> = only fix n (1..32767) broken packets, default is all‘,‘ p<n> = force maximum packet size (intact packet criterion) to‘,‘ ...

    局域网渗透

    -b is to force define submask 强制指定子网掩码,对一些跨网段的欺骗有效 -m is define max transmit speed k/s 限制最大网络传输速度 k/s -f is set full spoof-route mode default is half 设置欺骗方式为...

    万能启动u盘制作工具 FbinstTool v1.6

    * Add option --chs for format command, which force the boot loader to use chs mode. This option is useful for buggy BIOS that can't detect lba/chs mode properly. * Add "format options" output for info...

    statique:使用 Gulp 启用 AJAX 静态博客生成器

    生产检查: 删除浏览器调试 ... git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch /posts /build /index.html -r' --prune-empty --tag-name-filter cat -- -- -全部

    提示:最常用的git提示和技巧

    每天二十步左右的Git git help everyday显示Git随附的有用指南git help -g按内容搜索更改git log -S ' <a> '显示特定文件随时间的变化git log -p 推送后从历史记录中删除敏感数据git filter-branch --force --index-...

    acpi控制笔记本风扇转速

    default) ignore all temporary namespace entries created during any concurrent control method execution. An additional namespace race condition is known to exist between AcpiWalkNamespace and the Load/...

    EurekaLog_7.5.0.0_Enterprise

    6)....Fixed: Exception filters ignore settings for restart/terminate EurekaLog 7.3 Hotfix 2 (7.3.2.0), 20-October-2015 1)....Fixed: Added workaround for codegen bug in Delphi 7 (possibly - other), ...

    Bochs - The cross platform IA-32 (x86) emulator

    - Make --ignore-bad-msrs runtime option in .bochsrc. Old --ignore-bad-msrs configure option is deprecated and should not be used anymore. - Enable changing part of CPU functionality at runtime ...

Global site tag (gtag.js) - Google Analytics