Precalculate search scores with a table and a bunch of triggers #44

Closed
opened 2025-05-19 10:23:14 +02:00 by oysteikt · 2 comments
Owner

The JLPT tags (if deduplicated by picking the lowest common level), are unique to each kanji and reading element. It is often used together with baseScore to order by commonness. Although storing a bunch of more NULLs would increase space consumption, it might speed up search a bit by having the jlpt score added into the precalculated score on these entries.

The JLPT tags (if deduplicated by picking the lowest common level), are unique to each kanji and reading element. It is often used together with `baseScore` to order by commonness. Although storing a bunch of more NULLs would increase space consumption, it might speed up search a bit by having the jlpt score added into the precalculated score on these entries.
Author
Owner

This is not entirely correct. The JLPT tags are set per entry - not per reading/kanji. Need to figure out whether it's worth it to duplicate this data across the reading/kanji tables, or whether I should just make some sort of materialized view for storing query scores instead.

This is not entirely correct. The JLPT tags are set per entry - not per reading/kanji. Need to figure out whether it's worth it to duplicate this data across the reading/kanji tables, or whether I should just make some sort of materialized view for storing query scores instead.
oysteikt changed title from Consider moving JLPT tags to a column on `JMDict_{Kanji/Reading}Element` to Precalculate search scores with a table and a bunch of triggers 2025-05-22 16:04:51 +02:00
Author
Owner

Repurposing this issue, instead of moving all relevant factors into a single table (there might come more from different sources later), let's sum the numbers in a separate table with triggers.

Repurposing this issue, instead of moving all relevant factors into a single table (there might come more from different sources later), let's sum the numbers in a separate table with triggers.
oysteikt added the time-reduction label 2025-05-22 16:24:48 +02:00
oysteikt added this to the Kanban project 2025-06-23 10:33:30 +02:00
oysteikt moved this to Finished in Kanban on 2025-06-23 10:33:49 +02:00
Sign in to join this conversation.