diff options
Diffstat (limited to 'jstests/noPassthrough/lookup_pushdown.js')
-rw-r--r-- | jstests/noPassthrough/lookup_pushdown.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/jstests/noPassthrough/lookup_pushdown.js b/jstests/noPassthrough/lookup_pushdown.js index 22a7806f5d2..0c13dadc16d 100644 --- a/jstests/noPassthrough/lookup_pushdown.js +++ b/jstests/noPassthrough/lookup_pushdown.js @@ -378,6 +378,30 @@ MongoRunner.stopMongod(conn); JoinAlgorithm.HJ, {allowDiskUse: true}); + // Setting the 'internalQueryDisableLookupExecutionUsingHashJoin' knob to true will disable + // HJ plans from being chosen and since the pipeline is SBE compatible it will fallback to + // NLJ. + assert.commandWorked(db.adminCommand({ + setParameter: 1, + internalQueryDisableLookupExecutionUsingHashJoin: true, + })); + + runTest(lcoll, + [{$lookup: {from: fcoll.getName(), localField: "a", foreignField: "a", as: "out"}}], + JoinAlgorithm.NLJ, + {allowDiskUse: true}); + + // Test that we can go back to generating HJ plans. + assert.commandWorked(db.adminCommand({ + setParameter: 1, + internalQueryDisableLookupExecutionUsingHashJoin: false, + })); + + runTest(lcoll, + [{$lookup: {from: fcoll.getName(), localField: "a", foreignField: "a", as: "out"}}], + JoinAlgorithm.HJ, + {allowDiskUse: true}); + // Setting the 'internalQueryCollectionMaxNoOfDocumentsToChooseHashJoin' to count - 1 results in // choosing the NLJ algorithm. assert.commandWorked(db.adminCommand({ |