add missing to benchmark

This commit is contained in:
Pascal Seitz
2026-07-23 12:27:21 +02:00
committed by PSeitz
parent 2d1ddca54d
commit 3e4cb34bfd
2 changed files with 44 additions and 0 deletions
+43
View File
@@ -87,6 +87,7 @@ fn bench_agg(mut group: InputGroup<Index>) {
register!(group, terms_many_with_avg_sub_agg);
register!(group, terms_status_with_avg_sub_agg);
register!(group, nested_terms_status_and_zipf_1000);
register!(group, nested_terms_status_and_zipf_1000_with_missing);
register!(group, nested_terms_zipf_1000_and_status);
register!(group, nested_terms_many_and_zipf_1000);
register!(group, nested_terms_many_and_zipf_1000_and_status);
@@ -115,6 +116,11 @@ fn bench_agg(mut group: InputGroup<Index>) {
multi_terms_status_and_zipf_1000,
multi_terms_status_and_zipf_1000_filtered
);
register!(
group,
multi_terms_status_and_zipf_1000_with_missing,
multi_terms_status_and_zipf_1000_with_missing_filtered
);
register!(
group,
multi_terms_zipf_1000_and_status,
@@ -431,6 +437,26 @@ fn nested_terms_status_and_zipf_1000(index: &Index) {
execute_agg(index, agg_req);
}
fn nested_terms_status_and_zipf_1000_with_missing(index: &Index) {
let agg_req = json!({
"my_texts": {
"terms": {
"field": "text_few_terms_status",
"missing": "MISSING_STATUS"
},
"aggs": {
"nested_terms": {
"terms": {
"field": "text_1000_terms_zipf",
"missing": "MISSING_ZIPF"
}
}
}
}
});
execute_agg(index, agg_req);
}
fn nested_terms_zipf_1000_and_status(index: &Index) {
let agg_req = json!({
"my_texts": {
@@ -717,6 +743,23 @@ define_multi_terms_benchmark!(
}),
);
define_multi_terms_benchmark!(
/// multi_terms equivalent of nested_terms_status_and_zipf_1000_with_missing.
multi_terms_status_and_zipf_1000_with_missing,
multi_terms_status_and_zipf_1000_with_missing_filtered,
json!({
"mt": {
"multi_terms": {
"terms": [
{"field": "text_few_terms_status", "missing": "MISSING_STATUS"},
{"field": "text_1000_terms_zipf", "missing": "MISSING_ZIPF"}
],
"size": 100
}
}
}),
);
define_multi_terms_benchmark!(
/// multi_terms equivalent of nested_terms_zipf_1000_and_status:
/// flat GroupBy(zipf_1000, status) vs nested terms(zipf_1000) -> terms(status)
@@ -291,6 +291,7 @@ impl OptionalIndex {
doc_ids_out: &mut Vec<DocId>,
row_ids_out: &mut Vec<RowId>,
) {
// TODO: change the API to require sorted input, and remove the fallback.
if !doc_ids.is_sorted() {
for &doc_id in doc_ids {
if let Some(row_id) = self.rank_if_exists(doc_id) {