当前位置:网站首页>When will the index fail
When will the index fail
2022-06-12 19:50:00 【WD Technology】
1、 If there is... In the condition or, Even if there is a conditional index, it will not be used ( That's why we try to use as little or Why )
Be careful : Want to use or, And want the index to work , Can only be or Each column in the condition is indexed
2、 For multi-column indexes , Not the first part of use , Index will not be used
3、like The query is based on % start 
4、 If the column type is string , Be sure to quote the data in the condition , Otherwise, the index is not used 
5、 Column to column contrast
In some table , Two columns a,b Are individually indexed , The following query conditions will not be indexed
select * from test where a = b
6、 There are calculations on the index column
select * from test where upper(name)='SUNYANG';
This is not going to be indexed , Because the query criteria are indexed
When the query condition does not have an index , You can still use the index
select * from test where name=upper('sunyang');
--INDEX RANGE SCAN
7、 Predicate operations
select * from table where id/2 = type_id
8、 Index can be used for range lookup , But behind the scope Condition will invalidate the index
边栏推荐
- New product launch
- Demand and business model innovation - demand 1 - Introduction to demand engineering
- The joint empowerment plan of Baidu PaddlePaddle large enterprise open innovation center was launched! Help Pudong to upgrade its industry intelligently
- Original publishing practice of pipeline in Jenkins docking with CMDB interface to obtain host list
- Are you confused about choosing a low code platform? Follow these three steps
- EASYCODE one click plug-in custom template
- What is a hash index?
- system()
- Details of thansmitablethreadlocal
- Simple understanding of anti shake function
猜你喜欢

Understand Jack Dorsey's web5 from the ppt on page 16

Reading applet based on wechat e-book graduation design (2) applet function

User and group permissions

system()

今晚7:00 | PhD Debate 自监督学习在推荐系统中的应用

基于微信电子书阅读小程序毕业设计毕设作品(5)任务书

Promise to solve hell function calls can be used infinitely

Wechat e-book reading applet graduation design completion works (8) graduation design thesis template

system()

Negative remainder problem
随机推荐
在 Traefik Proxy 2.5 中使用/开发私有插件(Traefik 官方博客)
The component style set by uniapp takes effect in H5 and app, but does not take effect in wechat applet. The problem is solved
用户权限和组权限
【GAMES101】课堂笔记8–着色(着色频率、图形管线、纹理映射)
Compilation of programs
Leetcode topic [string]-344- reverse string
Typescript decorator is basically used
PostgreSQL数据库复制——后台一等公民进程WalReceiver pg_stat_wal_receiver视图
What is a hash index?
负数取余问题
API call display, detailed API of Taobao, tmall and pinduoduo commodity pages, and return of APP side original data parameters
Details of thansmitablethreadlocal
Microsoft Word tutorial, how to insert a header or footer in word?
exec函数、shell的实现
编程工具下载地址
Equipment management - borrowing / returning module interface code
MySQL index classification
Macro definitions and functions
Understand Jack Dorsey's web5 from the ppt on page 16
新来的同事问我 where 1=1 是什么意思???