以此表为例
CREATE TABLE `single_table` ( `id` int NOT NULL AUTO_INCREMENT, `key1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `key2` int NULL DEFAULT NULL, `key3` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `key_part1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `key_part2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `key_part3` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, `common_field` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, INDEX `idx_key1`(`key1`) USING BTREE, UNIQUE INDEX `idx_key2`(`key2`) USING BTREE, INDEX `idx_key3`(`key3`) USING BTREE, INDEX `idx_p1_p2_p3`(`key_part1`, `key_part2`, `key_part3`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
const
select * from single_table where id = 143
上面这条SQL语句会直接利用主键值在聚簇索引中定位对应的用户记录
标签:ci,SET,utf8mb4,ai,CHARACTER,访问,单表,MySQL,NULL From: https://www.cnblogs.com/wry979/p/17444537.html