On Thu, 15 Apr 2004 [EMAIL PROTECTED] wrote:

>I'm just getting around to using SQLITE to see how it performs. Therefore,
>I'm just a beginner.
>
>I have a couple of questions about it: I downloaded the TCL binding and did
>pkg_mkIndex to create the pkgIndex.tcl file.  Then I did "package require
>sqlite", I got version "2.0".  However, I see from the SQLITE website that
>the latest version is 2.8.13.  What's the reason for that?  Is TCL binding
>no longer supported by newer versions of SQLITE?

Should be. Maybe the 2.0 is the minimum supported version....

>
>The second question is about speed.  I created the most basic table and did
>a loop to insert 1000 integers and that took 207 seconds... an awful lot of
>time!!  What did I do wrong, if any, in the example below.

Try wrapping the inserts in transaction.

Without that, each insert requires fsyncs to flush data to disk and
purging of page cache as cache data is not reused from one transaction to
the next. All this slows inserts down as their is a lot of IO going on.

In a single transaction, there is only one lot of fsyncs and the cache is
maintained throughout.


>
>
>% package require sqlite
>2.0
>% sqlite db c:/newDB
>0x008752B8
>% set start [clock seconds]
>1082034600
>% db eval {CREATE TABLE t1(a int)}
>% for {set j 1} {$j <= 1000} {incr j} {db eval "INSERT INTO t1 VALUES($j)"}
>% puts "total processing time = [expr [clock seconds] - $start]"
>total processing time = 207
>%
>
>thanks,
>SD
>
>
>
>The information transmitted is intended only for the person(s)or entity
>to which it is addressed and may contain confidential and/or legally
>privileged material. Delivery of this message to any person other than
>the intended recipient(s) is not intended in any way to waive privilege
>or confidentiality. Any review, retransmission, dissemination or other
>use of, or taking of any action in reliance upon, this information by
>entities other than the intended recipient is prohibited. If you
>receive this in error, please contact the sender and delete the
>material from any computer.
>
>For Translation:
>
>http://www.baxter.com/email_disclaimer
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

-- 
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to