how to improve aggregation performance

61 views
Skip to first unread message

Pooja

unread,
Mar 1, 2017, 11:58:17 PM3/1/17
to mongodb-user
hi...

I am having collection with 127706 document. In aggregation pipeline i having 2 group stages. It is giving me result in 1.5 sec. 
To optimize it to more i have created index on the fields which i m using in match stages with no success. 
is their any to optimize aggregation performance in more way. i m using mongodb 3.2.1

Ivan Grigolon

unread,
Mar 6, 2017, 2:11:47 AM3/6/17
to mongodb-user

Hi,
can you please post some more details:

  • The OS version you are using, and your driver version (if applicable)
  • How did you measure the 1.5 seconds execution time? Also, does the 1.5 seconds timing remain consistent if you execute the query multiple times?
  • Your provisioned hardware (CPU, RAM size, etc.)
  • The size of the data, please post the output of db.collection.stats() and db.stats()
  • The query that you are running and some example documents
  • Any indexes defined in the collection (i.e. using the command db.collection.getIndexes())

For more information about aggregation pipeline performance improvement, you can find more information in the MongoDB documentation:

Also, you mentioned that you are running MongoDB 3.2.1. Please consider upgrading to the latest version in the 3.2 series (currently 3.2.12). For more information about enhancement and bug fixes of the latest version since MongoDB 3.2.1, please have a look at the release notes.

Best Regards,
Ivan

Reply all
Reply to author
Forward
0 new messages