bitmap heap scan

6 "Bitmap Heap Scan" 解释
   A plain indexscan fetches one tuple-pointer at a time from the index,
and immediately visits that tuple in the table.  A bitmap scan fetches
all the tuple-pointers from the index in one go, sorts them using an
in-memory "bitmap" data structure, and then visits the table tuples in
physical tuple-location order.  The bitmap scan improves locality of
reference to the table at the cost of more bookkeeping overhead to
manage the "bitmap" data structure --- and at the cost that the data
is no longer retrieved in index order, which doesn't matter for your
query but would matter if you said ORDER BY.        

        上面的意思是说,普通的索引扫描( index scan) 一次只读一条索引项,那么
一个 PAGE面有可能被多次访问;而 bitmap scan 一次性将满足条件的索引项全部取

出,并在内存中进行排序, 然后根据取出的索引项访问表数据。

普通索引一次读取一条索引项,个人是这样理解  先读取索引建到内存比较 发现相等 则读取对应的实际 数据的指针(数据位置值)到内存 在根据这个指针读取数据

位图索引 一次读取所有的索引的指针值 (根据所有记录的0,1,0)

(扫描数据 不在按照索引顺序 而是按照 位图中为1 的顺序)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值