Details
-
Improvement
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
None
-
Query Optimization
Description
Right now when we do an update the index layer gets the pre- and post-image document of the update. Then it will extract keys from both and perform a symmetric set difference to see which keys need to be added or removed updated in the index. And it does this for each index. This is wasteful for two reasons:
1. We should be able to completely skip over indexes of fields that didn't change.
2. For indexes that cover multiple paths independently (eg wildcard and columnar, but not text), they can completely skip over fields that they know didn't change.
Since most updates don't update most fields, most of the index work we do on updates is wasteful work to detect which fields didn't change.