Re: Incorrect EXPLAIN ANALYZE output in bloom index docs

Chengpeng Yan <chengpeng_yan@outlook.com>

From: Yan Chengpeng <chengpeng_yan@Outlook.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-10T01:33:44Z
Lists: pgsql-hackers

> On Dec 9, 2024, at 15:53, David Rowley <dgrowleyml@gmail.com> wrote:
> 
> I was fixing up the patch in [1] with the intention of committing it
> when I noticed that there are a few outdated EXPLAIN ANALYZE examples
> in the documents for the bloom contrib module.
> 
> The example outputs look like they've been created with a 100 thousand
> row table, but the commands given are to insert 10 million rows into
> that table. I suspect someone did a 100x on the example row count at
> some point during development and forgot to update the EXPLAIN output.
> 
> The patch I want to commit adds buffer outputs to these EXPLAINs, so I
> kinda need to fix these before adding that, otherwise what I want to
> add does not make any sense.
> 
> Patch attached. I propose to backpatch this fix.
> 
> David
> <v1-0001-Doc-fix-incorrect-EXPLAIN-ANALYZE-output-for-bloo.patch>

Most changes look good to me. Only two small comments here:

1. Why did the following part change from ‘never executed’ to execute. Why the previous state is `never executed`?
```
-         -&gt;  Bitmap Index Scan on btreeidx2  (cost=0.00..12.04 rows=500 width=0) (never executed)
+         -&gt;  Bitmap Index Scan on btreeidx2  (cost=0.00..4.52 rows=11 width=0) (actual time=0.007..0.007 rows=8 loops=1)
```

2. There is one sentence in the old one that says, `Although this query runs much faster than with either of the single indexes, we pay a penalty in index size. Each of the single-column btree indexes occupies 2 MB, so the total space needed is 12 MB, eight times the space used by the bloom index.` I think the size also needs to be changed.

- Yan