将 CouchDB 复制到本地沙发会减小大小 - 为什么?
我最近开始在我正在开发的一个大型应用程序中使用 Couch。
我的数据库有7907个文件,想重命名数据库。我查了一下,但不知道如何重命名它,所以我想我只需将它复制到我想要的名称的本地数据库中即可。
我第一次尝试时,复制失败,我相信错误是超时。我又试了一次,很快就见效了,这有点令人不安。
复制后,我显示新数据库具有正确的记录数量,但数据库大小约为原始数据库的 1/3。
还有一点奇怪的是,如果我刷新蒲团,原始数据的大小会在 94.6 到 95.5 mb 之间波动,
这给我留下了几个问题:
第二个数据库是否存储对第一个数据库的引用?如果是这样,我可以删除第一个数据库而不造成损害吗?
为什么尺寸会如此不同?原来建立的索引是否与新索引最终建立的一样?
为什么尺寸会波动?
编辑:
一些可能有用的事情:
- 这是在cloudant couchdb安装上
- 我检查了新数据库的第一个和最后一个记录,它们匹配,所以我不相信futon报告不足。
I recently started using Couch for a large app I'm working on.
I database with 7907 documents, and wanted to rename the database. I poked around for a bit, but couldn't figure out how to rename it, so I figured I would just replicate it to a local database of the name I wanted.
The first time I tried, the replication failed, I believe the error was a timeout. I tried again, and it worked very quickly, which was a little disconcerting.
After the replication, I'm showing that the new database has the correct amount of records, but the database size is about 1/3 of the original.
Also a little odd is that if I refresh futon, the size of the original fluctuates between 94.6 and 95.5 mb
This leaves me with a few questions:
Is the 2nd database storing references to the first? If so, can I delete the first without causing harm?
Why would the size be so different? Had the original built indexes that the new one eventually will?
Why is the size fluctuating?
edit:
A few things that might be helpful:
- This is on a cloudant couchdb install
- I checked the first and last record of the new db, and they match, so I don't believe futon is underreporting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
复制到新数据库类似于压缩。两者都涉及某些副作用(分别是偶然的和有意的),这些副作用会减少新
.couch
文件的大小。复制存储到检查点或从检查点存储,因此如果您从同一源重新复制到同一位置(即重新运行超时的复制),它将从中断处继续。
答案:
.view
文件,该文件也会消耗空间。Replicating to a new database is similar to compaction. Both involve certain side-effects (incidentally, and intentionally, respectively) which reduce the size of the new
.couch
file.Replications store to/from checkpoints, so if you re-replicate from the same source, to the same location (i.e. re-run a replication that timed out), it will pick up where it left off.
Answers:
.view
file which also consumes space.