PEP 249 (database api) -- executemany() with iterable?

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Thu Oct 14 05:36:34 CEST 2010


In message <4cb5e659$0$1650$742ec2ed at news.sonic.net>, John Nagle wrote:

>      Also note that there are some issues with doing a huge volume of
> updates in one MySQL InnoDB transaction.  The system has to keep the
> data needed to undo the updates, and there's a limit on the amount of
> pending transaction history that can be stored.

How does “load data” avoid this? Is that not a transaction too?

>      It's common to load data into a new, empty table, then, once
> the reload has succeeded, do a RENAME like CURRENT->OLD, NEW->CURRENT.
> Rename of multiple databases is atomic and interlocked with other
> operations, so you can replace an entire table on a live server.

Is that to avoid impacting searches on the existing data while loading the 
new records?

Seems to me this isn’t going to help, since both old and new tables are on 
the same disk, after all. And it’s the disk access that’s the bottleneck.



More information about the Python-list mailing list