From 6364457d9ea7ee35c1d477c03dfe9108e1763c87 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 8 Apr 2026 19:07:48 +0900 Subject: [PATCH] docs/database: add some notes about `elementId` embeddings --- docs/database.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/database.md b/docs/database.md index ce9b08e..5f4047e 100644 --- a/docs/database.md +++ b/docs/database.md @@ -11,6 +11,8 @@ but it is easier to be able to refer to the entries without a composite foreign (NOTE: `entryId` is now inferred from `elementId` within sqlite using a generated column, so saying it is "stored in a separate field" might be a stretch) +In addition, the reading element id's are added with `1000000000` to make them unique from the kanji element id's. This reduces the amount of space needed for indices in some locations, because you can simply filter out each part with `>` or `<`. + We used to generate the `elementId` separately from `orderNum` as a sequential id, but it lead to all values shifting whenever the data was updated, leading to very big diffs. Making it be a unique composite of data coming from the source data itself means that the values will be stable across updates.