当前位置:网站首页>Gbase8s unique index and non unique index
Gbase8s unique index and non unique index
2022-07-03 05:01:00 【The heart sea is ordinary】
Unique indexes are not allowed to have duplicate values in columns , It can be used to define and constrain the combined values of one or more columns in the table , In execution insert and update Statement needs to be checked for uniqueness .GBase8s Middle primary key (PRIMARY KEY) Will automatically create a unique index . A good table design should define a primary key or a unique constraint index . Especially in OLTP In the system , A unique index can help quickly locate a small number of records .
Syntax for creating unique indexes :
CREATE UNIQUE INDEX idx_name ON tabname(col);perhaps
CREATE DISTINCT INDEX idx_name ON tabname(col);Non unique index ( Repeatable index ) You can create , Allow duplicate data in columns . However, it is necessary to avoid creating indexes on data columns with duplicate subkeys , Because the index with more duplicate values , The lower its efficiency .
The example diagram of unique index and non unique index is as follows :

Be careful : Because of the need in insert、update Make uniqueness judgment when , Therefore, it is not recommended to create multiple unique indexes on a table . To ensure uniqueness requirements , Generally, it is enough to create a unique index in a table .
边栏推荐
- Symbol of array element product of leetcode simple problem
- 2022-02-12 daily clock in: problem fine brush
- Wechat applet distance and map
- 最大连续子段和(动态规划,递归,递推)
- 1099 build a binary search tree (30 points)
- Hire cashier (differential constraint)
- Review the old and know the new: Notes on Data Science
- Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
- MC Layer Target
- 1106 lowest price in supply chain (25 points)
猜你喜欢

Handling record of electric skateboard detained by traffic police

"Niuke brush Verilog" part II Verilog advanced challenge

On typescript and grammar

The programmer resigned and was sentenced to 10 months for deleting the code. JD came home and said that it took 30000 to restore the database. Netizen: This is really a revenge

Silent authorization login and registration of wechat applet

并发操作-内存交互操作

Kept hot standby and haproxy

MPM model and ab pressure test
![[set theory] relationship properties (symmetry | symmetry examples | symmetry related theorems | antisymmetry | antisymmetry examples | antisymmetry theorems)](/img/34/d195752992f8955bc2a41b4ce751db.jpg)
[set theory] relationship properties (symmetry | symmetry examples | symmetry related theorems | antisymmetry | antisymmetry examples | antisymmetry theorems)
![[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)](/img/af/8dfa783c87363a9d75c52e7680d508.jpg)
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)
随机推荐
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
Market status and development prospect forecast of global button dropper industry in 2022
Market status and development prospect prediction of the global autonomous hybrid underwater glider industry in 2022
Market status and development prospect prediction of the global fire hose industry in 2022
5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
JQ style, element operation, effect, filtering method and transformation, event object
Apache MPM model and ab stress test
【批处理DOS-CMD命令-汇总和小结】-CMD窗口的设置与操作命令-关闭cmd窗口、退出cmd环境(exit、exit /b、goto :eof)
Thesis reading_ Chinese medical model_ eHealth
Handler understands the record
Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
Market status and development prospect prediction of the near infrared sensor industry of the global Internet of things in 2022
Basic use of Metasploit penetration testing framework
112 stucked keyboard (20 points)
String matching: find a substring in a string
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
1119 pre- and post order traversals (30 points)
Huawei personally ended up developing 5g RF chips, breaking the monopoly of Japan and the United States
雇佣收银员(差分约束)