-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Milestone
Description
The o_XXX collection for holding ops has an index on {src: 1, seq: 1, v: 1}. Since this index points to every single op, it's pretty big. However, from what I can tell, its only use is to differentiate between slightly different errors when getting a document creation error, and it won't be needed for most of the time under "happy" conditions.
It seems pretty mad to have an entire index just for this corner case, but there we are. I was wondering if we could at least contain the index size by doing something like:
- Making the index sparse
- Adding a mechanism for clients to "tidy up", like a disconnection hook or similar. Given that
srcis a transient value meant to be unique per client, once a client disconnects we could potentiallynullall of thesrcfields on the ops they've touched in their session (could be expensive?), which would then release them from the index (I think? Not 100% sure this is how Mongo handles sparse indexes). Should note that clients now have a stablesrcbetween reconnects, so handling a "true" disconnect may be tricky?
I don't know if there's anything else we can do about this? Like change how ShareDB acts upstream?
Metadata
Metadata
Assignees
Labels
No labels