Re: BitmapHeapScan streaming read user and prelim refactoring

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BitmapHeapScan streaming read user and prelim refactoring
Date: 2025-02-14 17:18:47
Message-ID: d816edb5-ee53-4f60-95fb-79e36284b456@vondra.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Based on off-list discussion with Melanie, I ran a modified version of
the benchmark, with these changes:

- only: uncached runs on the raid-SATA device (4x SSD)
- only: work_mem=4MB
- only: pached-0004 branch
- all datasets, ndistinct/nmatches combinations, 1M and 10M rows, ...

and then two new parameters:

- io_combine_limit 1, 16, 32
- read-ahead, 16, 256, 4096

The complete logs are pushed to github, as usual:

https://github.com/tvondra/bitmapscan-tests/tree/main/20250212-221123

There's also a .sh with the benchmarking script.

I'm attaching a PDF with the comparison, the columns are for

- io_combine_limit (16, 256, 4096)
- effective_io_concurrency (0, 1, 16)

And as usual, the colored columns are comparing patched-0004
(green=good, red=bad).

One way to look at the PDF is that there are 9 squares (in 3x3 layout),
for combinations of io_combine_limit and read-ahead values. The central
square is for the default values (ioc=16, ra=256), and you can compare
this to the surrounding squares.

Of course, this shows "behavior relative to master", a square being
"more green" does not mean the absolute performance improves, just that
it's "more better" relative to master.

I hope this explanation makes sense ...

FWIW this does not change anything in the detection of sequential access
patterns, discussed nearby, because the benchmarks started before Andres
looked into that. If needed, I can easily rerun these tests, I just need
a patch to apply.

But if there really is some sort of issue, it'd make sense why it's much
worse on the older SATA SSDs, while NVMe devices perform somewhat
better. Because AFAICS the NVMe devices are better at handling random
I/O with shorter queues.

regards

--
Tomas Vondra

Attachment Content-Type Size
results.pdf application/pdf 239.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-02-14 17:31:14 Re: BitmapHeapScan streaming read user and prelim refactoring
Previous Message Tom Lane 2025-02-14 17:14:55 Re: BackgroundPsql swallowing errors on windows