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.