SQLite

Check-in [99d8e325e9]
Login

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

Overview
Comment:Additional automatic index tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 99d8e325e9eb8905631b06676206e6412f386d08
User & Date: drh 2010-04-08 16:30:39.000
Context
2010-04-08
17:28
Fix code coverage problems in where.c. (check-in: b04a528249 user: drh tags: trunk)
16:30
Additional automatic index tests. (check-in: 99d8e325e9 user: drh tags: trunk)
15:01
New test cases for automatic indices. New testcase() macros associated with column-used bitmasks. (check-in: e1aa48ace7 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to test/autoindex1.test.
98
99
100
101
102
103
104

































105
106
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


    db eval {UPDATE t2 SET d=d+1}
  }
  set r
} {11 911 22 922 33 933 44 944 55 955 66 966 77 977 88 988}
do_test autoindex1-310 {
  db eval {SELECT d FROM t2 ORDER BY d}
} {919 930 941 952 963 974 985 996}

# The next test does a 10-way join on unindexed tables.  Without
# automatic indices, the join will take a long time to complete.
# With automatic indices, it should only take about a second.
#
do_test autoindex1-400 {
  db eval {
    CREATE TABLE t4(a, b);
    INSERT INTO t4 VALUES(1,2);
    INSERT INTO t4 VALUES(2,3);
  }
  for {set n 2} {$n<4096} {set n [expr {$n+$n}]} {
    db eval {INSERT INTO t4 SELECT a+$n, b+$n FROM t4}
  }
  db eval {
    SELECT count(*) FROM t4;
  }
} {4096}
do_test autoindex1-401 {
  db eval {
    SELECT count(*)
      FROM t4 AS x1
      JOIN t4 AS x2 ON x2.a=x1.b
      JOIN t4 AS x3 ON x3.a=x2.b
      JOIN t4 AS x4 ON x4.a=x3.b
      JOIN t4 AS x5 ON x5.a=x4.b
      JOIN t4 AS x6 ON x6.a=x5.b
      JOIN t4 AS x7 ON x7.a=x6.b
      JOIN t4 AS x8 ON x8.a=x7.b
      JOIN t4 AS x9 ON x9.a=x8.b
      JOIN t4 AS x10 ON x10.a=x9.b;
  }
} {4087}

finish_test