插入性能-位图与B树 [英] INSERT Performance - Bitmap vs B-Tree

查看:116
本文介绍了插入性能-位图与B树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果将选择性能放在一边,插入时会更快.我对此没有任何详尽的解释.有人可以解释一下吗?这个问题只是将位图标记为无效,但是我想知道为什么.

谢谢

解决方案

如果存在争用,位图索引对于插入可能会出现问题.如果您有一个线程在执行插入操作,那很好,但是,如果有多个线程在执行插入操作,并且可能进行了更新和删除操作,那么由于锁定,它们会限制性能.

索引中的单个键可能指向大量记录,因此当索引更改时,许多行将被锁定.

作为一般规则,请使用普通索引.在特殊情况下,位图索引会发光-通常用于只读应用程序而不是OLTP系统.

If we put the select performance aside, which one is faster when it comes to insert. I couldn't find any thorough explanation for this. Can someone please explain? This question just labels bitmaps as inefficient but I want to know why.

Thanks,

解决方案

Bitmap indexes can be problematic for inserts if there is contention. If you have a single thread doing the inserts they are fine, but if there are multiple threads doing inserts and perhaps updates and deletes they tend to limit performance due to locking.

A single key in the index may point to a large number of records, so when the index is changed many rows are locked.

As a general rule, go for normal indexes. In special cases bitmap indexes can shine - normally for read-mostly applications rather than OLTP systems.

这篇关于插入性能-位图与B树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