OpenSearch/plugin
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
..
bwc Relax remote check for bwc project checkouts (elastic/x-pack-elasticsearch#3924) 2018-02-13 14:54:38 -06:00
core Cache number of live documents with document-level security. (elastic/x-pack-elasticsearch#4255) 2018-04-12 09:12:16 +02:00
deprecation Add migration check for deprecated `delimited_payload_filter` (elastic/x-pack-elasticsearch#4310) 2018-04-06 13:41:00 +02:00
graph [TEST] Add deterministic routing of docs to shards to prevent 2018-02-19 15:46:51 +00:00
logstash [Logstash][Monitoring] Fix Registered Usage and Add Tests (elastic/x-pack-elasticsearch#4075) 2018-03-08 14:53:05 -08:00
ml [ML] Improve comment on why task is marked completed on kill process 2018-04-10 13:36:13 +01:00
monitoring Adjust to decoupling TimeValue from Writeable (elastic/x-pack-elasticsearch#4338) 2018-04-11 14:58:19 -06:00
rollup [Rollup] Rename job config `size` to `page_size` (elastic/x-pack-elasticsearch#4309) 2018-04-10 13:34:40 -07:00
security Remove legacy mapping code. (elastic/x-pack-elasticsearch#4258) 2018-04-11 08:43:52 +02:00
sql Adjust to decoupling TimeValue from Writeable (elastic/x-pack-elasticsearch#4338) 2018-04-11 14:58:19 -06:00
src/test [Rollup] Rename job config `size` to `page_size` (elastic/x-pack-elasticsearch#4309) 2018-04-10 13:34:40 -07:00
upgrade Disable security for trial licenses by default (elastic/x-pack-elasticsearch#4120) 2018-03-21 21:09:44 -06:00
watcher Adjust to decoupling TimeValue from Writeable (elastic/x-pack-elasticsearch#4338) 2018-04-11 14:58:19 -06:00
build.gradle Disable security for trial licenses by default (elastic/x-pack-elasticsearch#4120) 2018-03-21 21:09:44 -06:00