SQLite

Check-in [a2da7f9ac2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add three new test cases to speed4p.test. Two of the three do single-row updates based on rowid and on primary key. (CVS 4972)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a2da7f9ac24ed17329ce9bde2e521a5b945e4ec2
User & Date: drh 2008-04-10 13:32:37.000
Context
2008-04-10
13:33
First cut at optimizing single-row updates to use a one-pass algorithm. (CVS 4973) (check-in: fba97f7874 user: drh tags: trunk)
13:32
Add three new test cases to speed4p.test. Two of the three do single-row updates based on rowid and on primary key. (CVS 4972) (check-in: a2da7f9ac2 user: drh tags: trunk)
13:20
Fix a bug in the speed4p.test performance testing script. (CVS 4971) (check-in: 8031159414 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/speed4p.test.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# the focus is on the speed of:
#
#   * joins
#   * views
#   * sub-selects
#   * triggers
#
# $Id: speed4p.test,v 1.3 2008/04/10 13:20:21 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
speed_trial_init speed1

# Set a uniform random seed







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# the focus is on the speed of:
#
#   * joins
#   * views
#   * sub-selects
#   * triggers
#
# $Id: speed4p.test,v 1.4 2008/04/10 13:32:37 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
speed_trial_init speed1

# Set a uniform random seed
159
160
161
162
163
164
165






























166
167
168
169
170
171
172
             (SELECT t FROM t2 WHERE rowid = $v), 
             (SELECT t FROM t3 WHERE rowid = $v)
    }
  }
}
speed_trial_tcl speed4p-subselect1 10000 stmt $script































# The following block tests the speed of some DML statements that cause
# triggers to fire.
#
execsql {
  CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);
  CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);
  CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
             (SELECT t FROM t2 WHERE rowid = $v), 
             (SELECT t FROM t3 WHERE rowid = $v)
    }
  }
}
speed_trial_tcl speed4p-subselect1 10000 stmt $script

# Single-row updates performance.
#
set script {
  db eval BEGIN
  for {set ii 1} {$ii < 10000} {incr ii} {
    set v [expr {$ii*3}]
    db eval {UPDATE t1 SET i=i+1 WHERE rowid=$ii}
  }
  db eval COMMIT
}
speed_trial_tcl speed4p-rowid-update 10000 stmt $script


db eval {
   CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);
}
speed_trial speed4p-insert-ignore 50000 row {
  INSERT OR IGNORE INTO t5 SELECT t, i FROM t1;
}

set list [db eval {SELECT t FROM t5}]
set script {
  db eval BEGIN
  foreach t $::list {
    db eval {UPDATE t5 SET i=i+1 WHERE t=$t}
  }
  db eval COMMIT
}
speed_trial_tcl speed4p-unique-update [llength $list] stmt $script

# The following block tests the speed of some DML statements that cause
# triggers to fire.
#
execsql {
  CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);
  CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);
  CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN