zoukankan      html  css  js  c++  java
  • 使用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聚合;

  • 相关阅读:
    MYSQL索引
    Objective-C:KVO
    iOS UIKit:viewController之动画(5)
    iOS UIKit:viewController之Segues (4)
    iOS UIKit:viewController之Present (3)
    iOS UIKit:viewController之定义(2)
    iOS UIKit:viewController之层次结构(1)
    iOS UIKit:view
    iOS UIKit:App
    Objective-C:Block
  • 原文地址:https://www.cnblogs.com/stono/p/8227545.html
Copyright © 2011-2022 走看看