pySQLite Insert speed

mmm mdboldin at gmail.com
Mon Mar 3 22:42:12 EST 2008


> > Hence (if I understand python convention), this can be
> > solved by adding
> > sqlx= copy.copy(sqlx)
> > before the looping. And in tests adding this step saved about 5-10% in
> > time.
>
> Now this I don;t really understand at all. What's the point of trying to
> replace sqlx with a copy of itself? Perhaps if you explained what you
> hope this will achieve I could comment more intelligently.
>

I am/was attempting to convert

  sqlx= 'INSERT INTO %s VALUES ( %s ) ' % (dtable,ph)

to code that did to need to be re-evaluated.  i.e. to insert the
dtable and ph values as if they were hard coded.

copy.copy -->  A shallow copy constructs a new compound object and
then (to the extent possible) inserts references into it to the
objects found in the original.



More information about the Python-list mailing list