当前位置:网站首页>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
边栏推荐
- 聊聊Adapter模式
- Zero Trust: break the passive development mode of "attack and defense" and build a "moat" for enterprise safety
- 目前期货怎么开户安全些?哪些期货公司靠谱些?
- What should it personnel over 35 years old do if they are laid off by the company one day?
- [动态规划]最长回文子串-对于动态转移循环顺序的思考
- 2022-2028 global DC linear variable differential transformer (LVDT) industry survey and trend analysis report
- What do l and R of earphone mean?
- Use apiccloud AVM multi terminal component to quickly realize the search function in the app
- What is 5g? What can 5g do? What will 5g bring in the future?
- 你好,请问老师,在支付宝基金开户真的安全吗?
猜你喜欢

Use of local stack in flask

Obsidian basic tutorial

Exclusive interview with deepmindceo hassabis: we will see a new scientific Renaissance! AI's new achievements in nuclear fusion are officially announced today

Tiger DAO VC产品正式上线,Seektiger生态的有力补充

Canoe: the fifth simulation project: simulation + test

Privatization lightweight continuous integration deployment scheme -- 03 deployment of Web services (Part 2)

简单好用的缓存库 gcache

Summary of basic knowledge of neural network

NRM source switching tool

哪些PHP开源作品值得关注
随机推荐
哪些PHP开源作品值得关注
China bed and mattress market status research analysis and development prospect forecast report (2022)
圖解棧幀運行過程
Dio encapsulé pour les requêtes réseau flutter (gestion des cookies, ajout d'intercepteurs, téléchargement de fichiers, gestion des exceptions, annulation des requêtes, etc.)
oracle -- 表操作
Use of local stack in flask
How to use the find command
How to guarantee idempotency of message queue
Analysis of gpl3.0 license software copyright dispute cases
Evaluate the generalization performance of models and build integrated models using out of pocket prediction (oof)
Talk about adapter mode
Research and Analysis on the current situation of China's magnetic detector Market and forecast report on its development prospect (2022)
Global and Chinese oleic acid operation mode and market supply and demand forecast report 2022 ~ 2028
Hotspot JVM "01" class loading, linking and initialization
2022-2028 global transmission type photoelectric circuit breaker industry research and trend analysis report
Analysis report on demand and investment forecast of global and Chinese flame retardant hydraulic oil market from 2022 to 2028
腾讯《和平精英》新版本将至:新增账号安全保护系统,游戏内违规行为检测升级
聊聊Adapter模式
Zero Trust: break the passive development mode of "attack and defense" and build a "moat" for enterprise safety
Does jQuery cache any selectors- Does jQuery do any kind of caching of “selectors”?