Show
In src/mongo/db/query/ce/benchmark_test.cpp look for the benchmarked called BucketLargeNumber10HistogramsLargeConjunctions.
Modify it by reducing the number of fields to generate histograms for like so:
runBenchmarks(
{_testInfo.testName(),
1,
kLargeBucketCounts,
{{ "a" , BucketValueType::Int},
{ "b" , BucketValueType::Int},
{ "c" , BucketValueType::Int},
{ "d" , BucketValueType::Int}},
{
{ "a_1" , makeIndexDefinition( "a" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "b_1" , makeIndexDefinition( "b" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "c_1" , makeIndexDefinition( "c" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "d_1" , makeIndexDefinition( "d" , CollationOp::Ascending, true /*isMultiKey*/ )},
{ "e_1" , makeIndexDefinition( "e" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "f_1" , makeIndexDefinition( "f" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "g_1" , makeIndexDefinition( "g" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "h_1" , makeIndexDefinition( "h" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "i_1" , makeIndexDefinition( "i" , CollationOp::Ascending, false /*isMultiKey*/ )},
{ "j_1" , makeIndexDefinition( "j" , CollationOp::Ascending, false /*isMultiKey*/ )},
},
10 /*numPredicates*/ },
"{a: {$gt: 1}, b: {$gt: 10}, c: {$gt: 0}, d: {$elemMatch: {$gt: 10, $lt: 100}}, e: {$lte: "
"80}, f: {$gte: 500}, g: {$eq: 79}, h: {$lt: 11}, i: {gt: 120}, j: {$eq: 44} }" );
}
Compile and run the benchmark:
./build/install/bin/ce_benchmark_test --filter BucketLargeNumber10HistogramsLargeConjunctions