Closed missinglink closed 2 years ago
I would like to merge this, I'll write up a better description, @orangejulius how are we feeling about this, do you have any testing feedback to add to the ticket for posterity?
@missinglink this has been working great in Geocode Earth production, so I think it's ready :)
this PR is a solution for https://github.com/pelias/placeholder/issues/209
There are two forms of token matching within this codebase: 1) traditional
x = y
string matching using a SQLite index over thetokens
table 2) using theMATCH
keyword to check for equality of tokens using the FTS5 extension of SQLite on thefulltext
table (which is a shadow oftokens
with a different internal format)These two methods have differing performance characteristics, it's preferable to use the
MATCH
method for prefix matching as it has significantly better performance than usingLIKE x%
on the traditional index.It turns out, despite the additional
JOIN
, that theMATCH
syntax is actually more performant than=
on full token matching too, at least in this case.