[SERVER-1136] Online defragCollection command Created: 19/May/10  Updated: 06/Dec/22  Resolved: 01/Jun/18

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

Type: New Feature Priority: Major - P3
Reporter: Mathias Stearn Assignee: Backlog - Storage Execution Team
Resolution: Duplicate Votes: 38
Labels: nyc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-2120 Inplace compaction Closed
Related
related to SERVER-2120 Inplace compaction Closed
is related to SERVER-5514 Data not balanced accross all the sha... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

This would be useful to compact a collection after removing large fields.

I think the best procedure would be to clone the collection, then replay the oplog onto the new collection, and finally do an atomic collection rename to replace the original.



 Comments   
Comment by Ian Whalen (Inactive) [ 01/Jun/18 ]

This was implemented in 1.9.0 as tracked in SERVER-2120.

Comment by Nicolas Fouché [ 20/May/10 ]

We're going to remove fields that take half the size of each document. And later probably other fields, for a total reduction of 80%. So.. we would love this feature.

Right now, to compact data, we know these solutions:

  • copying the collection (even within the same database), works for us as we have a lot of "little" collections.
  • repairing the database => offline
  • cloning the database, and use this clone as a new master ? => offline only during the switch
Generated at Thu Feb 08 02:56:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.