Couchdb大小pipe理

我有一个名为restaurants.couch的沙发数据库,​​每周一次我会压缩数据库 ,文件大小将从20MB到11MB。

我看到旧版本不见了 – 我不需要。

不过,我注意到.restaurants_design文件夹的大小超过100MB,在这里有30多个.view文件。

我执行了紧凑视图清理视图 ,并将其减less到8MB,只有1 .view文件。 我的应用程序也运行得更快一点。

我的问题:

1)为什么.restaurants_design变得如此之大? 什么原因。 这只是一个观点。

2) 紧凑视图清理视图的好处是什么(除了减小文件大小)?

3) 紧凑视图清理视图的副作用是什么? 如果我不需要版本控制,我会后悔吗?

4)如果应用程序实际上并不需要版本控制,而是使用一些简单的nosql数据库以及某些视图,那么应该如何执行压缩数据库,压缩视图和清理视图。

  1. CouchDb将视图查询结果caching到磁盘上,以加快索引速度。 所以如果你有很多的意见,并且用户用不同的参数查询它们,它们将被caching。
  2. 压缩视图 – View indexes on disk are named after their MD5 hash of the view definition. When you change a view, old indexes remain on disk. To clean up all outdated view indexes (files named after the MD5 representation of views, that does not exist anymore) you can trigger a view cleanup: View indexes on disk are named after their MD5 hash of the view definition. When you change a view, old indexes remain on disk. To clean up all outdated view indexes (files named after the MD5 representation of views, that does not exist anymore) you can trigger a view cleanup: View indexes on disk are named after their MD5 hash of the view definition. When you change a view, old indexes remain on disk. To clean up all outdated view indexes (files named after the MD5 representation of views, that does not exist anymore) you can trigger a view cleanup: 。 清理视图然而,删除旧的视图caching,因为如果你更新视图,视图的旧结果仍然在磁盘上。
  3. 副作用是查询视图的下一个人需要更长的时间,因为CouchDB将需要重buildcaching。 Compact ViewsClean Up Views不会影响版本控制,但Compact Database可以。
  4. 频率真的取决于您的应用程序的工作方式和部署设置的限制。 但是,如果您确实要禁用版本控制,请尝试查看_revs_limit设置,以便为所有文档设置修订限制。