Use flag –xml when you run mysqldump

2 views
Skip to first unread message

Joseph Turian

unread,
Oct 14, 2009, 6:45:48 PM10/14/09
to get-t...@googlegroups.com
I wrote a blog post advocating the use of flag --xml when you run mysqldump:

http://blog.metaoptimize.com/2009/10/14/use-flag-xml-when-you-run-mysqldump/

Does anyone have a critique of this position?

Best,
Joseph

Joshua Reich

unread,
Oct 14, 2009, 7:00:35 PM10/14/09
to get-t...@googlegroups.com
My excessively snarky $0.02:

1. I am friends with awk & pals, and stripping out INSERT .. VALUE from mysql dumps that I get from people is no biggy
2. I'm pretty sure MySQL supports dumping table data as CSV (SELECT ... OUTHOUSE '/tmp/file.csv' ...)
3. For big data, XML is just silly big.
4. Why aren't you using postgres ?

:)

</rant>

Josh
--
Joshua Reich
646 256 4763
i2pi
simplicity . depth . scalability


Joseph Turian

unread,
Oct 14, 2009, 7:23:42 PM10/14/09
to get-t...@googlegroups.com
I encourage you to post any comments on the blog.
I replied to you there:
http://blog.metaoptimize.com/2009/10/14/use-flag-xml-when-you-run-mysqldump/comment-page-1/#comment-15
Here is a copy of my response:


Let me answer your last question first:

> 4. Why aren’t you using postgres ?

I was getting data from someone that uses MySQL.
Knowing what I know now, I believe should should have advised him to
use the –xml flag.

> 1. I am friends with awk & pals, and stripping out INSERT .. VALUE from
> mysql dumps that I get from people is no biggy

I am friends with perl, and you cannot simply split using /,/ to get
your fields. The comma might be right in the middle of a string.

With XML, though, it is simple to grep for <row>, because you know
100% that < will only be in the markup.

> 2. I’m pretty sure MySQL supports dumping table data as CSV (SELECT …
> OUTHOUSE ‘/tmp/file.csv’ …)

Same problems as above.

> 3. For big data, XML is just silly big.

Why? It gzips easily.
Not being able to load it all into memory is less of an issue if it is
easy to split the data using regular expressions.

Reply all
Reply to author
Forward
0 new messages