[SERVER-904] make stats() work Created: 09/Dec/09  Updated: 12/Jul/16  Resolved: 27/Jan/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 1.3.5

Type: Improvement Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by auto [ 27/Jan/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: sharding: Don't use count() for stats() SHARDING-59
http://github.com/mongodb/mongo/commit/721a702f47851de39a7b4da32574937ef28f79d5

Comment by Eliot Horowitz (Inactive) [ 27/Jan/10 ]

stats should be fast - and therefore not use the slow (correct) count

Comment by auto [ 27/Jan/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Sharded db.c.stats() SHARDING-59
http://github.com/mongodb/mongo/commit/8a52d0120ff7d57039eaf451ff30a8e71a7213f4

Comment by Mathias Stearn [ 27/Jan/10 ]

Currently using the count command to get an accurate result. Since sharded count() is very slow on large collections maybe this should just sum the individual counts and use that as a "good enough" result.

Comment by Eliot Horowitz (Inactive) [ 27/Jan/10 ]

I think it should do both.
So return a map from shard -> stats and an aggregation.

Comment by Mathias Stearn [ 27/Jan/10 ]

Should size and storageSize simply sum the values from the shards or should it try to take migrating data into account?

Generated at Thu Feb 08 02:55:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.