Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/sqlite/src/test/whereJ.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/whereG.test ('k') | third_party/sqlite/src/test/whereK.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/whereJ.test
diff --git a/third_party/sqlite/src/test/whereJ.test b/third_party/sqlite/src/test/whereJ.test
index 8431c3a4b097daff6022d8ebc5af82be8ee6cc74..48924d0fcfe30ba2d14b4c8205c933a09898fc47 100644
--- a/third_party/sqlite/src/test/whereJ.test
+++ b/third_party/sqlite/src/test/whereJ.test
@@ -640,4 +640,39 @@ do_execsql_test 4.2 {
} {/.*SCAN TABLE cx.*SEARCH TABLE px.*SEARCH TABLE le.*/}
+# The following test is derived from a performance problem reported from
+# the field. Notice the multiple indexes with the same initial tables,
+# and the unusual WHERE clause terms.
+#
+do_test 5.1 {
+ set res [db eval {
+ DROP TABLE IF EXISTS t1;
+ CREATE TABLE t1(a,b,c,d,e,f,g,h);
+ CREATE INDEX t1abc ON t1(a,b,c);
+ CREATE INDEX t1abe ON t1(a,b,e);
+ CREATE INDEX t1abf ON t1(a,b,f);
+ ANALYZE;
+ DROP TABLE IF EXISTS sqlite_stat4;
+ DROP TABLE IF EXISTS sqlite_stat3;
+ DELETE FROM sqlite_stat1;
+ INSERT INTO sqlite_stat1(tbl,idx,stat)
+ VALUES('t1','t1abc','2000000 8000 1600 800'),
+ ('t1','t1abe','2000000 8000 1600 150'),
+ ('t1','t1abf','2000000 8000 1600 150');
+ ANALYZE sqlite_master;
+
+ EXPLAIN QUERY PLAN
+ SELECT * FROM t1
+ WHERE (a=1 OR a=2)
+ AND (b=3 OR b=4)
+ AND (d>=5 AND d<=5)
+ AND ((e>=7 AND e<=7) OR (f>=8 AND f<=8))
+ AND g>0;
+ }]
+} {~/ANY/}
+do_test 5.2 {set res} {/USING INDEX t1abe/}
+do_test 5.3 {set res} {/USING INDEX t1abf/}
+
+
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/whereG.test ('k') | third_party/sqlite/src/test/whereK.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698