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

Side by Side Diff: third_party/sqlite/src/ext/fts5/tool/fts5speed.tcl

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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
OLDNEW
(Empty)
1
2
3 set Q {
4 {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron'"}
5 {25 "SELECT count(*) FROM t1 WHERE t1 MATCH 'hours'"}
6 {300 "SELECT count(*) FROM t1 WHERE t1 MATCH 'acid'"}
7 {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'loaned OR mobility OR popcore OR sunk'"}
8 {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron AND myapps'"}
9 {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'en* AND my*'"}
10
11 {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'c:t*'"}
12 {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'a:t* OR b:t* OR c:t* OR d:t* OR e:t* OR f:t* OR g:t*'"}
13 {1 "SELECT count(*) FROM t1 WHERE t1 MATCH 'a:t*'"}
14 {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'c:the'"}
15
16 {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes OR e:holmes OR f:holmes OR g:holmes'" }
17 {2 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes AND e:holmes AND f:holm es AND g:holmes'" }
18 {4 "SELECT count(*) FROM t1 WHERE t1 MATCH 'd:holmes NOT e:holmes'" }
19 }
20
21 proc usage {} {
22 global Q
23 puts stderr "Usage: $::argv0 DATABASE QUERY"
24 puts stderr ""
25 for {set i 1} {$i <= [llength $Q]} {incr i} {
26 puts stderr " $i. [lindex $Q [expr $i-1]]"
27 }
28 puts stderr ""
29 exit -1
30 }
31
32
33 set nArg [llength $argv]
34 if {$nArg!=2 && $nArg!=3} usage
35 set database [lindex $argv 0]
36 set iquery [lindex $argv 1]
37 if {$iquery<1 || $iquery>[llength $Q]} usage
38 set nRepeat 0
39 if {$nArg==3} { set nRepeat [lindex $argv 2] }
40
41
42 sqlite3 db $database
43 catch { load_static_extension db fts5 }
44
45 incr iquery -1
46 set sql [lindex $Q $iquery 1]
47 if {$nRepeat==0} {
48 set nRepeat [lindex $Q $iquery 0]
49 }
50
51 puts "sql: $sql"
52 puts "nRepeat: $nRepeat"
53 if {[regexp matchinfo $sql]} {
54 sqlite3_fts5_register_matchinfo db
55 db eval $sql
56 } else {
57 puts "result: [db eval $sql]"
58 }
59
60 for {set i 1} {$i < $nRepeat} {incr i} {
61 db eval $sql
62 }
63
64
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5vocab.test ('k') | third_party/sqlite/src/ext/fts5/tool/fts5txt2db.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698