当前位置:网站首页>Mysql database index
Mysql database index
2022-06-25 22:54:00 【Forestᝰ】
Index Syntax
Look at the index showindexfrom Table name ; Index creation method 1 : Create index when creating table createtablecreate_index(idintprimarykey,namevarchar(10)unique,ageint,key(age)); Mode two : For existing tables , Add an index if the specified field is a string , You need to specify the length , It is recommended that the length be consistent with the length of the field when it is defined. If the field type is not a string , You can leave out the length section createindex The index name on Table name ( Field name ( length )) example :createindexage_indexoncreate_index(age);createindexname_indexoncreate_index(name(10)); Delete index :dropindex The index name on Table name ;3. The disadvantage of indexing is that although indexing greatly improves the query speed , At the same time, it will reduce the speed of updating the table , Such as on the table INSERT、UPDATE and DELETE, Because when updating tables ,MySQL Not only to save data , Also save the index file, but , In Internet applications , The query statement is much larger than the addition, deletion and modification statement , It can even occupy 80%~90%, So don't care too much , Only when importing big data , You can delete the index first , Then insert data in batch , Finally, add the index
边栏推荐
- Application runtime layotto enters CNCF cloud native panorama
- NRM source switching tool
- Flutter 网络请求封装之Dio(Cookie管理、添加拦截器、下载文件、异常处理、取消请求等)
- Research and Analysis on the status quo of China's Cross lamp market and forecast report on its development prospect (2022)
- 2022-2028 global horizontal reciprocating compressor industry research and trend analysis report
- 2022-2028 global industrial touch screen industry research and trend analysis report
- Pycharm 2022.1 EAP 2 release
- How do I project points on a 3D plane- How to project a point onto a plane in 3D?
- Another breakthrough! Alibaba cloud enters the Gartner cloud AI developer service Challenger quadrant
- Data annotation in the second half: growth flywheel under PLG mode Manfu Technology
猜你喜欢

Nacos 源码分析01 代码结构

再突破!阿里云进入Gartner云AI开发者服务挑战者象限

Beyond natural motion: exploring the discontinuity of video interpolation

2022-2028 global web and browser isolation platform industry research and trend analysis report

2022-2028 global cloud based remote browser isolation industry research and trend analysis report

2022-2028 global industrial touch screen industry research and trend analysis report

民航局:到 2025 年我国将初步建成安全、智慧、高效和绿色的航空物流体系

2022-2028 global iridium electrode industry research and trend analysis report

Huasheng lithium battery IPO meeting: 9-month revenue of 690million; shenjinliang's family relationship is complex

Obsidian basic tutorial
随机推荐
Unity技术手册 - 粒子基础主模块属性-上
A3.ansible production practice case -- system initialization roles
圖解棧幀運行過程
Interview shock 23: talk about thread life cycle and transformation process?
实战:typora里面如何快捷改变字体颜色(博客分享-完美)-2022.6.25(已解决)
How to use the find command
Pycharm 2022.1 EAP 2 release
剖析虚幻渲染体系(16)- 图形驱动的秘密
民航局:到 2025 年我国将初步建成安全、智慧、高效和绿色的航空物流体系
Another breakthrough! Alibaba cloud enters the Gartner cloud AI developer service Challenger quadrant
Tlog helps Pangu framework realize microservice link log tracking
Raspberry PI (bullseye) replacement method of Alibaba cloud source
Programmer weekly (issue 4): the wealth view of programmers
Unity技术手册 - 粒子发射和生命周期内速度子模块
Thinking while walking
Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-及外力
How do I project points on a 3D plane- How to project a point onto a plane in 3D?
Flutter 網絡請求封裝之Dio(Cookie管理、添加攔截器、下載文件、异常處理、取消請求等)
Analysis report on market demand situation and investment direction of China's optical transmission equipment industry from 2022 to 2028
Why absolute positioning overlaps