-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
@rmuir had this clever idea: because of how we compress things, Lucene's codec knows when a given doc values field is always constant, and we could use this to know that _version is always 0, and do sizable optimizations like skip the per-doc _uid lookup during indexing, don't record version in the live version map (though we still use it for e.g. real-time get, see #19787 and #19813).
This could be a nice solution because it wouldn't require any configuration on the user's part to state that they will not use optimistic concurrency features: the engine would just notice and be more efficient in this very common case. And if users do use optimistic concurrency features, it would be slower.
But one problem here is the engine automatically increments the version each time a _uid is re-indexed: can we stop doing this auto-increment?