]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Perpare to fork SQLite2.0 develop into a separate tree (CVS 184)
authordrh <drh@noemail.net>
Sun, 11 Feb 2001 16:58:21 +0000 (16:58 +0000)
committerdrh <drh@noemail.net>
Sun, 11 Feb 2001 16:58:21 +0000 (16:58 +0000)
FossilOrigin-Name: 4f00e27f17a15504543c5bbb8765c88bacd7257e

manifest
manifest.uuid
src/ex/sizes.tcl [new file with mode: 0644]
tool/report1.txt [new file with mode: 0644]
www/dynload.tcl [new file with mode: 0644]

index 5694e61bb72d318877b3922f0625094caadc21b7..2a4662d78bb276611594f240ae35092a899601b6 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Perpare\sto\sfork\sSQLite2.0\sdevelop\sinto\sa\sseparate\stree\s(CVS\s183)
-D 2001-02-11T16:56:24
+C Perpare\sto\sfork\sSQLite2.0\sdevelop\sinto\sa\sseparate\stree\s(CVS\s184)
+D 2001-02-11T16:58:22
 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
 F Makefile.in 7efa81e2985b45ba73db27d55b70cc927f5abfd7
 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
@@ -22,6 +22,7 @@ F src/ex/dbbebdb1.c 61ed414307f829478614def33de640bbe5b2f770
 F src/ex/dbbemird.c b00aef85656fa0a101dac2c32e12922ad106715a
 F src/ex/pg.c 2bbf6a94f37226d06337868b6bf4d7affc60197f
 F src/ex/pg.h 23a4ac807b0546ec2bb6239ec8bd3e06926572cd
+F src/ex/sizes.tcl f54bad4a2ac567624be59131a6ee42d71b41a3d7
 F src/expr.c 49bc261fdc4f4fb91c74cd668a9a952c00e85931
 F src/insert.c 4bc1cab84f7805d560a1417734a532843e30b762
 F src/main.c 5afe29c425b875acede20f609485866eb5b276f6
@@ -74,12 +75,14 @@ F tool/memleak.awk a0a11dd84bf4582acc81c3c61271021ae49b3f15
 F tool/opNames.awk 2bd9071a138e4e2be13dc98fe066398a61219e1e
 F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
 F tool/renumberOps.awk 6d067177ad5f8d711b79577b462da9b3634bd0a9
+F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816
 F www/arch.fig 4f246003b7da23bd63b8b0af0618afb4ee3055c8
 F www/arch.png 8dae0766d42ed3de9ed013c1341a5792bcf633e6
 F www/arch.tcl a40380c1fe0080c43e6cc5c20ed70731511b06be
 F www/c_interface.tcl 11be2d5826eb7d6efd629751d3b483c1ed78ba14
 F www/changes.tcl 2bd34627e9dc459f53d7e11630d92660be974b10
 F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e
+F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c
 F www/fileformat.tcl cfb7fba80b7275555281ba2f256c00734bcdd1c9
 F www/index.tcl b19418d506f90968deef972bf1b427d98bdf13e0
 F www/lang.tcl 9192e114b19987e630a41e879585b87006eb84a1
@@ -88,7 +91,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f
 F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f
 F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2
 F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad
-P 5128135c7e12f763722981ad39ecb7835db49142
-R ab8718eb81b6e7a57fbb613590282f19
+P 6adb6078871114ba19ab601bb94d43ff9e03e43f
+R 3ed34f8024572f0ced21ee5caed411da
 U drh
