View Issue Details

IDProjectCategoryView StatusLast Update
0014658MMW 5DB / Backuppublic2018-10-26 01:21
ReporterLudek Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status closedResolutionreopened 
Product Version5.0 
Target Version5.0Fixed in Version5.0 
Summary0014658: SQLite: Upgrade full-text search engine from FTS3 to FTS5
DescriptionAs suggested by Jiri, we should try upgrade FTS3 to FTS5 as it seems to have some advantages, namely FTS5 should be faster and less memory consuming.
TagsNo tags attached.
Fixed in build2130

Activities

jiri

2018-03-06 12:22

administrator   ~0049668

Note that it should particularly let us make the MM.DB file smaller.

Ludek

2018-04-25 12:43

developer   ~0050111

Updated SQLite to v3.23.1 in build 2102
FTS3 -> FTS5 update is TODO

Ludek

2018-04-26 14:39

developer   ~0050128

Last edited: 2018-04-26 14:43

Tested db size:

Rusty's DB (19k tracks):
- without FTS5/FTS3: 190MB
- with FTS3: 208 MB
- with FTS5: 208 MB

My DB (9k tracks):
- without FTS5/FTS3: 25MB
- with FTS3: 38 MB
- with FTS5: 38 MB

I run VACUUM after all tests

So it doesn't seem to improve DB size so far.

Ludek

2018-04-26 15:33

developer   ~0050129

Last edited: 2018-04-26 16:07

The size should be reduced using content tables references:
https://www.sqlite.org/fts5.html
4.4.2. External Content Tables

Ludek

2018-04-26 16:07

developer   ~0050130

Last edited: 2018-04-26 18:18

Using content table reference:

My DB (9k tracks):
- without FTS5/FTS3: 25 MB
- FTS3: 38 MB
- FTS5 (with content table reference): 28 MB
- FTS4 (with content table reference): 29 MB

Disadvantage of FTS5 is that unlike FTS3/4 it no longer supports '-' operator for not (excluding token) and the meaning of the operator is different (excludes column names). i.e. we can no longer use 'A -B' to find files with A and NOT B

Because FTS4 is just extension of FTS3 (more compatible and thoroughly tested) and supports content table references to reduce the DB size then I would prefer using FTS4 for now (MM5) and try FTS5 later (and/or in MMS app).

Another reason is that the default FTS5 tokenizer (unicode61) cannot find 'Straße' when searching for 'Strasse'. i.e. we would need to use our tokenizer anyway.

=>

Upgraded to FTS4 in build 2102.

Test note: You will need to run 'Manage database' either with:
[x] Rebuild full text search index
[x] Optimize database (to reduce the db size)
or
[x] Rebuild database

Or newly created DB uses FTS4

peke

2018-10-19 02:20

developer   ~0051388

Due the incompatibility to MMW library FTS and as we talked offline, we should do Auto Rebuild of FTS on First MM5 start and MMW library is used or wait till we move/switch settings to different location as described in #15162 as then there will be no need to keep existing FTS?

Left for you to triage.

Ludek

2018-10-19 08:23

developer   ~0051392

Last edited: 2018-10-19 10:03

I've just actually found that the FTS is already re-created during MM4 > MM5 DB upgrade - - because of adding new custom fields (custom6, ..., custom10)
I've just added SQLite's VACUUM that reduces the DB size, based on my test
MM4 database (9K tracks) reduced from 33 MB to 23 MB during MM4 > MM5 DB upgrade

Fixed in 5.0.0.2130

peke

2018-10-26 01:21

developer   ~0051470

Verified 2130