0

I made an analysis on capped collection, I found that there is no performance improvement in capped collection. I created a collection named test1 with 20,000 data, I did copyTo test2 with same data which is capped true with data size specified. I gave the following queries to examine the performance

 db.test1.find( { $query: { "group" : "amazonTigers"}, $explain: 1 } ).pretty()


 db.test2.find( { $query: { "group" : "amazonTigers"}, $explain: 1 } ).pretty()

 Both result in the same response time as 124ms...
  1. More Over, I dont understand how the capped collection works???

  2. I read through lots of blogs, But am not able to find the correct working principle of mongo capped collection.

  3. I read through the disadvantages of capped collection, Its given like we are not able to use $set and $push in it. Is there any other disadvantages there in capped collection for the specified collection entries???

Regards, Harry

Harry
  • 3,072
  • 6
  • 43
  • 100
  • What is your use case? What don't you understand about capped collections? Have you read the official docs(http://docs.mongodb.org/manual/core/capped-collections/)? – joao Feb 17 '14 at 07:06
  • ya I did, joao, Normally the mongodb uses the index parameter to function efficiently.. What happens in capped collections, How we are saying that its functioning properly? – Harry Feb 17 '14 at 07:36
  • test1 collection is not capped, test2 collection is capped, But both returns the data in the same speed... So whats so spl about capped collection? Am planning to improve the mongo queries for performance... So Read about capped collection to use in my codes... But i dont find any efficiency in capped collection...\ – Harry Feb 17 '14 at 07:38
  • In that case why should the query to the capped collection perform better? If you don't have any indexes both will do a full collection scan, which will probably result in the same running time. – joao Feb 17 '14 at 07:47
  • 2
    Let me be more clear: Capped collections perform better if you take advantage of the natural sorting (without index) and/or the high throughput operations like inserts/updates/retrieves/deletes. For queries like the one you did their efficiency should be about the same. Also, as you already know, capped collections have some drawbacks due to its nature. So unless you fall into the case I described above (and the drawbacks don't affect your use cases) you should use normal collections. – joao Feb 17 '14 at 07:57

0 Answers0