Mysql tip: Improve the speed of inserting data (adding records) _mysql

Source: Internet
Author: User

Problem Description:

Ordinary desktop, collect data, the table already has >1000 million data quantity.

The data collected is slow to insert into the table, 100 milliseconds per treaty.

Workaround:

1, enlarge the MySQL configuration in the bulk_insert_buffer_size, this parameter defaults to 8M

bulk_insert_buffer_size=100m

2, rewrite all INSERT statements for insert delayed

This insert delayed differs in that it immediately returns the result and the background handles the insertion.

Another technique is to insert multiple data into a single hop insert, similar to insert INTO tablename values (' xxx ', ' xxx '), (' yyy ', ' yyy '), (' zzz ', ' zzz ') ...; But in my acquisition program to change the SQL is more troublesome, so did not use

Cloud Habitat Community Small series remind:

The truth is generally used for data collection and warehousing operations, mature CMS does not recommend changes, Dedecms is due to my system design problems, the proposal to use the commercial version or the establishment of their own index, now large data preferred Imperial cms or PHPCMS.

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.