Re: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan

Lists: pgsql-hackers
From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan
Date: 2014-07-11 08:45:33
Message-ID: 53BFA42D.2050201@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I've noticed that EXPLAIN ANALYZE shows no information on exact/lossy
blocks for a bitmap heap scan when both the numbers of exact/lossy pages
retrieved by the node are zero. Such an example is shown below. I
think it would be better to suppress the 'Heap Blocks' line in that
case, based on the same idea of the 'Buffers' line. Patch attached.

postgres=# explain (analyze, verbose, buffers) select * from test where
id < 10;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------
Bitmap Heap Scan on public.test (cost=4.29..8.31 rows=1 width=29)
(actual time=0.006..0.006 rows=0 loops=1)
Output: id, inserted, data
Recheck Cond: (test.id < 10)
Heap Blocks:
Buffers: shared hit=2
-> Bitmap Index Scan on test_pkey (cost=0.00..4.29 rows=1 width=0)
(actual time=0.003..0.003 rows=0 loops=1)
Index Cond: (test.id < 10)
Buffers: shared hit=2
Planning time: 0.118 ms
Execution time: 0.027 ms
(10 rows)

Thanks,

Best regards,
Etsuro Fujita

Attachment Content-Type Size
explain-bitmapscan.patch text/x-diff 1.0 KB

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan
Date: 2014-07-11 10:21:32
Message-ID: CAHGQGwFdYquCPMsbpnodnKna3Fobgdz=7=KP5x8Map8WfTZf5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jul 11, 2014 at 5:45 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> I've noticed that EXPLAIN ANALYZE shows no information on exact/lossy
> blocks for a bitmap heap scan when both the numbers of exact/lossy pages
> retrieved by the node are zero. Such an example is shown below. I
> think it would be better to suppress the 'Heap Blocks' line in that
> case, based on the same idea of the 'Buffers' line. Patch attached.

The patch looks good to me. Barring any objection, I will commit this both
in HEAD and 9.4.

Regards,

--
Fujii Masao


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan
Date: 2014-07-14 12:01:34
Message-ID: CAHGQGwFH8JFvGgzaNLYVqov25Je3048wwmJ5XhMLyRugcRjeyw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jul 11, 2014 at 7:21 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Fri, Jul 11, 2014 at 5:45 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> I've noticed that EXPLAIN ANALYZE shows no information on exact/lossy
>> blocks for a bitmap heap scan when both the numbers of exact/lossy pages
>> retrieved by the node are zero. Such an example is shown below. I
>> think it would be better to suppress the 'Heap Blocks' line in that
>> case, based on the same idea of the 'Buffers' line. Patch attached.
>
> The patch looks good to me. Barring any objection, I will commit this both
> in HEAD and 9.4.

Committed!

Regards,


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: No exact/lossy block information in EXPLAIN ANALYZE for a bitmap heap scan
Date: 2014-07-15 03:45:47
Message-ID: 53C4A3EB.7090306@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/07/14 21:01), Fujii Masao wrote:
> On Fri, Jul 11, 2014 at 7:21 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Fri, Jul 11, 2014 at 5:45 PM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>> I've noticed that EXPLAIN ANALYZE shows no information on exact/lossy
>>> blocks for a bitmap heap scan when both the numbers of exact/lossy pages
>>> retrieved by the node are zero. Such an example is shown below. I
>>> think it would be better to suppress the 'Heap Blocks' line in that
>>> case, based on the same idea of the 'Buffers' line. Patch attached.
>>
>> The patch looks good to me. Barring any objection, I will commit this both
>> in HEAD and 9.4.
>
> Committed!

Thanks!

I have another proposal for show_tidbitmap_info(). That is about the
following comment for show_tidbitmap_info():

/*
* If it's EXPLAIN ANALYZE, show exact/lossy pages for a
BitmapHeapScan node
*/

ISTM that the words "If it's EXPLAIN ANALYZE" are unnecessary. As the
function is called in EXPLAIN ANALYZE, so the words are not wrong, but
it doesn't seem to me suitable for the comment for the function itself.
Patch attached.

Thanks,

Best regards,
Etsuro Fujita

Attachment Content-Type Size
explain-bitmapscan-comment.patch text/x-diff 487 bytes