/ Check-in [a2da7f9a]
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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a2da7f9ac24ed17329ce9bde2e521a5b945e4ec2
User & Date: drh 2008-04-10 13:32:37
Context
2008-04-10
13:33
First cut at optimizing single-row updates to use a one-pass algorithm. (CVS 4973) check-in: fba97f78 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: a2da7f9a user: drh tags: trunk
13:20
Fix a bug in the speed4p.test performance testing script. (CVS 4971) check-in: 80311594 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/speed4p.test.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
159
160
161
162
163
164
165






























166
167
168
169
170
171
172
# 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
................................................................................
             (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







|







 







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







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
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
# 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
................................................................................
             (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