2N/A#pragma ident "%Z%%M% %I% %E% SMI" 2N/A# Run this script using TCLSH to do a speed comparison between 2N/A# various versions of SQLite and PostgreSQL and MySQL 2N/A puts "<h2>Test $cnt: $title</h2>" 2N/A append sql "<i>... [expr {$n-6}] lines omitted</i><br>\n" 2N/A puts "</blockquote><table border=0 cellpadding=0 cellspacing=0>" 2N/A set t [
time "exec psql drh <$sqlfile" 1]
2N/A set t [
expr {[
lindex $
t 0]/
1000000.0}]
2N/A set t [
time "exec mysql -f drh <$sqlfile" 1]
2N/A set t [
expr {[
lindex $
t 0]/
1000000.0}]
2N/A# set t [time "exec ./sqlite232 s232.db <$sqlfile" 1] 2N/A# set t [expr {[lindex $t 0]/1000000.0}] 2N/A# puts [format $format {SQLite 2.3.2:} $t] 2N/A# set t [time "exec ./sqlite-100 s100.db <$sqlfile" 1] 2N/A# set t [expr {[lindex $t 0]/1000000.0}] 2N/A# puts [format $format {SQLite 2.4 (cache=100):} $t] 2N/A set t [
expr {[
lindex $
t 0]/
1000000.0}]
2N/A set t [
expr {[
lindex $
t 0]/
1000000.0}]
2N/A# set t [time "exec ./sqlite-t1 st1.db <$sqlfile" 1] 2N/A# set t [expr {[lindex $t 0]/1000000.0}] 2N/A# puts [format $format {SQLite 2.4 (test):} $t] 2N/A# Initialize the environment 2N/A set txt "[number_name [expr {$n/1000}]] thousand" 2N/A append txt " [lindex $::ones [expr {$n/100}]] hundred" 2N/A append txt " [lindex $::tens [expr {$n/10}]]" 2N/A append txt " [lindex $::ones $n]" 2N/Aputs $
fd "CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));" 2N/A puts $
fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" 2N/Aputs $
fd "DELETE FROM t1;" 2N/A puts $
fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" 2N/Aputs $
fd "DELETE FROM t1;" 2N/A puts $
fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" 2N/Aputs $
fd "DELETE FROM t1;" 2N/A puts $
fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" 2N/Aputs $
fd "DELETE FROM t1;" 2N/A puts $
fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');" 2N/Aputs $
fd "DELETE FROM t1;"