Roadmap 0.10, Performance roadmap — wave 3
PERF.43 Website: Library search is LIKE '%q%' on four columns while an unused FULLTEXT index sits on exactly those columns
LibraryItems.php:200 browseWhere runs (i.name LIKE ? OR i.maker LIKE ? OR i.model LIKE ? OR i.description LIKE ?) with %q%; the schema has ft_search (name, maker, model, description) and sys.schema_unused_indexes lists it. EXPLAIN: 52 ms scanning 13,846 rows today versus 16 ms with MATCH … AGAINST ('door' IN BOOLEAN MODE) reading 1,324 rows from the index; at 1 M items about 3.7 s versus tens of ms. Fix: for queries of three or more characters use MATCH(i.name, i.maker, i.model, i.description) AGAINST (? IN BOOLEAN MODE) with +word* terms, keep LIKE for one or two character queries and as OR i.model LIKE ? for part numbers (innodb_ft_min_token_size is 3); the ngram parser later for CJK names. The same path serves /api/v1/library/items?q=.
Community comments
No comments yet
Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.
Sign in or create a free account to add a comment.