zoukankan      html  css  js  c++  java
  • mysql添加删除索引

    mysql> show create table table_test;
    +---------------------------------------+---------------------------+
    | Table | Create Table |
    +---------------------------------------+---------------------------+
    | table_test | CREATE TABLE `table_test` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '涓婚敭',
    `activity_id` varchar(20) NOT NULL COMMENT '娲诲姩ID',
    `store_code` varchar(100) NOT NULL COMMENT '娲诲姩鍚嶇О',
    `generation_date` date DEFAULT NULL COMMENT '鐢熸垚鏃ユ湡,鏍煎紡锛歽yyy-MM-dd',
    `ordercon_num` bigint(20) DEFAULT '0' COMMENT '璁㈠崟杞�寲浜烘暟',
    `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '鍒涘缓鏃堕棿',
    `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '鏇存柊鏃堕棿',
    `delete_flag` varchar(1) DEFAULT '1' COMMENT '鐘舵€?1-鍚�敤锛?-鍒犻櫎',
    PRIMARY KEY (`id`),
    UNIQUE KEY `uk_activityid_date` (`activity_id`,`generation_date`) USING BTREE,
    KEY `idx_storecode` (`store_code`) USING BTREE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='搴楅摵缁村害澶╄〃' |
    +---------------------------------------+---------------------------
    乱码正好算加密了~

    删除联合主键索引:

    ALTER TABLE table_test DROP INDEX `uk_activityid_date`;

    添加索引:

    ALTER TABLE table_test ADD INDEX `idx_activityid` (`activity_id`) USING BTREE;
  • 相关阅读:
    HTTP协议
    网络编程笔记
    基于udp协议实现QQ:可以并发一对多
    基于udp协议通信:实现了并发
    基于tcp协议通信,运用socketserver模块实现并发
    @PathVariable 与@RequestParam
    IDEA 中的一些概念变化
    Bubble Cup 11
    ACM超时问题
    D
  • 原文地址:https://www.cnblogs.com/yoyotl/p/13212999.html
Copyright © 2011-2022 走看看