-Z 4c71efe3f5c2467e23cd148f67512b61
+Z 56b41e6c371943f084f1d3f2aaab9dea
index 2f3646a6e50301fad40ce24408ce4937fd50a5ba..632faf60149cde99dbdef2bd3b4fbed2ce653c11 100644 (file)
@@ -1 +1 @@
-6adb6078871114ba19ab601bb94d43ff9e03e43f
\ No newline at end of file
+4f00e27f17a15504543c5bbb8765c88bacd7257e
\ No newline at end of file
diff --git a/src/ex/sizes.tcl b/src/ex/sizes.tcl
new file mode 100644 (file)
index 0000000..4cb6ef6
--- /dev/null
@@ -0,0 +1,41 @@
+
+set sizes {1024 2048 4096 8192 16384 32768}
+set fmt { %-8s}
+
+puts -nonewline "page size: "
+foreach s $sizes {
+  puts -nonewline [format $fmt $s]
+}
+puts ""
+
+puts -nonewline "on leaf:   "
+foreach s $sizes {
+  set x [expr {$s - 18*4}]
+  set p($s) $x
+  puts -nonewline [format $fmt $x]
+}
+puts ""
+
+puts -nonewline "direct:    "
+foreach s $sizes {
+  set x [expr {$p($s) + 10*$s}]
+  set p($s) $x
+  puts -nonewline [format $fmt $x]
+}
+puts ""
+
+puts -nonewline "indirect:  "
+foreach s $sizes {
+  set x [expr {$p($s) + ($s/4.0)*$s}]
+  set p($s) $x
+  puts -nonewline [format $fmt $x]
+}
+puts ""
+
+puts -nonewline "dbl indir: "
+foreach s $sizes {
+  set x [expr {$p($s) + ($s/4.0)*($s/4)*$s}]
+  set p($s) $x
+  puts -nonewline [format $fmt $x]
+}
+puts ""
diff --git a/tool/report1.txt b/tool/report1.txt
new file mode 100644 (file)
index 0000000..7820b8c
--- /dev/null
@@ -0,0 +1,66 @@
+The SQL database used for ACD contains 113 tables and indices implemented
+in GDBM.  The following are statistics on the sizes of keys and data
+within these tables and indices.
+
+Entries:      962080
+Size:         45573853
+Avg Size:     48
+Key Size:     11045299
+Avg Key Size: 12
+Max Key Size: 99
+
+
+ Size of key              Cummulative
+  and data     Instances  Percentage
+------------  ----------  -----------
+    0..8            266    0%
+    9..12          5485    0%
+   13..16         73633    8%
+   17..24        180918   27%
+   25..32        209823   48%
+   33..40        148995   64%
+   41..48         76304   72%
+   49..56         14346   73%
+   57..64         15725   75%
+   65..80         44916   80%
+   81..96        127815   93%
+   97..112        34769   96%
+  113..128        13314   98%
+  129..144         8098   99%
+  145..160         3355   99%
+  161..176         1159   99%
+  177..192          629   99%
+  193..208          221   99%
+  209..224          210   99%
+  225..240          129   99%
+  241..256           57   99%
+  257..288          496   99%
+  289..320           60   99%
+  321..352           37   99%
+  353..384           46   99%
+  385..416           22   99%
+  417..448           24   99%
+  449..480           26   99%
+  481..512           27   99%
+  513..1024         471   99%
+ 1025..2048         389   99%
+ 2049..4096         182   99%
+ 4097..8192          74   99%
+ 8193..16384         34   99%
+16385..32768         17   99%
+32769..65536          5   99%
+65537..131073         3  100%
+
+
+This information is gathered to help design the new built-in
+backend for sqlite 2.0.  Note in particular that 99% of all
+database entries have a combined key and data size of less than
+144 bytes.  So if a leaf node in the new database is able to
+store 144 bytes of combined key and data, only 1% of the leaves
+will require overflow pages.  Furthermore, note that no key
+is larger than 99 bytes, so if the key will never be on an
+overflow page.
+
+The average combined size of key+data is 48.  Add in 16 bytes of
+overhead for a total of 64.  That means that a 1K page will
+store (on average) about 16 entries.
diff --git a/www/dynload.tcl b/www/dynload.tcl
new file mode 100644 (file)
index 0000000..3e12b7f
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# Run this Tcl script to generate the dynload.html file.
+#
+set rcsid {$Id: dynload.tcl,v 1.1 2001/02/11 16:58:22 drh Exp $}
+
+puts {<html>
+<head>
+  <title>How to build a dynamically loaded Tcl extension for SQLite</title>
+</head>
+<body bgcolor=white>
+<h1 align=center>
+How To Build A Dynamically Loaded Tcl Extension
+</h1>}
+puts {<p>
+<i>This note was contributed by 
+<a href="bsaunder@tampabay.rr.com.nospam">Bill Saunders</a>.  Thanks, Bill!</i>
+
+<p>
+To compile the SQLite Tcl extension into a dynamically loaded module 
+I did the following:
+</p>
+
+<ol>
+<li><p>Do a standard compile
+(I had a dir called bld at the same level as sqlite  ie
+        /root/bld
+        /root/sqlite
+I followed the directions and did a standard build in the bld
+directory)</p></li>
+
+<li><p>
+Now do the following in the bld directory
+<blockquote><pre>
+gcc -shared -I. -lgdbm ../sqlite/src/tclsqlite.c libsqlite.a -o sqlite.so
+</pre></blockquote></p></li>
+
+<li><p>
+This should produce the file sqlite.so in the bld directory</p></li>
+
+<li><p>
+Create a pkgIndex.tcl file that contains this line
+
+<blockquote><pre>
+package ifneeded sqlite 1.0 [list load [file join $dir sqlite.so]]
+</pre></blockquote></p></li>
+
+<li><p>
+To use this put sqlite.so and pkgIndex.tcl in the same directory</p></li>
+
+<li><p>
+From that directory start wish</p></li>
+
+<li><p>
+Execute the following tcl command (tells tcl where to fine loadable
+modules)
+<blockquote><pre>
+lappend auto_path [exec pwd]
+</pre></blockquote></p></li>
+
+<li><p>
+Load the package 
+<blockquote><pre>
+package require sqlite
+</pre></blockquote></p></li>
+
+<li><p>
+Have fun....</p></li>
+</ul>
+
+</body></html>}