- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
众所周知,在elasticsearch中更新或删除文档内容时,segment不会立即删除,而是重新创建。
在那之后,我们知道段是通过一个时间表合并的。
我知道它之所以这样工作是因为它很贵。
但我不知道段不可变且不立即合并的确切原因。
即使我搜索了文档,也找不到确切的原因,但是如果有人知道这件事,请发表评论。
谢谢。
最佳答案
段不可变有很多好处,例如
请引用以下来自官方 ES 文档的内容,了解为什么 lucene segments are cache friendly
Lucene is designed to leverage the underlying OS for caching in-memorydata structures. Lucene segments are stored in individual files.Because segments are immutable, these files never change. This makesthem very cache friendly, and the underlying OS will happily keep hotsegments resident in memory for faster access. These segments includeboth the inverted index (for fulltext search) and doc values (foraggregations).
另请参阅 benefits of immutable data了解更多详情。
关于elasticsearch - 为什么lucene的段是不可变的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66025045/
我是一名优秀的程序员,十分优秀!