We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86a4c47 commit 03520a0Copy full SHA for 03520a0
1 file changed
src/aggregation/bucket/term_agg/term_histogram.rs
@@ -217,6 +217,11 @@ pub(super) fn maybe_build_collector(
217
//
218
// We don't cap the term cardinality here: the flat grid is bounded by the total cell count
219
// (`num_terms * num_time_buckets <= MAX_FUSED_GRID_BUCKETS`) checked below, which subsumes it.
220
+ //
221
+ // We only allow this at the top-level, since we don't know how many buckets are created. We
222
+ // are less likely to get enough docs for the preallocation to be worth and there's a risk of
223
+ // using too much memory. We could check the maximum theoretical buckets up-front and pass
224
+ // them down.
225
let fuseable = is_top_level
226
&& terms_req_data.allowed_term_ids.is_none()
227
&& terms_req_data.accessor.get_cardinality().is_full()
0 commit comments