Best way for documents retrieval

17 views
Skip to first unread message

Ganesan guna

unread,
Jun 19, 2013, 7:48:46 AM6/19/13
to mongod...@googlegroups.com

Hi ,

 My usecase is to fetch all documents from collection using Java Driver. Collection contains N documents.
 Eg: DBCursor dbc = collection_object.find( dbObjectQuery );

 Which way is better to fetch documents according to performance concern?

 - It is necessity to set batchSize for dbcursor object
 - If yes, what is the size can set to batchSize
 - Can leave empty for default size of 4MB will be better for quick retrieval

Thanks & Regards,
Ganesan G


Asya Kamsky

unread,
Jun 25, 2013, 3:09:07 AM6/25/13
to mongod...@googlegroups.com
Since this highly depends on your document size, network capacity, server, etc. there isn't a clear-cut answer.
Best thing would be for you to benchmark and measure actual performance of your application with different values.

Asya
Reply all
Reply to author
Forward
0 new messages