• 使用Merge存储引擎实现MySQL分表


    使用Merge存储引擎实现MySQL分表

    学习了:https://www.cnblogs.com/try-better-tomorrow/p/4987620.html

    https://www.cnblogs.com/xbq8080/p/6628034.html

    http://blog.csdn.net/java_bruce/article/details/71077985

    https://www.cnblogs.com/johnnyzhang/articles/2648669.html

    注意啊,使用Merge的时候,只能集合MyISAM性质的表;

    mysql> show enginesG
    
    *************************** 2. row ***************************
          Engine: MRG_MYISAM
         Support: YES
         Comment: Collection of identical MyISAM tables
    Transactions: NO
              XA: NO
      Savepoints: NO
    *************************** 3. row ***************************
          Engine: MyISAM
         Support: YES
         Comment: MyISAM storage engine
    Transactions: NO
              XA: NO
      Savepoints: NO

    使用show engines的时候可以看到,MRG_MYISAM就是为MyISAM准备的;

    创建脚本如下:

    CREATE TABLE t1 (
    	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    	message CHAR(20))ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    CREATE TABLE t2 (
    	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    	message CHAR(20))ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    CREATE TABLE total (
    	id INT NOT NULL AUTO_INCREMENT,
    	message CHAR(20), INDEX(id)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;

    就是说,用InnoDB引擎创建的表不能进行Merge聚合;

  • 相关阅读:
    1002. A+B for Polynomials
    1010. 一元多项式求导
    BZOJ3569
    BZOJ3224
    loj2291. 「THUSC 2016」补退选
    平衡树入门
    高斯消元入门
    写手vector
    矩阵乘法入门
    母函数入门
  • 原文地址:https://www.cnblogs.com/stono/p/8227545.html
Copyright © 2020-2023  润新知