Mycat Action Notes

Source: Internet
Author: User
Tags db2
MYCAT+MYSQL+JDBC implementation based on cell phone number tail storage and efficiency comparison Key WordsCell phone Number Segmentation Mycat horizontal sub-table large data test Environmentjdk1.7+mysql5.5+mycat1.5+myeclise10.7 Building a table to build a librarySet up four database a group: DB1, DB2, DB3;B Group: DB; The first three databases that belong to the Mycat operation, DB belong to different databases for. The user table is created in the above database, including ID, name, password, phone, post (cell phone tail); DemandInsert 20 data, according to mobile phone tail, tail 0, 1, 2 deposit to Db1;3, 4, 5 deposit to DB2, other deposit to db3; DB deposits all cell phone numbers. Insert 20 data, the result requirements: 1: Comparison of Group A and Group B insertion time efficiency. In Group A and group B, insert 100w data to compare efficiency. Query the intermediate data according to the partition field, compare query efficiency. Do not check according to the partition field: Query intermediate data, compare query efficiency. Check for efficiency based on the partition field and not the partition field. SQL

Sql

SET foreign_key_checks=0;

------------------------------
--table structure for ' user '
------------------------------
DROP table IF EXISTS ' user ';
CREATE TABLE ' user ' (
  ' id ' varchar (255) NOT NULL,
  ' name ' varchar (255) DEFAULT NULL,
  ' password ' varchar (255) D Efault null,
  ' phone ' varchar (255) default NULL,
  ' post ' varchar (255) default NULL,
  PRIMARY KEY (' id '),
  KEY ' id ' (' id ')
Engine=innodb DEFAULT Charset=utf8;

------------------------------
--Records of user
------------------------------
Test ResultsPartition succeeded; 20 data: Group A: Total time: 826ms;b Group: total length: 556ms;
Insert 20w Time: Group A: total length: 1231524ms; Group B: Direct crash, error reason: Message:no buffer space available (maximum connections reached?): Connect Insert 2w Time: A group: Total length: Total time: 116931ms; Group B: Total length: 105410ms

2w Data Query Intermediate data: Group A: Total time: 273ms;b Group: Total time: 258ms[Note: The query is based on the ID query, the partition field is post]

2w Data Query Intermediate data: Group A: Total time: Total length: 269;b Group: Total time: 503ms[Note: The query is based on the post query, the partition field is post]

2w Data Query Intermediate data: Group A: total length: 264ms; Group B: Total length: 280ms[Note: The query is based on post and mobile number query, the partition field is post] operation code "tested successfully"

http://download.csdn.net/detail/wgyscsf/9620006

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.