zoukankan      html  css  js  c++  java
  • mysql自带分区(不修改源码)

    SELECT PARTITION_NAME,TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'xw_user_applyloan_baoxian';
     
    SELECT count(id) as sum ,FROM_UNIXTIME(time, '%Y-%m') as date FROM `xw_user_applyloan_baoxian` GROUP BY date ORDER BY date desc ;
     
    //时间戳
    alter table xw_user_applyloan_baoxian algorithm=inplace, lock=none, drop primary key, add primary key (id, time);
    alter table xw_user_applyloan_baoxian partition by range columns (time) (
        partition p1711 values less than (1512057599),
        partition p1712 values less than (1514735999),
        partition p0 values less than maxvalue
    );
     
    //字符串
    alter table xw_user_applyloan_baoxian algorithm=inplace, lock=none, drop primary key, add primary key (id, time);
    alter table xw_user_applyloan_baoxian partition by range columns (UNIX_TIMESTAMP(time)) (
        partition p1711 values less than (UNIX_TIMESTAMP('2007-11-30 23:59:59')),
        partition p1712 values less than (UNIX_TIMESTAMP('2007-12-31 23:59:59')),
        partition p0 values less than maxvalue
    );
  • 相关阅读:
    Spring学习记录-源码构建
    Spring学习记录
    java相关技术提纲
    Seata 分布式事务框架
    SourceTree学习记录
    其他源码管理工具
    分布式事务
    Score (模拟题)
    大整数排序
    字符串的查找删除 时间限制:1 Seconds 内存限制:32 Mbyte
  • 原文地址:https://www.cnblogs.com/dawuge/p/13151199.html
Copyright © 2011-2022 走看看