当前位置:网站首页>Three ways of creating indexes in MySQL
Three ways of creating indexes in MySQL
2022-07-29 01:27:00 【m0_ sixty-seven million three hundred and ninety-three thousand】
1、 Use CREATE INDEX establish , The grammar is as follows :
CREATEINDEXindexNameONtableName(columnName(length));
2、 Use ALTER Sentence creation , The grammar is as follows :
ALTERTABLEtableNameADDINDEXindexName(columnName);
ALTER Statement to create an index , The following provides an example of setting the index length :
ALTERTABLEt_user_action_logADDINDEXip_address_idx(ip_address(16));
SHOWINDEXFROMt_user_action_log;
3、 Create an index when creating a table
CREATETABLEtableName(
idINTNOTNULL,
columnNamecolumnType,
INDEX[indexName](columnName(length))
);
Example :
边栏推荐
- Seven SQL performance optimizations that spark 3.0 must know
- 一文让你搞懂MYSQL底层原理。-内部结构、索引、锁、集群
- Main causes of IT hardware failures and best practices for prevention
- RHCE command practice (I)
- Common functions and usage of numpy
- 可视化全链路日志追踪
- uniapp createSelectorQuery().select 获取返回null报错
- DVWA之SQL注入
- PLATO上线LAAS协议Elephant Swap,用户可借此获得溢价收益
- mysql 创建索引的三种方式
猜你喜欢
How to implement the time impact analysis of the construction project?
时间复杂度、空间复杂度的学习总结
Recommended Spanish translation of Beijing passport
跨模态对齐 20220728
Flash reports an error: type object 'news' has no attribute' query 'the view name is duplicate with the model name
Canal实时解析mysql binlog数据实战
教你一文解决 js 数字精度丢失问题
Flink Postgres CDC
Summary of process and thread knowledge points 1
Cookies and sessions
随机推荐
[ManageEngine] what is the LAN monitoring software and what is its function
TextKit 自定义UILabel识别链接
C language bracket matching (stack bracket matching C language)
Redis installation, cluster deployment and common tuning
Flash reports an error: type object 'news' has no attribute' query 'the view name is duplicate with the model name
Letax record \documentclass{}, authoryear attribute is used
20220728-不纯为数字的字符串排序
Teach you a text to solve the problem of JS digital accuracy loss
量化交易之数字货币篇 - 生成foot print因子数据
正则校验与时间格式化
Flink SQL Hudi 实战
Error reporting: SQL syntax error in flask. Fields in SQL statements need quotation marks when formatting
Y80. Chapter 4 Prometheus big factory monitoring system and practice -- Kube state metrics component introduction and monitoring extension (XI)
[ManageEngine] help Harbin Engineering University realize integrated monitoring and management of network traffic
Django reports an error using pymsql module django.db.utils.operationalerror
Naver three party login
RHCE command practice (II)
J9数字论:什么因素决定NFT的价值?
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
Bracket matching test