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

Side by Side Diff: third_party/sqlite/src/test/analyze8.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 unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/analyze3.test ('k') | third_party/sqlite/src/test/analyze9.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2011 August 13 1 # 2011 August 13
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1a (a=?)}} 79 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1a (a=?)}}
80 do_test 2.1 { 80 do_test 2.1 {
81 eqp {SELECT * FROM t1 WHERE a=100 AND b BETWEEN 50 AND 54} 81 eqp {SELECT * FROM t1 WHERE a=100 AND b BETWEEN 50 AND 54}
82 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1b (b>? AND b<?)}} 82 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1b (b>? AND b<?)}}
83 83
84 # There are many more values of c between 0 and 100000 than there are 84 # There are many more values of c between 0 and 100000 than there are
85 # between 800000 and 900000. So t1c is more selective for the latter 85 # between 800000 and 900000. So t1c is more selective for the latter
86 # range. 86 # range.
87 # 87 #
88 # Test 3.2 is a little unstable. It depends on the planner estimating 88 # Test 3.2 is a little unstable. It depends on the planner estimating
89 # that (b BETWEEN 50 AND 54) will match more rows than (c BETWEEN 89 # that (b BETWEEN 30 AND 34) will match more rows than (c BETWEEN
90 # 800000 AND 900000). Which is a pretty close call (50 vs. 32), so 90 # 800000 AND 900000). Which is a pretty close call (50 vs. 32), so
91 # the planner could get it wrong with an unlucky set of samples. This 91 # the planner could get it wrong with an unlucky set of samples. This
92 # case happens to work, but others ("b BETWEEN 40 AND 44" for example) 92 # case happens to work, but others ("b BETWEEN 40 AND 44" for example)
93 # will fail. 93 # will fail.
94 # 94 #
95 do_execsql_test 3.0 { 95 do_execsql_test 3.0 {
96 SELECT count(*) FROM t1 WHERE b BETWEEN 50 AND 54; 96 SELECT count(*) FROM t1 WHERE b BETWEEN 30 AND 34;
97 SELECT count(*) FROM t1 WHERE c BETWEEN 0 AND 100000; 97 SELECT count(*) FROM t1 WHERE c BETWEEN 0 AND 100000;
98 SELECT count(*) FROM t1 WHERE c BETWEEN 800000 AND 900000; 98 SELECT count(*) FROM t1 WHERE c BETWEEN 800000 AND 900000;
99 } {50 376 32} 99 } {50 376 32}
100 do_test 3.1 { 100 do_test 3.1 {
101 eqp {SELECT * FROM t1 WHERE b BETWEEN 50 AND 54 AND c BETWEEN 0 AND 100000} 101 eqp {SELECT * FROM t1 WHERE b BETWEEN 30 AND 34 AND c BETWEEN 0 AND 100000}
102 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1b (b>? AND b<?)}} 102 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1b (b>? AND b<?)}}
103 do_test 3.2 { 103 do_test 3.2 {
104 eqp {SELECT * FROM t1 104 eqp {SELECT * FROM t1
105 WHERE b BETWEEN 50 AND 54 AND c BETWEEN 800000 AND 900000} 105 WHERE b BETWEEN 30 AND 34 AND c BETWEEN 800000 AND 900000}
106 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c>? AND c<?)}} 106 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c>? AND c<?)}}
107 do_test 3.3 { 107 do_test 3.3 {
108 eqp {SELECT * FROM t1 WHERE a=100 AND c BETWEEN 0 AND 100000} 108 eqp {SELECT * FROM t1 WHERE a=100 AND c BETWEEN 0 AND 100000}
109 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1a (a=?)}} 109 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1a (a=?)}}
110 do_test 3.4 { 110 do_test 3.4 {
111 eqp {SELECT * FROM t1 111 eqp {SELECT * FROM t1
112 WHERE a=100 AND c BETWEEN 800000 AND 900000} 112 WHERE a=100 AND c BETWEEN 800000 AND 900000}
113 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c>? AND c<?)}} 113 } {0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c>? AND c<?)}}
114 114
115 finish_test 115 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/analyze3.test ('k') | third_party/sqlite/src/test/analyze9.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698