Re: pySQLite Insert speed



mdboldin@xxxxxxxxx wrote:
(B) is better than (A). The parameter binding employed in (B)
is not only faster on many databases, but more secure.
See, for example,http://informixdb.blogspot.com/2007/07/filling-in-
blanks.html

Thx. The link was helpful, and I think I have read similar things
before-- that B is faster.
So ... I just rewrote the test code from scratch and B is faster. I
must have had something wrong in my original timing.

Don't forget, by the way, that your original (B) code was performing the string substitution of the parameter markers into the SQL statement each time the statement was executed. As Carsten pointed out, this overhead should be performed at most once, and only then if you want your code to be portable over database backends with different paramstyles. Forget (A).

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

.



Relevant Pages

  • Re: pySQLite Insert speed
    ... is not only faster on many databases, but more secure. ... Thx. ... must have had something wrong in my original timing. ...
    (comp.lang.python)
  • Re: SQL Statement
    ... I used the IN Clause to accomplish this. ... a sample for those of you wanting to know how. ... > connection string into the SQL Statement? ... Both databases are in Access ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Where to store SQL statement
    ... databases. ... Everytime I have to make a slight change to the sql statement, ... but I am concerned about the overhead of opening and ... reading a file just to get a SQL statement. ...
    (comp.lang.java.databases)
  • SOAP and Content Databases
    ... I built a little app that can create a SQL statement based on the list. ... where the Content Databases are... ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: CSV file-based address book code snippet?
    ... >This is what databases are good at, ... Thx, but I'd rather use a flat file instead for easier update and ... thing in VB and a grid object. ...
    (comp.lang.php)