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
ShareDB stores all operations in collections prefixed with o_. Currently those collections have 3 indexes: _id, documentId + version, src + seq. I think we could have only one index, on _id, which MongoDB always creates automatically.
To keep the most common queries fast, we'd need to update IDs of all operations to this format: <documentId>:<version>:<randomValue>. This way we would not need the separate compound index documentId + version.
The other compound index src + seq is used so rarely that I don't think it's worth having. The code currently using this index could be modified to take advantage of the _id index to reduce the number of docs that would need to be scanned.
The text was updated successfully, but these errors were encountered:
We've had a discussion about this and we agree about src + seq, but think that we can't combine documentId + version without left-padding version (because we need version range lookups). Left-padding feels a bit hacky and fragile, and documentId + version feels like a reasonable index to have, so we'll leave that one as is
ShareDB stores all operations in collections prefixed with
o_
. Currently those collections have 3 indexes:_id
,documentId + version
,src + seq
. I think we could have only one index, on_id
, which MongoDB always creates automatically.To keep the most common queries fast, we'd need to update IDs of all operations to this format:
<documentId>:<version>:<randomValue>
. This way we would not need the separate compound indexdocumentId + version
.The other compound index
src + seq
is used so rarely that I don't think it's worth having. The code currently using this index could be modified to take advantage of the_id
index to reduce the number of docs that would need to be scanned.The text was updated successfully, but these errors were encountered: