mongodb compact
来源:互联网 发布:windows 媒体播放器 编辑:程序博客网 时间:2024/06/07 06:45
Options
- force:true Because this blocks all other activity (in v2.2, only for its database), the compact command returns an error when invoked on a replica set primary. Use force:true to run on a replica set primary.
- paddingFactor:<pf> (v2.2+). Specify a padding factor for the compacted documents. By default the documents are fully compacted with no padding. If you do updates on the documents which grow them, and especially if you have several indexes for the collection, you will want some padding. Default is 1.0 (no padding), maximum 4.0.
- paddingBytes:<bytes> (v2.2+.) Specify padding as an absolute number of bytes. Can be useful if your documents start at small but then grow a large amount; for example if they start 40 bytes long and then you grow then by 1KB, paddingBytes:1024 might be reasonable whereas paddingFactor:4.0 would only add 40*(4.0-1)=120 bytes of padding.
// example. always add at least 100 bytes of padding, and at least 10% of the doc size too > db.runCommand( { compact : 'mycollectionname', paddingBytes:100, paddingFactor:1.1 } )
At the beginning of compaction, indexes are dropped for the collection. At the end, indexes are rebuilt. Thus, if you kill the compaction in the middle of its operation, either with killOp or a server failure, indexes may be missing from your collection. If you are running with --journal, no data should ever be lost on a crash during compaction, although on startup the indexes will not be present. (Regardless of this, always do a backup before system maintenance such as this!) When the indexes are rebuilt, they will be in the 2.0 index format.
If there's a crash while the command is running, then as long as journaling is enabled, your data will be safe.
Additionally, if a compaction operation is interrupted, much of the existing free space in a collection may become un-reusable. In this scenario, it is recommended that compaction be run again, to completion, to restore use of this free space
主要说的是索引在执行中,会重建,如果意外终止,会丢失数据,不过如果开启了journal,数据相对来说安全很多,还有就是空闲空间会变成不能重用,需要再次执行compact,恢复空闲空间的使用。
- mongodb compact
- MongoDB压缩命令compact详解
- MongoDB碎片整理之compact详解
- MongoDB 碎片整理命令 compact 命令
- compact.c
- compact.cpp
- OpenTSDB compact
- HBase compact
- HBase-compact
- COMPACT分析
- 8086 instructions (compact)
- Compact framework 备忘录 1
- .net compact framework
- .NET Compact Framework 编程
- .net compact framework
- .NET Compact Framework 概述
- 学习.net compact framework
- .NET Compact Framework 2.0
- 《行为背后的心理奥秘》读书笔记
- 轻松理解数据库三范式
- 二逼程序员 VS 苦逼程序员
- MYSQL--事务处理
- USB descriptor
- mongodb compact
- NETAPP FlexClone FlexClone volumes 初体验
- memcpy和strcpy的区别
- mongodb update
- 转载_Linux设备模型(总线、设备、驱动程序和类)
- HDU 3746 Cyclic Nacklace
- Visual C++ engine is not properly installed 解决方案
- 【gcc编译器经历的4个步骤】
- mongodb update array