From the docs, it states:
The CSV storage engine stores data in text files using comma-separated values format.
What are the advantages of this? Here are some I can think of:
SELECT INTO OUTFILE
)What are some disadvantages?
Granted this (non-exhaustive) list of advantages and disadvantages, in what practical scenarios should I consider using the CSV storage engine over others?
I seldom use the CSV storage engine. One scenario I have found it useful, however, is for bulk data imports.
mv
the CSV file into the MySQL data dictionary, overwriting the .csv file that belongs to my table I just created.ALTER TABLE mytable ENGINE=InnoDB
Voilà! One-step import of a huge CSV data file using DDL instead of INSERT or LOAD DATA.
Granted, it's less flexible than INSERT or LOAD DATA, because you can't do NULLs or custom overrides of individual columns, or any "replace" or "ignore" features for handling duplicate values. But if you have an input file that is exactly what you want to import, it could make the import very easy.