| OLD | NEW |
| 1 # 2012 March 26 | 1 # 2012 March 26 |
| 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 29 matching lines...) Expand all Loading... |
| 40 2 { SELECT count(*) FROM t1 WHERE t1 MATCH '"in the"' AND docid < 1010000} 47 | 40 2 { SELECT count(*) FROM t1 WHERE t1 MATCH '"in the"' AND docid < 1010000} 47 |
| 41 3 { SELECT count(*) FROM t1 WHERE t1 MATCH '"And God"' AND docid < 1010000} 33 | 41 3 { SELECT count(*) FROM t1 WHERE t1 MATCH '"And God"' AND docid < 1010000} 33 |
| 42 4 { SELECT count(*) FROM t1 WHERE t1 | 42 4 { SELECT count(*) FROM t1 WHERE t1 |
| 43 MATCH '"land of canaan"' AND docid < 1030000 } 7 | 43 MATCH '"land of canaan"' AND docid < 1030000 } 7 |
| 44 } { | 44 } { |
| 45 foreach s {0 1} { | 45 foreach s {0 1} { |
| 46 execsql "INSERT INTO t1(t1) VALUES('test-no-incr-doclist=$s')" | 46 execsql "INSERT INTO t1(t1) VALUES('test-no-incr-doclist=$s')" |
| 47 do_execsql_test 2.$tn.$s $q $res | 47 do_execsql_test 2.$tn.$s $q $res |
| 48 set t($s) [lindex [time [list execsql $q] 100] 0] | 48 set t($s) [lindex [time [list execsql $q] 100] 0] |
| 49 } | 49 } |
| 50 puts "with optimization: $t(0) without: $t(1)" | 50 if {0} { |
| 51 puts "with optimization: $t(0) without: $t(1)" |
| 52 } |
| 51 } | 53 } |
| 52 | 54 |
| 53 do_test 2.1 { | 55 do_test 2.1 { |
| 54 execsql { | 56 execsql { |
| 55 CREATE VIRTUAL TABLE t2 USING fts4(order=DESC); | 57 CREATE VIRTUAL TABLE t2 USING fts4(order=DESC); |
| 56 } | 58 } |
| 57 set num [list one two three four five six seven eight nine ten] | 59 set num [list one two three four five six seven eight nine ten] |
| 58 execsql BEGIN | 60 execsql BEGIN |
| 59 for {set i 0} {$i < 10000} {incr i} { | 61 for {set i 0} {$i < 10000} {incr i} { |
| 60 set x "[lindex $num [expr $i%10]] zero" | 62 set x "[lindex $num [expr $i%10]] zero" |
| 61 execsql { INSERT INTO t2(docid, content) VALUES($i, $x) } | 63 execsql { INSERT INTO t2(docid, content) VALUES($i, $x) } |
| 62 } | 64 } |
| 63 execsql COMMIT | 65 execsql COMMIT |
| 64 execsql { INSERT INTO t2(t2) VALUES('optimize') } | 66 execsql { INSERT INTO t2(t2) VALUES('optimize') } |
| 65 } {} | 67 } {} |
| 66 | 68 |
| 67 do_execsql_test 2.2 { | 69 do_execsql_test 2.2 { |
| 68 SELECT count(*) FROM t2 WHERE t2 MATCH '"never zero"' | 70 SELECT count(*) FROM t2 WHERE t2 MATCH '"never zero"' |
| 69 } {0} | 71 } {0} |
| 70 | 72 |
| 71 do_execsql_test 2.3 { | 73 do_execsql_test 2.3 { |
| 72 SELECT count(*) FROM t2 WHERE t2 MATCH '"two zero"' | 74 SELECT count(*) FROM t2 WHERE t2 MATCH '"two zero"' |
| 73 } {1000} | 75 } {1000} |
| 74 | 76 |
| 75 finish_test | 77 finish_test |
| OLD | NEW |