亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

MYSQL creates a unique index on the primary key
學(xué)習(xí)ing
學(xué)習(xí)ing 2017-06-30 09:55:11
0
3
1215

I just came to work in this company. I checked their database and found that they actually created a unique index on the primary key. What is going on? Is it a clever way of writing or a very rubbish way of writing? I feel very sad. baffling?

I looked at it and found that many watches are like this

CREATE TABLE `tbl_nvhl_order` (
  `UUID` varchar(32) NOT NULL COMMENT '訂單號(hào)。',
  `CHANNEL_ORDER_ID` varchar(50) DEFAULT '' COMMENT '渠道訂單號(hào)',
  
   ...

  `ISGROUP` varchar(10) DEFAULT NULL COMMENT '團(tuán)單標(biāo)識(shí)',
  PRIMARY KEY (`UUID`),
  UNIQUE KEY `PK_TBL_NVHL_ORDER` (`UUID`) USING BTREE,
  KEY `index_name` (`CHANNEL_ORDER_ID`,`SOURCE`) USING BTREE,
  KEY `idx_creator` (`CREATOR`) USING BTREE,
  KEY `productcode` (`PRODUCTCODE`),
  KEY `index_app_id` (`APP_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=''

in

PRIMARY KEY (`UUID`),
UNIQUE KEY `PK_TBL_NVHL_ORDER` (`UUID`) USING BTREE,

Seek the guidance of the great God!

學(xué)習(xí)ing
學(xué)習(xí)ing

reply all(3)
過去多啦不再A夢(mèng)

It’s definitely the latter.

High-performance mysql specifically points out this situation, which is a duplicate index. When performing an update operation, two indexes need to be maintained, which increases the performance overhead.

過去多啦不再A夢(mèng)

It must be redundant, and using uuid as the primary key is also a pitfall. This is self-developed, right?

伊謝爾倫

It’s not very good. It’s best not to use this method if you can.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template