-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
SQL: replace the scroll with PIT for data batching #61873
Comments
Pinging @elastic/es-ql (:Query Languages/SQL) |
I wonder if this should be an option in the SQL request like we have for |
The main reason why SQL relies on scroll is that by default, the vast majority of queries require pagination since the result set is too large. |
Generally with SQL, one simply can't server-side paginate outside a cursor-bound context (such as xDBC; or REST API-aware app, in our case) -- it's always just one result set. Querying with or without a scroll/PIT is appealing imo due to the equivalence to SQL's transactional vs. non-transactional mode. However, maybe unlike typical RDBMSes, the "non-transactional" mode is more expensive for us (when paginating), so I guess we'd generally default to the "transactional" mode anyways? At least for our CLI/xDBC clients; which also automatically close the scroll, part of their internal cursor lifecycle. |
Right, I envision the stateless request on the HTTP/REST front due to its request/response contract. |
But that's the same problem for normal search. I don't understand why there would be a difference in SQL. Paginating with a cursor is a feature in SQL too. |
The difference might stem from expectations, since RDBMSs are generally expected to return all results matching a query, or up to a given limit the user provides (like |
Resolves #61873 The goal of this PR is to remove the use of the deprecated scroll cursors in SQL. Functionality and APIs should remain the same with one notable difference: The last page of a search hit query used to always include a scroll cursor if it is non-empty. This is no longer the case, if a result set is exhausted, the PIT will be closed and the last page does not include a cursor. Note, PIT can also be used for aggregation and PIVOT queries but this is not in the scope of this PR and will be implemented in a follow up. Additionally, this PR resolves #80523 because the total doc count is no longer required.
Since the scroll functionality replacement is underway, the SQL plugin should move away from it, replacing it with the newly added point-in-time (PIT) API.
The text was updated successfully, but these errors were encountered: