Introduction of Pt-fifo-split Usage of the PT tool of MySQL

Source: Internet
Author: User
Tags split


In the work used to also more, in the load data large file, if the file too assembly lead to the problem of master-slave delay, it must be split into many small files, the use of this tool does not require manual cutting files.

This tool works only on Unix-like operating systems. Specific can be viewed: http://www.mysqlperformanceblog.com/2008/07/03/how-to-load-large-files-safely-into-innodb-with-load-data-infile/

Execute the following command in a session:

Perl pt-fifo-split infile.txt--fifo/tmp/my-fifo--lines 1000000
Execute the following command in another session:

while [-e/tmp/my-fifo]; Todo
Time Mysql-e "Set foreign_key_checks=0; Set sql_log_bin=0; Set unique_checks=0; Load data local infile '/tmp/my-fifo ' to table load_test fields terminated by ' \ t ' lines terminated by ' \ n ' (col1, col2) ;"
Sleep 1;
Done

Related Article

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.