pyr / cyanite

cyanite stores your metrics
http://cyanite.io
Other
446 stars 79 forks source link

Improvement/switch tokeniser #256

Closed ifesdjeen closed 7 years ago

ifesdjeen commented 7 years ago

I was wrong about tokeniser. I've made some wrong assumptions and implemented it wrong the first time. New implementation actually works and supposedly has to yield a much better performance when tokeniser is installed.

Unfortunately, tokeniser has to be packaged with Cassandra and provided as a jar, otherwise we wont't be able to benefit from it.

The way it works is we're searching by every part separately. This has to yield a better performance and much less filtering.

Please note that this is WIP: benchmarks, comparison and deeper analysis will come later. Also, docs and configuration description.

ifesdjeen commented 7 years ago

Token tree before:

00000000  00 02 61 62 ff ff 00 08  69 6e 74 65 72 6e 61 6c  |..ab....internal|
00000010  00 2d 69 6e 74 65 72 6e  61 6c 2e 63 79 61 6e 69  |.-internal.cyani|
00000020  74 65 2e 77 72 69 74 65  72 2e 73 74 6f 72 61 67  |te.writer.storag|
00000030  65 2e 73 69 6e 67 6c 65  2e 73 74 64 64 65 76 00  |e.single.stddev.|
00000040  08 69 6e 74 65 72 6e 61  6c 00 04 72 6f 6f 74 00  |.internal..root.|
00000050  06 50 52 45 46 49 58 00  00 00 00 00 00 00 00 00  |.PREFIX.........|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  00 00 00 4e 00 00 00 0f  00 26 00 45 00 6b 00 97  |...N.....&.E.k..|
00001010  00 bd 00 e9 01 18 01 4d  01 7b 01 af 01 ca 01 ef  |.......M.{......|
00001020  02 1b 02 3b 02 59 02 84  02 b5 02 e5 03 0f 03 3f  |...;.Y.........?|
00001030  03 6e 03 90 03 b7 03 e8  04 14 04 3f 04 6c 04 98  |.n.........?.l..|
00001040  04 c3 04 f8 05 28 05 57  05 88 05 b8 05 e0 06 13  |.....(.W........|
00001050  06 50 06 88 06 bf 06 f8  07 30 07 6f 07 b8 07 fc  |.P.......0.o....|
00001060  08 3f 08 84 08 c8 08 fa  09 36 09 6d 09 a3 09 db  |.?.......6.m....|
00001070  0a 12 0a 48 0a 88 0a c3  0a fd 0b 39 0b 74 0b a7  |...H.......9.t..|
00001080  0b e4 0c 1c 0c 53 0c 8c  0c c4 0c fe 0d 42 0d 81  |.....S.......B..|
00001090  0d bf 0d ff 0e 3e 0e 66  0e 98 0e c5 0e f1 0f 1e  |.....>.f........|
000010a0  00 08 69 6e 74 65 72 6e  61 6c 00 00 00 00 00 00  |..internal......|
000010b0  10 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |.internal.cyanit|
000010c0  65 00 00 00 00 50 00 18  69 6e 74 65 72 6e 61 6c  |e....P..internal|
000010d0  2e 63 79 61 6e 69 74 65  2e 69 6e 67 65 73 74 71  |.cyanite.ingestq|
000010e0  00 00 00 00 a0 00 1f 69  6e 74 65 72 6e 61 6c 2e  |.......internal.|
000010f0  63 79 61 6e 69 74 65 2e  69 6e 67 65 73 74 71 2e  |cyanite.ingestq.|
00001100  65 72 72 6f 72 73 00 00  00 00 f0 00 25 69 6e 74  |errors......%int|
00001110  65 72 6e 61 6c 2e 63 79  61 6e 69 74 65 2e 69 6e  |ernal.cyanite.in|
00001120  67 65 73 74 71 2e 65 72  72 6f 72 73 2e 63 6f 75  |gestq.errors.cou|
00001130  6e 74 00 00 00 01 40 00  1f 69 6e 74 65 72 6e 61  |nt....@..interna|
00001140  6c 2e 63 79 61 6e 69 74  65 2e 69 6e 67 65 73 74  |l.cyanite.ingest|
00001150  71 2e 65 76 65 6e 74 73  00 00 00 01 90 00 25 69  |q.events......%i|
00001160  6e 74 65 72 6e 61 6c 2e  63 79 61 6e 69 74 65 2e  |nternal.cyanite.|
00001170  69 6e 67 65 73 74 71 2e  65 76 65 6e 74 73 2e 63  |ingestq.events.c|
00001180  6f 75 6e 74 00 00 00 01  e0 00 28 69 6e 74 65 72  |ount......(inter|
00001190  6e 61 6c 2e 63 79 61 6e  69 74 65 2e 69 6e 67 65  |nal.cyanite.inge|
000011a0  73 74 71 2e 65 76 65 6e  74 73 2e 69 6e 67 65 73  |stq.events.inges|
000011b0  74 65 64 00 00 00 02 30  00 2e 69 6e 74 65 72 6e  |ted....0..intern|
000011c0  61 6c 2e 63 79 61 6e 69  74 65 2e 69 6e 67 65 73  |al.cyanite.inges|
000011d0  74 71 2e 65 76 65 6e 74  73 2e 69 6e 67 65 73 74  |tq.events.ingest|
000011e0  65 64 2e 63 6f 75 6e 74  00 00 00 02 80 00 27 69  |ed.count......'i|
000011f0  6e 74 65 72 6e 61 6c 2e  63 79 61 6e 69 74 65 2e  |nternal.cyanite.|
00001200  69 6e 67 65 73 74 71 2e  65 76 65 6e 74 73 2e 77  |ingestq.events.w|
00001210  72 69 74 74 65 6e 00 00  00 02 d0 00 2d 69 6e 74  |ritten......-int|
00001220  65 72 6e 61 6c 2e 63 79  61 6e 69 74 65 2e 69 6e  |ernal.cyanite.in|
00001230  67 65 73 74 71 2e 65 76  65 6e 74 73 2e 77 72 69  |gestq.events.wri|
00001240  74 74 65 6e 2e 63 6f 75  6e 74 00 00 00 03 20 00  |tten.count.... .|
00001250  14 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |.internal.cyanit|
00001260  65 2e 6a 76 6d 00 00 00  03 70 00 1e 69 6e 74 65  |e.jvm....p..inte|
00001270  72 6e 61 6c 2e 63 79 61  6e 69 74 65 2e 6a 76 6d  |rnal.cyanite.jvm|
00001280  2e 61 74 74 72 69 62 75  74 65 00 00 00 03 c0 00  |.attribute......|
00001290  25 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |%internal.cyanit|
000012a0  65 2e 6a 76 6d 2e 61 74  74 72 69 62 75 74 65 2e  |e.jvm.attribute.|
000012b0  75 70 74 69 6d 65 00 00  00 04 10 00 19 69 6e 74  |uptime.......int|
000012c0  65 72 6e 61 6c 2e 63 79  61 6e 69 74 65 2e 6a 76  |ernal.cyanite.jv|
000012d0  6d 2e 66 69 6c 65 00 00  00 04 60 00 17 69 6e 74  |m.file....`..int|
000012e0  65 72 6e 61 6c 2e 63 79  61 6e 69 74 65 2e 6a 76  |ernal.cyanite.jv|
000012f0  6d 2e 67 63 00 00 00 04  b0 00 24 69 6e 74 65 72  |m.gc......$inter|
00001300  6e 61 6c 2e 63 79 61 6e  69 74 65 2e 6a 76 6d 2e  |nal.cyanite.jvm.|
00001310  67 63 2e 50 53 2d 4d 61  72 6b 53 77 65 65 70 00  |gc.PS-MarkSweep.|
00001320  00 00 05 00 00 2a 69 6e  74 65 72 6e 61 6c 2e 63  |.....*internal.c|
00001330  79 61 6e 69 74 65 2e 6a  76 6d 2e 67 63 2e 50 53  |yanite.jvm.gc.PS|
00001340  2d 4d 61 72 6b 53 77 65  65 70 2e 63 6f 75 6e 74  |-MarkSweep.count|
00001350  00 00 00 05 50 00 29 69  6e 74 65 72 6e 61 6c 2e  |....P.)internal.|
00001360  63 79 61 6e 69 74 65 2e  6a 76 6d 2e 67 63 2e 50  |cyanite.jvm.gc.P|
00001370  53 2d 4d 61 72 6b 53 77  65 65 70 2e 74 69 6d 65  |S-MarkSweep.time|
00001380  00 00 00 05 a0 00 23 69  6e 74 65 72 6e 61 6c 2e  |......#internal.|
00001390  63 79 61 6e 69 74 65 2e  6a 76 6d 2e 67 63 2e 50  |cyanite.jvm.gc.P|
000013a0  53 2d 53 63 61 76 65 6e  67 65 00 00 00 05 f0 00  |S-Scavenge......|
000013b0  29 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |)internal.cyanit|
000013c0  65 2e 6a 76 6d 2e 67 63  2e 50 53 2d 53 63 61 76  |e.jvm.gc.PS-Scav|
000013d0  65 6e 67 65 2e 63 6f 75  6e 74 00 00 00 06 40 00  |enge.count....@.|
000013e0  28 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |(internal.cyanit|
000013f0  65 2e 6a 76 6d 2e 67 63  2e 50 53 2d 53 63 61 76  |e.jvm.gc.PS-Scav|
00001400  65 6e 67 65 2e 74 69 6d  65 00 00 00 06 90 00 1b  |enge.time.......|
00001410  69 6e 74 65 72 6e 61 6c  2e 63 79 61 6e 69 74 65  |internal.cyanite|
00001420  2e 6a 76 6d 2e 6d 65 6d  6f 72 79 00 00 00 06 e0  |.jvm.memory.....|
00001430  00 20 69 6e 74 65 72 6e  61 6c 2e 63 79 61 6e 69  |. internal.cyani|
00001440  74 65 2e 6a 76 6d 2e 6d  65 6d 6f 72 79 2e 68 65  |te.jvm.memory.he|
00001450  61 70 00 00 00 07 30 00  2a 69 6e 74 65 72 6e 61  |ap....0.*interna|
00001460  6c 2e 63 79 61 6e 69 74  65 2e 6a 76 6d 2e 6d 65  |l.cyanite.jvm.me|
00001470  6d 6f 72 79 2e 68 65 61  70 2e 63 6f 6d 6d 69 74  |mory.heap.commit|
00001480  74 65 64 00 00 00 07 80  00 25 69 6e 74 65 72 6e  |ted......%intern|
00001490  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
000014a0  65 6d 6f 72 79 2e 68 65  61 70 2e 69 6e 69 74 00  |emory.heap.init.|
000014b0  00 00 07 d0 00 24 69 6e  74 65 72 6e 61 6c 2e 63  |.....$internal.c|
000014c0  79 61 6e 69 74 65 2e 6a  76 6d 2e 6d 65 6d 6f 72  |yanite.jvm.memor|
000014d0  79 2e 68 65 61 70 2e 6d  61 78 00 00 00 08 20 00  |y.heap.max.... .|
000014e0  26 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |&internal.cyanit|
000014f0  65 2e 6a 76 6d 2e 6d 65  6d 6f 72 79 2e 68 65 61  |e.jvm.memory.hea|
00001500  70 2e 75 73 61 67 65 00  00 00 08 70 00 25 69 6e  |p.usage....p.%in|
00001510  74 65 72 6e 61 6c 2e 63  79 61 6e 69 74 65 2e 6a  |ternal.cyanite.j|
00001520  76 6d 2e 6d 65 6d 6f 72  79 2e 68 65 61 70 2e 75  |vm.memory.heap.u|
00001530  73 65 64 00 00 00 08 c0  00 24 69 6e 74 65 72 6e  |sed......$intern|
00001540  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
00001550  65 6d 6f 72 79 2e 6e 6f  6e 2d 68 65 61 70 00 00  |emory.non-heap..|
00001560  00 09 10 00 2e 69 6e 74  65 72 6e 61 6c 2e 63 79  |.....internal.cy|
00001570  61 6e 69 74 65 2e 6a 76  6d 2e 6d 65 6d 6f 72 79  |anite.jvm.memory|
00001580  2e 6e 6f 6e 2d 68 65 61  70 2e 63 6f 6d 6d 69 74  |.non-heap.commit|
00001590  74 65 64 00 00 00 09 60  00 29 69 6e 74 65 72 6e  |ted....`.)intern|
000015a0  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
000015b0  65 6d 6f 72 79 2e 6e 6f  6e 2d 68 65 61 70 2e 69  |emory.non-heap.i|
000015c0  6e 69 74 00 00 00 09 b0  00 28 69 6e 74 65 72 6e  |nit......(intern|
000015d0  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
000015e0  65 6d 6f 72 79 2e 6e 6f  6e 2d 68 65 61 70 2e 6d  |emory.non-heap.m|
000015f0  61 78 00 00 00 0a 00 00  2a 69 6e 74 65 72 6e 61  |ax......*interna|
00001600  6c 2e 63 79 61 6e 69 74  65 2e 6a 76 6d 2e 6d 65  |l.cyanite.jvm.me|
00001610  6d 6f 72 79 2e 6e 6f 6e  2d 68 65 61 70 2e 75 73  |mory.non-heap.us|
00001620  61 67 65 00 00 00 0a 50  00 29 69 6e 74 65 72 6e  |age....P.)intern|
00001630  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
00001640  65 6d 6f 72 79 2e 6e 6f  6e 2d 68 65 61 70 2e 75  |emory.non-heap.u|
00001650  73 65 64 00 00 00 0a a0  00 21 69 6e 74 65 72 6e  |sed......!intern|
00001660  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
00001670  65 6d 6f 72 79 2e 70 6f  6f 6c 73 00 00 00 0a f0  |emory.pools.....|
00001680  00 2c 69 6e 74 65 72 6e  61 6c 2e 63 79 61 6e 69  |.,internal.cyani|
00001690  74 65 2e 6a 76 6d 2e 6d  65 6d 6f 72 79 2e 70 6f  |te.jvm.memory.po|
000016a0  6f 6c 73 2e 43 6f 64 65  2d 43 61 63 68 65 00 00  |ols.Code-Cache..|
000016b0  00 0b 40 00 36 69 6e 74  65 72 6e 61 6c 2e 63 79  |..@.6internal.cy|
000016c0  61 6e 69 74 65 2e 6a 76  6d 2e 6d 65 6d 6f 72 79  |anite.jvm.memory|
000016d0  2e 70 6f 6f 6c 73 2e 43  6f 64 65 2d 43 61 63 68  |.pools.Code-Cach|
000016e0  65 2e 63 6f 6d 6d 69 74  74 65 64 00 00 00 0b 90  |e.committed.....|
000016f0  00 31 69 6e 74 65 72 6e  61 6c 2e 63 79 61 6e 69  |.1internal.cyani|
00001700  74 65 2e 6a 76 6d 2e 6d  65 6d 6f 72 79 2e 70 6f  |te.jvm.memory.po|
00001710  6f 6c 73 2e 43 6f 64 65  2d 43 61 63 68 65 2e 69  |ols.Code-Cache.i|
00001720  6e 69 74 00 00 00 0b e0  00 30 69 6e 74 65 72 6e  |nit......0intern|
00001730  61 6c 2e 63 79 61 6e 69  74 65 2e 6a 76 6d 2e 6d  |al.cyanite.jvm.m|
00001740  65 6d 6f 72 79 2e 70 6f  6f 6c 73 2e 43 6f 64 65  |emory.pools.Code|
00001750  2d 43 61 63 68 65 2e 6d  61 78 00 00 00 0c 30 00  |-Cache.max....0.|
00001760  32 69 6e 74 65 72 6e 61  6c 2e 63 79 61 6e 69 74  |2internal.cyanit|
00001770  65 2e 6a 76 6d 2e 6d 65  6d 6f 72 79 2e 70 6f 6f  |e.jvm.memory.poo|
00001780  6c 73 2e 43 6f 64 65 2d  43 61 63 68 65 2e 75 73  |ls.Code-Cache.us|

token tree after:

00000000  00 02 61 62 ff ff 00 0a  43 6f 64 65 2d 43 61 63  |..ab....Code-Cac|
00000010  68 65 00 07 77 72 69 74  74 65 6e 00 08 69 6e 74  |he..written..int|
00000020  65 72 6e 61 6c 00 04 72  6f 6f 74 00 06 50 52 45  |ernal..root..PRE|
00000030  46 49 58 00 00 00 00 00  00 00 00 00 00 00 00 00  |FIX.............|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  00 00 00 3d 00 00 00 11  00 2e 00 3e 00 52 00 65  |...=.......>.R.e|
00001010  00 76 00 88 00 a0 00 b0  00 be 00 ce 00 da 00 e8  |.v..............|
00001020  00 f5 01 04 01 11 01 1e  01 29 01 32 01 3d 01 4c  |.........).2.=.L|
00001030  01 5b 01 69 01 74 01 83  01 8d 01 9c 01 aa 01 b8  |.[.i.t..........|
00001040  01 c2 01 cd 01 dd 01 ea  01 f4 01 fe 02 0d 02 17  |................|
00001050  02 21 02 2b 02 35 02 3f  02 4a 02 55 02 61 02 6d  |.!.+.5.?.J.U.a.m|
00001060  02 7c 02 89 02 94 02 a1  02 af 02 c0 02 cd 02 d8  |.|..............|
00001070  02 ec 02 f8 03 05 03 11  03 1c 03 2a 03 37 00 0a  |...........*.7..|
00001080  43 6f 64 65 2d 43 61 63  68 65 00 00 00 00 00 00  |Code-Cache......|
00001090  16 43 6f 6d 70 72 65 73  73 65 64 2d 43 6c 61 73  |.Compressed-Clas|
000010a0  73 2d 53 70 61 63 65 00  00 00 00 60 00 09 4d 65  |s-Space....`..Me|
000010b0  74 61 73 70 61 63 65 00  00 00 00 c0 00 0d 50 53  |taspace.......PS|
000010c0  2d 45 64 65 6e 2d 53 70  61 63 65 00 00 00 01 20  |-Eden-Space.... |
000010d0  00 0c 50 53 2d 4d 61 72  6b 53 77 65 65 70 00 00  |..PS-MarkSweep..|
000010e0  00 01 80 00 0a 50 53 2d  4f 6c 64 2d 47 65 6e 00  |.....PS-Old-Gen.|
000010f0  00 00 01 e0 00 0b 50 53  2d 53 63 61 76 65 6e 67  |......PS-Scaveng|
00001100  65 00 00 00 02 40 00 11  50 53 2d 53 75 72 76 69  |e....@..PS-Survi|
00001110  76 6f 72 2d 53 70 61 63  65 00 00 00 02 a0 00 09  |vor-Space.......|
00001120  61 74 74 72 69 62 75 74  65 00 00 00 03 00 00 07  |attribute.......|
00001130  62 6c 6f 63 6b 65 64 00  00 00 03 60 00 09 63 6f  |blocked....`..co|
00001140  6d 6d 69 74 74 65 64 00  00 00 03 c0 00 05 63 6f  |mmitted.......co|
00001150  75 6e 74 00 00 00 04 90  00 07 63 79 61 6e 69 74  |unt.......cyanit|
00001160  65 00 00 00 05 e0 00 06  64 61 65 6d 6f 6e 00 00  |e.......daemon..|
00001170  00 08 80 00 08 64 65 61  64 6c 6f 63 6b 00 00 00  |.....deadlock...|
00001180  08 e0 00 06 65 72 72 6f  72 73 00 00 00 09 40 00  |....errors....@.|
00001190  06 65 76 65 6e 74 73 00  00 00 09 a0 00 04 66 69  |.events.......fi|
000011a0  6c 65 00 00 00 0a 20 00  02 67 63 00 00 00 0a 70  |le.... ..gc....p|
000011b0  00 04 68 65 61 70 00 00  00 0a f0 00 08 69 6e 64  |..heap.......ind|
000011c0  65 78 69 6e 67 00 00 00  0b 50 00 08 69 6e 67 65  |exing....P..inge|
000011d0  73 74 65 64 00 00 00 0b  b0 00 07 69 6e 67 65 73  |sted.......inges|
000011e0  74 71 00 00 00 0c 10 00  04 69 6e 69 74 00 00 00  |tq.......init...|
000011f0  0c b0 00 08 69 6e 74 65  72 6e 61 6c 00 00 00 0d  |....internal....|
00001200  80 00 03 6a 76 6d 00 00  00 10 30 00 08 6d 31 35  |...jvm....0..m15|
00001210  5f 72 61 74 65 00 00 00  12 10 00 07 6d 31 5f 72  |_rate.......m1_r|
00001220  61 74 65 00 00 00 12 70  00 07 6d 35 5f 72 61 74  |ate....p..m5_rat|
00001230  65 00 00 00 12 d0 00 03  6d 61 78 00 00 00 13 30  |e.......max....0|
00001240  00 04 6d 65 61 6e 00 00  00 14 20 00 09 6d 65 61  |..mean.... ..mea|
00001250  6e 5f 72 61 74 65 00 00  00 14 80 00 06 6d 65 6d  |n_rate.......mem|
00001260  6f 72 79 00 00 00 14 e0  00 03 6d 69 6e 00 00 00  |ory.......min...|
00001270  15 e0 00 03 6e 65 77 00  00 00 16 40 00 08 6e 6f  |....new....@..no|
00001280  6e 2d 68 65 61 70 00 00  00 16 a0 00 03 70 35 30  |n-heap.......p50|
00001290  00 00 00 17 00 00 03 70  37 35 00 00 00 17 60 00  |.......p75....`.|
000012a0  03 70 39 35 00 00 00 17  c0 00 03 70 39 38 00 00  |.p95.......p98..|
000012b0  00 18 20 00 03 70 39 39  00 00 00 18 80 00 04 70  |.. ..p99.......p|
000012c0  39 39 39 00 00 00 18 e0  00 04 70 6f 6f 6c 00 00  |999.......pool..|
000012d0  00 19 40 00 05 70 6f 6f  6c 73 00 00 00 19 b0 00  |..@..pools......|
000012e0  05 71 75 65 75 65 00 00  00 1a 70 00 08 72 75 6e  |.queue....p..run|
000012f0  6e 61 62 6c 65 00 00 00  1a d0 00 06 73 69 6e 67  |nable.......sing|
00001300  6c 65 00 00 00 1b 30 00  04 73 69 7a 65 00 00 00  |le....0..size...|
00001310  1b 90 00 06 73 74 64 64  65 76 00 00 00 1b e0 00  |....stddev......|
00001320  07 73 74 6f 72 61 67 65  00 00 00 1c 40 00 0a 74  |.storage....@..t|
00001330  65 72 6d 69 6e 61 74 65  64 00 00 00 1c b0 00 06  |erminated.......|
00001340  74 68 72 65 61 64 00 00  00 1d 10 00 04 74 69 6d  |thread.......tim|
00001350  65 00 00 00 1d f0 00 0d  74 69 6d 65 64 5f 77 61  |e.......timed_wa|
00001360  69 74 69 6e 67 00 00 00  1e 50 00 05 74 6f 74 61  |iting....P..tota|
00001370  6c 00 00 00 1e b0 00 06  75 70 74 69 6d 65 00 00  |l.......uptime..|
00001380  00 1f 10 00 05 75 73 61  67 65 00 00 00 1f 60 00  |.....usage....`.|
00001390  04 75 73 65 64 00 00 00  20 20 00 07 77 61 69 74  |.used...  ..wait|
000013a0  69 6e 67 00 00 00 20 f0  00 06 77 72 69 74 65 72  |ing... ...writer|
000013b0  00 00 00 21 50 00 07 77  72 69 74 74 65 6e 00 00  |...!P..written..|
000013c0  00 21 e0 00 00 00 00 00  00 00 00 00 00 00 00 00  |.!..............|
000013d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Of course the trie index would have been better alltogether, but just tokenising correctly already helps to reduce an amount of tokens (which also means seeks). Now, we just query required terms and then merge-iterate partitions, which is much cheaper than the previous version and has to yield more precise results as it doesn't really care about where the * was.