You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anki currently forgets the position/due# of a new card when it is reviewed for the first time. It would be nice to correct this, but as there is no column on the cards table set aside for this purpose, we need to decide where to store it, and consider the implications for syncing and compatibility with other clients/older Anki releases.
The simplest option would be to store the value in JSON in the data column of the cards table. It is not currently used, and was originally added with such extensibility purposes in mind. It is sent as a string in the current syncing protocol, and clients should be leaving it alone currently, so doing it this way should minimize compatibility issues.
JSON is not ideal for performance reasons though, as code like the deck list screen relies on a table scan of it performing relatively well, and the larger the table grows, the longer it takes to scan. We'd need to use something like the following in JSON:
{"pos":123456}
which is 14 bytes. If we instead were storing the value in a protobuf message in a blob, it would be 4 bytes.
But using protobuf at the moment will require changes to the sync protocol, and will likely break older clients if we start storing blob values in the cards table. So I think our only options at the moment are to hold off (which we've been doing for a long time already), or to go with JSON for now, and push a move to protobuf down the line (at the very least, we'll want to wait until AnkiDroid has caught up to the latest rslib).
The text was updated successfully, but these errors were encountered:
Anki currently forgets the position/due# of a new card when it is reviewed for the first time. It would be nice to correct this, but as there is no column on the cards table set aside for this purpose, we need to decide where to store it, and consider the implications for syncing and compatibility with other clients/older Anki releases.
The simplest option would be to store the value in JSON in the
data
column of the cards table. It is not currently used, and was originally added with such extensibility purposes in mind. It is sent as a string in the current syncing protocol, and clients should be leaving it alone currently, so doing it this way should minimize compatibility issues.JSON is not ideal for performance reasons though, as code like the deck list screen relies on a table scan of it performing relatively well, and the larger the table grows, the longer it takes to scan. We'd need to use something like the following in JSON:
{"pos":123456}
which is 14 bytes. If we instead were storing the value in a protobuf message in a blob, it would be 4 bytes.
But using protobuf at the moment will require changes to the sync protocol, and will likely break older clients if we start storing blob values in the cards table. So I think our only options at the moment are to hold off (which we've been doing for a long time already), or to go with JSON for now, and push a move to protobuf down the line (at the very least, we'll want to wait until AnkiDroid has caught up to the latest rslib).
The text was updated successfully, but these errors were encountered: