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