MySQLdb

Daniel Bowett daniel at bowettsolutions.com
Wed Jan 26 05:14:21 EST 2005


Daniel Bowett wrote:
> I have just started playing around with MySQLdb for a project I am 
> planning.
> 
> As a test I have written a script that executes 3000 insert statements 
> on a table. The table contains 10 fields with a mix of text and numbers 
> - its a product table for a website eg UPC, ProductName, Price etc.
> 
> The problem I have is that it takes just over two minuted to execute the 
> 3000 insert statements which seems really slow! I am running it on a 
> machine with a 1.5 Ghz Pentium M Processor and Gig Of Ram. I dont think 
> the machine is to blame for the speed because during execution the 
> processor sits at about 10% and there is loads of free RAM.
> 
> Does anyone know if this sort of speed sounds right?
> 
> Cheers,
> 
> Dan.
> 
> 

UPDATE
------

I have found the "executemany" function! It now takes around a second to 
complete the 3000 inserts.

Lesson learnt - I should have posted my code...

Thanks for your help everyone.




More information about the Python-list mailing list