Re: Index INCLUDE vs. Bitmap Index Scan

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Markus Winand <markus(dot)winand(at)winand(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Index INCLUDE vs. Bitmap Index Scan
Date: 2019-02-27 01:00:59
Message-ID: 20190227010059.GC28750@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 26, 2019 at 09:07:01PM +0100, Markus Winand wrote:
> CREATE INDEX idx ON tbl (a, b, c);
> Bitmap Heap Scan on tbl (cost=4.14..8.16 rows=1 width=7616) (actual time=0.021..0.021 rows=1 loops=1)
> Recheck Cond: ((a = 1) AND (c = 1))
> -> Bitmap Index Scan on idx (cost=0.00..4.14 rows=1 width=0) (actual time=0.018..0.018 rows=1 loops=1)
> Index Cond: ((a = 1) AND (c = 1))
>
> (As a side node: I also dislike it how Bitmap Index Scan mixes search conditions and filters in “Index Cond”)

I don't think it's mixing them; it's using index scan on leading *and*
nonleading column. That's possible even if frequently not efficient.

Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2019-02-27 01:02:06 Re: New vacuum option to do only freezing
Previous Message David Rowley 2019-02-27 00:48:08 Re: NOT IN subquery optimization