Skip to content

Conversation

@knizhnik
Copy link

No description provided.

github-merge-queue bot pushed a commit to neondatabase/neon that referenced this pull request Jan 13, 2025
…r exact or limited index scans (#10359)

## Problem

See https://neondb.slack.com/archives/C04DGM6SMTM/p1736526089437179

In case of queries index scan with LIMIT clause, multiple backends can
concurrently send larger number of duplicated prefetch requests which
are not stored in LFC and so actually do useless job.

Current implementation of index prefetch starts with maximal prefetch
distance (10 by default now) when there are no key bounds, so in queries
with LIMIT clause like `select * from T order by pk limit 1` compute can
send a lot of useless prefetch requests to page server.

## Summary of changes

Always start with minimal prefetch distance even if there are not key
boundaries.

Related Postgres PRs:
neondatabase/postgres#552
neondatabase/postgres#551
neondatabase/postgres#550
neondatabase/postgres#549

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
@knizhnik knizhnik merged commit f63b141 into REL_16_STABLE_neon Jan 13, 2025
3 checks passed
@knizhnik knizhnik deleted the incremental_prefetch_v16 branch January 13, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants