OpenSearch/plugin/core
Adrien Grand 98815655c1 Cache number of live documents with document-level security. (elastic/x-pack-elasticsearch#4255)
Currently numDocs() is computed lazily, but this doesn't help since
BaseCompositeReader calls numDocs() on its sub readers eagerly. This may cause
performance issues since every time we wrap a reader with DocumentSubSetReader
(which means for every query when DLS is enabled) we need to recompute the
number of live documents, which runs in linear time with the number of matches
of the role query.

Not computing numDocs() eagerly in DocumentSubSetReader might help, but it
would also be fragile since callers of this method still usually assume that
it runs in constant time. So I am proposing that we add a cache of the number
of live docs in order to decrease the performance hit of document-level
security. I would expect this cache to be efficient as it will not only reuse
entries in-between refreshes, but also across refreshes for segments that
haven't received any new updates.

Original commit: elastic/x-pack-elasticsearch@5a3af1b174
2018-04-12 09:12:16 +02:00
..
licenses Build: Fix third party audit task for xpack core (elastic/x-pack-elasticsearch#3656) 2018-01-22 22:58:34 -08:00
src Cache number of live documents with document-level security. (elastic/x-pack-elasticsearch#4255) 2018-04-12 09:12:16 +02:00
build.gradle Remove license key leniency (elastic/x-pack-elasticsearch#4277) 2018-04-03 13:45:07 -04:00
snapshot.key Build: Remove public license key and inject it during release builds (elastic/x-pack-elasticsearch#3916) 2018-03-20 22:06:05 -07:00