Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix test cases to align with the improved stats computation. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | analyze-worst-case |
Files: | files | file ages | folders |
SHA1: |
810967bff6ba262f38a2833e2d4efef4 |
User & Date: | drh 2016-03-01 12:45:08.294 |
Context
2016-03-01
| ||
14:31 | Change the estimated row counts in stat1 to be one-third worst-case and two-threads average case. (check-in: 21bfd47c42 user: drh tags: analyze-worst-case) | |
12:45 | Fix test cases to align with the improved stats computation. (check-in: 810967bff6 user: drh tags: analyze-worst-case) | |
2016-02-29
| ||
23:02 | Improvements to the logic for adding the "noskipscan" flag to stat1 entries. (check-in: 421b5b544a user: drh tags: analyze-worst-case) | |
Changes
Changes to test/analyze.test.
︙ | ︙ | |||
154 155 156 157 158 159 160 | } {t1i1 {4 4} t1i2 {4 1} t1i3 {4 4 1}} do_test analyze-3.3 { execsql { INSERT INTO t1 VALUES(2,5); ANALYZE main; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } | | | | | | | | | | | | 154 155 156 157 158 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 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | } {t1i1 {4 4} t1i2 {4 1} t1i3 {4 4 1}} do_test analyze-3.3 { execsql { INSERT INTO t1 VALUES(2,5); ANALYZE main; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t1i1 {5 4} t1i2 {5 2} t1i3 {5 4 1}} do_test analyze-3.4 { execsql { CREATE TABLE t2 AS SELECT * FROM t1; CREATE INDEX t2i1 ON t2(a); CREATE INDEX t2i2 ON t2(b); CREATE INDEX t2i3 ON t2(a,b); ANALYZE; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t1i1 {5 4} t1i2 {5 2} t1i3 {5 4 1} t2i1 {5 4} t2i2 {5 2} t2i3 {5 4 1}} do_test analyze-3.5 { execsql { DROP INDEX t2i3; ANALYZE t1; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t1i1 {5 4} t1i2 {5 2} t1i3 {5 4 1} t2i1 {5 4} t2i2 {5 2}} do_test analyze-3.6 { execsql { ANALYZE t2; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t1i1 {5 4} t1i2 {5 2} t1i3 {5 4 1} t2i1 {5 4} t2i2 {5 2}} do_test analyze-3.7 { execsql { DROP INDEX t2i2; ANALYZE t2; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t1i1 {5 4} t1i2 {5 2} t1i3 {5 4 1} t2i1 {5 4}} do_test analyze-3.8 { execsql { CREATE TABLE t3 AS SELECT a, b, rowid AS c, 'hi' AS d FROM t1; CREATE INDEX t3i1 ON t3(a); CREATE INDEX t3i2 ON t3(a,b,c,d); CREATE INDEX t3i3 ON t3(d,b,c,a); DROP TABLE t1; DROP TABLE t2; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {} do_test analyze-3.9 { execsql { ANALYZE; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t3i1 {5 4} t3i2 {5 4 1 1 1} t3i3 {5 5 2 1 1}} do_test analyze-3.10 { execsql { CREATE TABLE [silly " name](a, b, c); CREATE INDEX 'foolish '' name' ON [silly " name](a, b); CREATE INDEX 'another foolish '' name' ON [silly " name](c); INSERT INTO [silly " name] VALUES(1, 2, 3); INSERT INTO [silly " name] VALUES(4, 5, 6); ANALYZE; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {{another foolish ' name} {2 1} {foolish ' name} {2 1 1} t3i1 {5 4} t3i2 {5 4 1 1 1} t3i3 {5 5 2 1 1}} do_test analyze-3.11 { execsql { DROP INDEX "foolish ' name"; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {{another foolish ' name} {2 1} t3i1 {5 4} t3i2 {5 4 1 1 1} t3i3 {5 5 2 1 1}} do_test analyze-3.11 { execsql { DROP TABLE "silly "" name"; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t3i1 {5 4} t3i2 {5 4 1 1 1} t3i3 {5 5 2 1 1}} # Try corrupting the sqlite_stat1 table and make sure the # database is still able to function. # do_test analyze-4.0 { sqlite3 db2 test.db db2 eval { CREATE TABLE t4(x,y,z); CREATE INDEX t4i1 ON t4(x); CREATE INDEX t4i2 ON t4(y); INSERT INTO t4 SELECT a,b,c FROM t3; } db2 close db close sqlite3 db test.db execsql { ANALYZE; SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; } } {t3i1 {5 4} t3i2 {5 4 1 1 1} t3i3 {5 5 2 1 1} t4i1 {5 4} t4i2 {5 2}} do_test analyze-4.1 { execsql { PRAGMA writable_schema=on; INSERT INTO sqlite_stat1 VALUES(null,null,null); PRAGMA writable_schema=off; } db close |
︙ | ︙ |