iceangel89
iceangel89

Reputation: 6273

mysqldump and --tab speed

According to the MySQL Certification Guide, when --tab option is used,

a SELECT ... INTO OUTFILE is used to generate a tab delimited file in the specified directory, a file containing SQL (CREATE TABLE) will also be generated

and that

using --tab to produce tab-delimited dump files is much faster

but how can it be faster if both generate a SQL file and the --tab one just has an extra tab?

Upvotes: 0

Views: 1019

Answers (1)

Pascal MARTIN
Pascal MARTIN

Reputation: 400932

I would say that :

  • without using --tab, a file is generated, that contains both :
    • create statements
    • and data, as lots of insert statements
  • with --tab, two files are generated :
    • one with create statements
    • one other with data, in a tab-delimited format, instead of insert statements

The difference is the second part :

  • inserts
  • vs tab-delimited

I'm guessing that creating lots of insert statements takes more time than just dumping data with a tab-delimited format -- maybe it's the same with importing the data back, too ?

Upvotes: 2

Related Questions