SQLite

Check-in [2c0b93553e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the fts5speed.tcl script to ext/fts5/tool/.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | fts5-offsets
Files: files | file ages | folders
SHA1: 2c0b93553ebb00a70c611eb8dac021877933f088
User & Date: dan 2016-01-11 18:23:07.397
Context
2016-01-11
18:30
Merge trunk with this branch. (check-in: a73d245f2e user: dan tags: fts5-offsets)
18:23
Add the fts5speed.tcl script to ext/fts5/tool/. (check-in: 2c0b93553e user: dan tags: fts5-offsets)
17:30
Fix bugs in fts5 synonym processing for detail=col and other modes. (check-in: 0e3c545423 user: dan tags: fts5-offsets)
Changes
Unified Diff Ignore Whitespace Patch
Added ext/fts5/tool/fts5speed.tcl.






















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


set Q {
  {1   "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron'"}
  {25  "SELECT count(*) FROM t1 WHERE t1 MATCH 'hours'"}
  {300 "SELECT count(*) FROM t1 WHERE t1 MATCH 'acid'"}
  {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'loaned OR mobility OR popcore OR sunk'"}
  {100 "SELECT count(*) FROM t1 WHERE t1 MATCH 'enron AND myapps'"}
  {1   "SELECT count(*) FROM t1 WHERE t1 MATCH 'en* AND my*'"}

  {1   "SELECT count(*) FROM t1 WHERE t1 MATCH 'c:t*'"}
  {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*'"}
  {1   "SELECT count(*) FROM t1 WHERE t1 MATCH 'a:t*'"}
}

proc usage {} {
  global Q
  puts stderr "Usage: $::argv0 DATABASE QUERY"
  puts stderr ""
  for {set i 1} {$i <= [llength $Q]} {incr i} {
    puts stderr "       $i. [lindex $Q [expr $i-1]]"
  }
  puts stderr ""
  exit -1
}


set nArg [llength $argv]
if {$nArg!=2 && $nArg!=3} usage
set database [lindex $argv 0]
set iquery [lindex $argv 1]
if {$iquery<1 || $iquery>[llength $Q]} usage
set nRepeat 0
if {$nArg==3} { set nRepeat [lindex $argv 2] }


sqlite3 db $database
catch { load_static_extension db fts5 }

incr iquery -1
set sql [lindex $Q $iquery 1]
if {$nRepeat==0} {
  set nRepeat [lindex $Q $iquery 0]
}

puts "sql:     $sql"
puts "nRepeat: $nRepeat"
if {[regexp matchinfo $sql]} {
  sqlite3_fts5_register_matchinfo db
  db eval $sql 
} else {
  puts "result:  [db eval $sql]"
}

for {set i 1} {$i < $nRepeat} {incr i} {
  db eval $sql
}