Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:05:25+00:00 2026-05-15T04:05:25+00:00

It seems that a MySQL database that has a table with tens of millions

  • 0

It seems that a MySQL database that has a table with tens of millions of records will get a big INSERT INTO statement when the following

mysqldump some_db > some_db.sql

is done to back up the database. (is it 1 insert statement that handles all the records?)

So when reconstructing the DB using

mysql some_db < some_db.sql

then the CPU is hardly busy (about 1.8% usage by the mysql process… I don’t see a mysqld either?) and also the hard disk doesn’t seem to be too busy…

Last time, the whole restore process took 5 hours. Is there a way to make it faster? Such as, when doing mysqldump, can it break the INSERT statement into shorter ones, so that the mysql doesn’t need to parse the line so hard when restoring the DB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:05:26+00:00Added an answer on May 15, 2026 at 4:05 am

    If anything is using time, it will be mysqld, that’s what actually does all of the work. If you’re connecting to a remote mysql server then mysqld will be on that machine, not your local one.

    The most direct way to speed it up would be to remove all keys and indexes from the table and then create them once the data is loaded. Keeping everything updated across that many inserts can be very taxing on a server, and will probably cause you to end up with fragmented indexes anyways. You can expect the index creation at the end of the inserts to take a while, but it won’t be as bad as keeping them all up to date as the inserts are taking place.

    A better solution would be to stop using mysqldump for that table and switch to using LOAD DATA INFILE (with the matching SELECT ... INTO OUTFILE for creating the dump).

    Your absolute best bet would be to just copy the database files instead of trying to do a backup and restore. I think this still only works with MyISAM databases and not InnoDB, but someone else can correct me if things have changed recently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Mysql has two types that can hold boolean data, bit and bool. Bit(1) seems
How can I insert a NULL value into a database field (MySQL) with char(2)?
Hey, im trying to wirte about 600000 Tokens into my MySQL Database Table. The
I have a legacy mysql database and there's this table which has a few
I'm migrating some data into MySQL and the dump from the other database has
My MySQL database table has dates stored in the MySQL format (YYYY-MM-DD). I need
I know that mySQL 5.x does not support INTERSECT, but that seems to be
Is there an exhaustive list of MySQL Time Zones? It seems that the valid
I want to order by Time,but seems no way to do that ? mysql>
Seems that This will be an easy question for you but this problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.