HiveBrain v1.2.0
Get Started
← Back to all entries
gotchasqlMajor

Why does importing a 12 GB .sql file take more than 36 hours?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
whyfilesqltakethanmorehoursdoesimporting

Problem

I've been waiting now for 36 hours for a 12 GB .sql file to be imported with a simple type site.sql | mysql command. I can see the ibdata1 is growing still, currently nearly 40 GB.

Considering the triggers and stored procedures are at the end of the .sql, I only think MySQL should be adding data and key indexes.

The site.sql was generated using this command from another server:

mysqldump -R -e --databases site --add-drop-database --add-create-database --add-drop-table -C --single-transaction --triggers

What's taking so long?

Solution

Try this:

$ ps -ef|grep [m]ysql


Identify the process id then

$ strace -cp 


Leave it 10 seconds or a minute then ^C. That will tell you where the process is spending its time, e.g. it could just be waiting for the disk if you seen read and write dominate.

Code Snippets

$ ps -ef|grep [m]ysql
$ strace -cp <pid>

Context

StackExchange Database Administrators Q#1326, answer score: 24

Revisions (0)

No revisions yet.