Permalink
Browse files

SERVER-4150 Additional explain deduping tests

  • Loading branch information...
1 parent 0467512 commit b8d0917f1ea8092dadae529751701d9772a4ce81 @astaple astaple committed Mar 14, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 jstests/explain5.js
View
@@ -11,6 +11,20 @@ for( i = 0; i < 10; ++i ) {
t.save( {} );
}
+// Check with a single in order plan.
+
+explain = t.find( {a:{$gt:0}} ).explain( true );
+assert.eq( 1, explain.n );
+assert.eq( 1, explain.allPlans[ 0 ].n );
+
+// Check with a single out of order plan.
+
+explain = t.find( {a:{$gt:0}} ).sort( {z:1} ).hint( {a:1} ).explain( true );
+assert.eq( 1, explain.n );
+assert.eq( 1, explain.allPlans[ 0 ].n );
+
+// Check with multiple plans.
+
explain = t.find( {a:{$gt:0},b:{$gt:0}} ).explain( true );
assert.eq( 1, explain.n );
assert.eq( 1, explain.allPlans[ 0 ].n );

0 comments on commit b8d0917

Please sign in to comment.