]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Use the cache with loading a large table in select2-2.0. (CVS 2272)
authordrh <drh@noemail.net>
Mon, 24 Jan 2005 12:46:14 +0000 (12:46 +0000)
committerdrh <drh@noemail.net>
Mon, 24 Jan 2005 12:46:14 +0000 (12:46 +0000)
FossilOrigin-Name: bd65b1805c116a9073a01164d77e2bfd4ab3b447

manifest
manifest.uuid
test/select2.test

index e7b5cdd5f055213caaa651d9e42dfb69b9af2f1f..da66bf89e97cce1949abd8a453e5b73e77c787a8 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Modifications\sand\sbugfixes\sso\sthat\sthe\stest\ssuite\spasses\swith\sthe\sTCL\sstatement\scache\sturned\son.\s(CVS\s2271)
-D 2005-01-24T10:25:59
+C Use\sthe\scache\swith\sloading\sa\slarge\stable\sin\sselect2-2.0.\s(CVS\s2272)
+D 2005-01-24T12:46:14
 F Makefile.in ffd81f5e926d40b457071b4de8d7c1fa18f39b5a
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -176,7 +176,7 @@ F test/rowid.test 040a3bef06f970c45f5fcd14b2355f7f4d62f0cf
 F test/safety.test 907b64fee719554a3622853812af3886fddbbb4f
 F test/schema.test ccaceafa6c0031489f7e927f0449bef360530387
 F test/select1.test ad700a2a1c325a23a7206ad4d189e33917de526f
-F test/select2.test 91a2225926039b0d1687840735c284dbbf89f0bc
+F test/select2.test 04103fbd55fca9558fd79d637fb7819d9d0b2f52
 F test/select3.test 9de435aa84fc406708cd8dc1b1d60e7f27cea685
 F test/select4.test c239f516aa31f42f2ef7c6d7cd01105f08f934ca
 F test/select5.test 94db800bbeff2e426c0175e07f7a71d4617853b5
@@ -272,7 +272,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
 F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
-P 8beae3ff8cbe23f20eb242187edbdb72133a24c3
-R e210e6d8b7fc1de8bf1fafd9d7f898f8
-U danielk1977
-Z 83dc4420463960a142888db523f30157
+P d5233e0747789dea04d35a8350b408321d23a64d
+R 64d7764e37b156dc0893bed779bcbc1f
+U drh
+Z b35e1974cc6fc16a36be9de3cc4530ba
index dbe00e15f91cbe50d976d411ed0742e86077789c..fc7dc47a510c4268124c26fa7c4be281a76ccc84 100644 (file)
@@ -1 +1 @@
-d5233e0747789dea04d35a8350b408321d23a64d
\ No newline at end of file
+bd65b1805c116a9073a01164d77e2bfd4ab3b447
\ No newline at end of file
index 82304b1a079489167856efbcd41aa0d8e451fc9c..1d9d87bd17ce1a5075e17e3b8b10b37c21fd417d 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing the SELECT statement.
 #
-# $Id: select2.test,v 1.22 2004/05/28 11:37:29 danielk1977 Exp $
+# $Id: select2.test,v 1.23 2005/01/24 12:46:14 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -56,15 +56,44 @@ do_test select2-1.2 {
   set r
 } {4: 2 3 4}
 
-# Create a largish table
+# Create a largish table. Do this twice, once using the TCL cache and once
+# without.  Compare the performance to make sure things go faster with the
+# cache turned on.
 #
-do_test select2-2.0 {
-  execsql {CREATE TABLE tbl2(f1 int, f2 int, f3 int); BEGIN;}
-  for {set i 1} {$i<=30000} {incr i} {
-    execsql "INSERT INTO tbl2 VALUES($i,[expr {$i*2}],[expr {$i*3}])"
-  }
-  execsql {COMMIT}
+ifcapable tclvar {
+  do_test select2-2.0.1 {
+    set t1 [time {
+      execsql {CREATE TABLE tbl2(f1 int, f2 int, f3 int); BEGIN;}
+      for {set i 1} {$i<=30000} {incr i} {
+        set i2 [expr {$i*2}]
+        set i3 [expr {$i*3}]
+        db eval {INSERT INTO tbl2 VALUES($i,$i2,$i3)}
+      }
+      execsql {COMMIT}
+    }]
+    set result {}
+  } {}
+  puts "time with cache: $::t1"
+}
+catch {execsql {DROP TABLE tbl2}}
+do_test select2-2.0.2 {
+  set t2 [time {
+    execsql {CREATE TABLE tbl2(f1 int, f2 int, f3 int); BEGIN;}
+    for {set i 1} {$i<=30000} {incr i} {
+      set i2 [expr {$i*2}]
+      set i3 [expr {$i*3}]
+      execsql "INSERT INTO tbl2 VALUES($i,$i2,$i3)"
+    }
+    execsql {COMMIT}
+  }]
+  set result {}
 } {}
+puts "time without cache: $t2"
+ifcapable tclvar {
+  do_test select2-2.0.3 {
+    expr {[lindex $t1 0]<[lindex $t2 0]}
+  } 1
+}
 
 do_test select2-2.1 {
   execsql {SELECT count(*) FROM tbl2}