-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable readstream's reliance on seqscan readahead #9860
Conversation
7073 tests run: 6758 passed, 0 failed, 315 skipped (full report)Flaky tests (4)Postgres 17
Postgres 15
Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
4995f7f at 2024-12-10T23:04:03.337Z :recycle: |
Unfortunately the problem with prefetch in PG17 still can not be considered to be resolved.
But it means that prefetch distance is always 1 and effective_io_concurrency is not take in account.
Time of query execution in pg16: 654 msec Reply… |
Ok, this clearly needs investigation then... |
Ok, I have investigated it.
restricts number of pinned buyers to 16. If I increase shared buffers size to 128Mb, then prefetch distance is set to 16 and obviously we got much better query execution time: 627 msec vs. 3982 for 1Mb shared buffer. But it is still larger than 567 for pg16. I still not sure that approach with pinning prefetch buffers is goof for us:
|
I performed some benchmarking on standing competing speed of efficiency of prefetch on PG16 and PG17. So I performed three experiments:
Results (seconds):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is ready to be committed. Konstantin's benchmark suggests that we should also set io_ might want to also set io_combine_limit=1
. We can do that as a separate PR, or include it here, but what's in this PR seems correct and a step forward in any case.
Neon doesn't have seqscan detection of its own, so stop read_stream from trying to utilize that readahead, and instead make it issue readahead of its own.
ee1d7a1
to
4995f7f
Compare
Neon doesn't have seqscan detection of its own, so stop read_stream from trying to utilize that readahead, and instead make it issue readahead of its own.
Problem
@knizhnik noticed that we didn't issue smgrprefetch[v] calls for seqscans in PG17 due to the move to the read_stream API, which assumes that the underlying IO facilities do seqscan detection for readahead. That is a wrong assumption when Neon is involved, so let's remove the code that applies that assumption.
Summary of changes
Remove the cases where seqscans are detected and prefetch is disabled as a consequence, and instead don't do that detection.
PG PR: neondatabase/postgres#532