Re: index prefetching
Tomas Vondra <tomas@vondra.me>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
aio: io_uring: Trigger async processing for large IOs
- a9ee66881744 19 (unreleased) landed
-
read stream: Split decision about look ahead for AIO and combining
- 8ca147d582a5 19 (unreleased) landed
-
read_stream: Only increase read-ahead distance when waiting for IO
- f63ca3379025 19 (unreleased) landed
-
read_stream: Prevent distance from decaying too quickly
- 6e36930f9aaf 19 (unreleased) landed
-
Reduce ExecSeqScan* code size using pg_assume()
- b227b0bb4e03 19 (unreleased) cited
-
Fix rare bug in read_stream.c's split IO handling.
- b421223172a2 19 (unreleased) cited
-
Fix multiranges to behave more like dependent types.
- 3e8235ba4f9c 17.0 cited
-
Add EXPLAIN (MEMORY) to report planner memory consumption
- 5de890e3610d 17.0 cited
-
Optimize nbtree backward scan boundary cases.
- c9c0589fda0e 17.0 cited
-
Increment xactCompletionCount during subtransaction abort.
- 90c885cdab8b 14.0 cited
-
Add nbtree Valgrind buffer lock checks.
- 4a70f829d86c 14.0 cited
-
Add nbtree high key "continuescan" optimization.
- 29b64d1de7c7 12.0 cited
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited
-
Teach btree to handle ScalarArrayOpExpr quals natively.
- 9e8da0f75731 9.2.0 cited
On 9/3/25 22:06, Andres Freund wrote: > ... > > I continue to be worried that we're optimizing for queries that have no > real-world relevance. The regression afaict is contingent on > > 1) An access pattern that is unpredictable to the CPU (due to the use of > random() as part of ORDER BY during the data generation) > > 2) Index and heap are somewhat correlated, but fuzzily, i.e. there are > backward jumps in the heap block numbers being fetched > Aren't those two points rather contradictory? Why would it matter that the data generator uses random() in the ORDER BY? Seems entirely irrelevant, if the generated table is "somewhat correlated". Which seems pretty normal in real-world data sets ... > 3) There are 1 - small_number tuples on one heap tables > What would you consider a reasonable number of tuples on one heap page? The current tests generate data with 20-100 tuples per page, which seems pretty reasonable to me. I mean, that's 80-400B per tuple. Sure, I could generate data with narrower tuples, but would that be more realistic? I doubt that. FWIW it's not like the regressions only happen on fillfactor=20, with 20 tuples/page. It happens on fillfactor=100 (sure, the impact is smaller). > 4) The query scans a huge number of tuples, without actually doing any > meaningful analysis on the tuples. As soon as one does meaningful work for > returned tuples, the small difference in per-tuple CPU costs vanishes > I believe I already responded to this before. Sure, the relative regression will get smaller. But I don't see why would the absolute difference get smaller. > 5) The query visits all heap pages within a range, just not quite in > order. Without that the kernel readahead would not work and the query's > performance without readahead would be terrible even on low-latency storage > I'm sorry, I don't quite understand what this says :-( Or why would that mean the issues triggered by the generated data sets are not valid even for real-world queries. > This just doesn't strike me as a particularly realistic combination of > factors? > Aren't plenty of real-world data sets correlated, but not perfectly? In any case, I'm the first one to admit these data sets are synthetic. It's meant to generate data sets that gradually shift from perfectly ordered to random, increasing number of duplicates, etc. The point was to cover a wider range of data sets, not just a couple "usual" ones. It's possible some of these data sets are not realistic, in which case we can choose to ignore them and the regressions. The approach tends to find "adversary" cases, hit corner cases (not necessarily as rare as assumed), etc. But the issues we ran into so far seem perfectly valid (or at least useful to think about). regards -- Tomas Vondra