Ok. Thanks, Dennis. I may look at the pysqlite source one of these days when I have more cycles.
In the meantime, I'll do it like the example. In fact, I already have something working. It is also wrapped in a transaction and I've set all those pragma synchronous stuff as well but it is still much slower than what I was hoping. Well, I'm kind of comparing it from my experience with the C program so that is not really a fair comparison. :) Thanks again. Jay --- Dennis Cote <[EMAIL PROTECTED]> wrote: > Jay Calaus wrote: > > > > Now I'm investigating using pysqlite for some > quick > > and dirty jobs and I'm trying to understand if > there > > is a need to prepare the statements once, then > bind > > and insert for every record, the same way I did it > in > > C. > > > > Your example above seems to do all of these in one > > shot. Do you know what happens behind the scenes > with > > your example? Is there an implicit "prepare" that > > happens once and then a bind/insert everytime the > > statement is encountered? > > > > > Jay, > > Yes, there is an implicit prepare (in reality there > has to be in order > to get sqlite to execute any SQL). I'm not 100% sure > about what goes on > behind the scenes with pysqlite since I haven't > looked at the source (to > be sure you could since it is open source), but this > is my > understanding. Internally pysqlite prepares and > caches SQL statements > the first time it sees them. If the same SQL > statement is repeated, it > re-uses the cached copy. It will bind new argument > values, if present, > to the cached prepared statement before executing > it. I believe it binds > values using the the python type of the arguments > (i.e. a float is bound > using sqlite3_bind_double). > > If you are doing a series of inserts it is still > important to ensure > they are done inside a transaction to get good > performance. > > HTH > Dennis Cote > > > > > ----------------------------------------------------------------------------- > To unsubscribe, send email to > [EMAIL PROTECTED] > ----------------------------------------------------------------------------- > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------