Skip to content
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

Can the "LIMIT" statement be included as one of arguments when doing scan operation? #572

Closed
nkg114mc opened this issue May 26, 2024 · 1 comment

Comments

@nkg114mc
Copy link

nkg114mc commented May 26, 2024

No description provided.

@ankane
Copy link
Member

ankane commented May 26, 2024

Hi @nkg114mc, index scans don't know the limit, as they don't know which index tuples are visible to the current transaction or will be filtered by non-index conditions in the query (which needs to happen before the limit is applied).

I did some experiments a while back with setting a bound on the tuple sort (bound branch) as well as using a pairing heap (pairingheap and stages branches), but from what I recall, the performance difference didn't justify the complexity. However, someone is welcome to submit a PR (with benchmarks) with a better approach.

@ankane ankane closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants