|
Author:
{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}
Message: SERVER-8033 Sharded agg should only send needed fields from shards to mongos
*** BEFORE ***
|
|
> db.foo.aggregate([{$sort: {score:1}}, {$limit: 10}, {$project: {_id: 1}}], {explain:true})
|
{
|
"splitPipeline" : {
|
"shardsPart" : [
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"limit" : NumberLong(10)
|
}
|
}
|
],
|
"mergerPart" : [
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"mergePresorted" : true,
|
"limit" : NumberLong(10)
|
}
|
},
|
{
|
"$project" : {
|
"_id" : true
|
}
|
}
|
]
|
},
|
"shards" : {
|
"shard0000" : {
|
"host" : "localhost:30001",
|
"stages" : [
|
{
|
"$cursor" : {
|
"query" : {
|
|
},
|
"indexOnly" : false,
|
"cursorType" : "BasicCursor"
|
}
|
},
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"limit" : NumberLong(10)
|
}
|
}
|
]
|
}
|
},
|
"ok" : 1
|
}
|
|
*** AFTER ***
|
|
> db.foo.aggregate([{$sort: {score:1}}, {$limit: 10}, {$project: {_id: 1}}], {explain:true})
|
{
|
"splitPipeline" : {
|
"shardsPart" : [
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"limit" : NumberLong(10)
|
}
|
},
|
{
|
"$project" : {
|
"score" : true,
|
"_id" : true
|
}
|
}
|
],
|
"mergerPart" : [
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"mergePresorted" : true,
|
"limit" : NumberLong(10)
|
}
|
},
|
{
|
"$project" : {
|
"_id" : true
|
}
|
}
|
]
|
},
|
"shards" : {
|
"shard0000" : {
|
"host" : "localhost:30001",
|
"stages" : [
|
{
|
"$cursor" : {
|
"query" : {
|
|
},
|
"fields" : {
|
"score" : 1,
|
"_id" : 1
|
},
|
"indexOnly" : false,
|
"cursorType" : "BasicCursor"
|
}
|
},
|
{
|
"$sort" : {
|
"sortKey" : {
|
"score" : 1
|
},
|
"limit" : NumberLong(10)
|
}
|
},
|
{
|
"$project" : {
|
"score" : true,
|
"_id" : true
|
}
|
}
|
]
|
}
|
},
|
"ok" : 1
|
}
|
Branch: master
https://github.com/mongodb/mongo/commit/c9fc8a468e1fa9d6421ef35f5a23db0e0f014b4f
|