MySQL Forums
Forum List  »  Connector/Python

Re: Exporting 5 million records
Posted by: Geert Vanderkelen
Date: December 02, 2009 01:49AM

First, you might look at non-Python solution: SELECT .. INTO OUTFILE explained in MySQL manual here:
http://dev.mysql.com/doc/refman/5.1/en/select.html

There are restrictions for it, but check it out, it might be much faster.

If you want to go the Python way, you might want to look into MySQLdb's special cursor SSCursor. During connection set this:
.connect( ...
cursorclass=MySQLdb.cursors.SSCursor
)

That should not buffer when you call fetchone()

MySQL Connector/Python, https://launchpad.net/myconnpy , doesn't buffer by default, so maybe you can give Sun's connector a try too.

Hope this helps!

Cheers,

Geert

Geert Vanderkelen
Software Developer at Oracle

Options: ReplyQuote


Subject
Written By
Posted
Re: Exporting 5 million records
December 02, 2009 01:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.