当前位置:网站首页>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 .
边栏推荐
- Review the configuration of vscode to develop golang
- Cross platform plug-in flutter for displaying local notifications_ local_ notifications
- 5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
- First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
- The usage of micro service project swagger aggregation document shows all micro service addresses in the form of swagger grouping
- 1107 social clusters (30 points)
- 移动端——uniapp开发记录(公共请求request封装)
- 文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
- JDBC database operation
- Notes | numpy-07 Slice and index
猜你喜欢

Introduction to message queuing (MQ)

Source insight garbled code solution

Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
![[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa](/img/a9/92059db74ccde03b84c69dfce35b37.jpg)
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa

M1 Pro install redis

Review the old and know the new: Notes on Data Science

移动端——uniapp开发记录(公共请求request封装)

Compile and decompile GCC common instructions

Valentine's day limited withdrawal guide: for one in 200 million of you

MediaTek 2023 IC written examination approved in advance (topic)
随机推荐
LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
Shell script Basics - basic grammar knowledge
What is UUID
Oracle SQL table data loss
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
Problems encountered in fuzzy query of SQL statements
Apache MPM model and ab stress test
Wechat applet distance and map
论文阅读_清华ERNIE
Thesis reading_ Chinese medical model_ eHealth
leetcode406. Rebuild the queue based on height
Market status and development prospect prediction of global fermented plant protein industry in 2022
The process of browser accessing the website
论文阅读_中文医疗模型_ eHealth
2022-02-11 daily clock in: problem fine brush
Basic use of Metasploit penetration testing framework
联发科技2023届提前批IC笔试(题目)
Unity tool Luban learning notes 1
Learn to use the idea breakpoint debugging tool
The 19th Zhejiang I. barbecue