# 2008 October 9
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
# This file generates SQL text used for performance testing.
#
# $Id: mkspeedsql.tcl,v 1.1 2008/10/09 17:57:34 drh Exp $
#
# Set a uniform random seed
expr srand(0)
# The number_name procedure below converts its argment (an integer)
# into a string which is the English-language name for that number.
#
# Example:
#
# puts [number_name 123] -> "one hundred twenty three"
#
set ones
set tens
# Create a database schema.
#
puts
# 50000 INSERTs on an unindexed table
#
set t1c_list
puts
for
puts
# 50000 INSERTs on an indexed table
#
puts
for
puts
# 50 SELECTs on an integer comparison. There is no index so
# a full table scan is required.
#
for
# 50 SELECTs on an LIKE comparison. There is no index so a full
# table scan is required.
#
for
# Create indices
#
puts
puts
puts
# 5000 SELECTs on an integer comparison where the integer is
# indexed.
#
set sql
for
# 100000 random SELECTs against rowid.
#
for
# 100000 random SELECTs against a unique indexed column.
#
for
# 50000 random SELECTs against an indexed column text column
#
set nt1c
for
# Vacuum
puts
# 5000 updates of ranges where the field being compared is indexed.
#
puts
for
puts
# 50000 single-row updates. An index is used to find the row quickly.
#
puts
for
puts
# 1 big text update that touches every row in the table.
#
puts
# Many individual text updates. Each row in the table is
# touched through an index.
#
puts
for
puts
# Delete all content in a table.
#
puts
# Copy one table into another
#
puts
# Delete all content in a table, one row at a time.
#
puts
# Refill the table yet again
#
puts
# Drop the table and recreate it without its indices.
#
puts
puts
puts
# Refill the table yet again. This copy should be faster because
# there are no indices to deal with.
#
puts
# Select 20000 rows from the table at random.
#
puts
# Delete 20000 random rows from the table.
#
puts
puts
# Delete 20000 more rows at random from the table.
#
puts
puts