当前位置:网站首页>Database - index
Database - index
2022-06-27 05:44:00 【zhixingheyi_ tian】
Create index
Indexes are created in existing tables , It makes the positioning of rows faster and more efficient . You can create indexes on one or more columns of a table , Each index will be named . The user cannot see the index , They can only be used to speed up queries .
notes : Updating a table with an index takes more time than updating a table without an index , This is because the index itself needs to be updated . therefore , It is ideal to create an index only on the columns that are often used for searching .
Unique index (Unique Index)
Create a unique index on the table . A unique index means that two rows cannot have the same index value .
CREATE UNIQUE INDEX The index name
ON The name of the table ( Column name )
“ Column name ” Specify the columns you want to index .
Indexes
Simple index
Create a simple index on the table . When we omit keywords UNIQUE when , You can use duplicate values .
CREATE INDEX The index name
ON The name of the table ( Column name )
“ Column name ” Specify the columns you want to index .
example
This example creates a simple index , be known as “PersonIndex”, stay Person Tabular LastName Field :
CREATE INDEX PersonIndex
ON Person (LastName)
If you want to index the values in a column in descending order , You can add a reserved word after the column name DESC:
CREATE INDEX PersonIndex
ON Person (LastName DESC)
If you want to index more than one column , You can list the names of these columns in parentheses , Separated by commas :
CREATE INDEX PersonIndex
ON Person (LastName, FirstName)
边栏推荐
猜你喜欢

Implementation of easyexcel's function of merging cells with the same content and dynamic title

leetcode299周赛记录

Asp. Net core6 websocket simple case

体验 win10 下 oceanbase 数据库
![[FPGA] design and implementation of frequency division and doubling based on FPGA](/img/84/75d473d3d8e670260ba16d06705c2f.png)
[FPGA] design and implementation of frequency division and doubling based on FPGA

EasyExcel合并相同内容单元格及动态标题功能的实现

Remapping (STM32)

Dual position relay dls-34a dc0.5a 220VDC

30个单片机常见问题及解决办法!

【FPGA】基于bt1120时序设计实现棋盘格横纵向灰阶图数据输出
随机推荐
什么是BFC?有什么用?
使用域名转发mqtt协议,避坑指南
IAR Systems全面支持芯驰科技9系列芯片
STM32关闭PWM输出时,让IO输出固定高或低电平的方法。
Codeforces Round #802 (Div. 2)
面试:Selenium 中有哪几种定位方式?你最常用的是哪一种?
QListWidget中的内容不显示
竣达技术丨多品牌精密空调集中监控方案
洛谷P2939 [USACO09FEB]Revamping Trails G 题解
leetcode-20. Valid parentheses -js version
How win 10 opens the environment variables window
Basic concepts of neo4j graph database
The most detailed download tutorial of MySQL
Two position relay hjws-9440
高翔slam14讲-笔记1
Implementation of easyexcel's function of merging cells with the same content and dynamic title
Cognition - how to fill in 2022 college entrance examination volunteers
Redis高可用集群(哨兵、集群)
【Cocos Creator 3.5.1】event.getButton()的使用
快速排序(非遞歸)和歸並排序