I just exported a 150 MB table using mysqldump from command line. It took about 5 seconds to export it.
However when I try to import the same file it takes up to 5 minutes.
Why is import slower than export and is there a way to speed it up? I need to export/import tables that are greater than 1 GB.
Does it have to do something with locks? Since select is reading data therefore exporting it would be faster and import is writing data and could be slower since it needs write locks.
Writing is slower than reading, on almost any medium. In a DBMS, indexes have to be maintained, constraints have to be checked, space has to be allocated, transaction boundaries have to be oberved, transaction loggging has to happen so that rollbacks will work, ...