$hint for Aggregations via C#

57 views
Skip to first unread message

Mark Shaw

unread,
Jan 12, 2015, 9:39:58 AM1/12/15
to mongod...@googlegroups.com
MONGODB: 2.6.4

We are having inconsistent performance withone collection and it appears to be due to selection of an less optimal index. If I clear the query plans, performance returns to normal. Unfortunately, this is occurring multiple times a day, even with have an job that clears the plans every five minutes. (hack).

Is it possible to provide the $hint for aggregations via c# as a workaround?


Will Berkeley

unread,
Jan 12, 2015, 10:42:33 AM1/12/15
to mongod...@googlegroups.com
There's presently (MongoDB 2.6) no way to $hint an aggregation pipeline; the request for this feature is SERVER-7944. As mentioned in that ticket, you can use index filters to control index selection in an aggregation pipeline if the pipeline begins with a $match.

I'd also suggest providing more details about the pipeline and the suboptimal index selection to the list and we'll see if we have any other advice for your particular problem. Please include the offending pipeline, an explain, a sample document, and the version of the C# driver.

-Will
Reply all
Reply to author
Forward
0 new messages