opensearch-project / sql

Query your data using familiar SQL or intuitive Piped Processing Language (PPL)
https://opensearch.org/docs/latest/search-plugins/sql/index/
Apache License 2.0
120 stars 139 forks source link

Improve the branching strategy in the code around SQL_PAGINATION_API_SEARCH_AFTER check #2945

Open manasvinibs opened 2 months ago

manasvinibs commented 2 months ago

We have introduced SQL_PAGINATION_API_SEARCH_AFTER config settings to choose the approach used for pagination queries. The default value is true today which uses Point in time with search_after API to paginate the results instead of existing scroll search API. Today we have branching strategy all across the code to support both the approaches. We need to get rid of this branching checks and improve the code or get rid of scroll approach once performance testing is done.

manasvinibs commented 1 month ago

Minor imrpovements suggested:

  1. Add a separate PIT request implementation class in the OpenSearchQUeryRequest.java - https://github.com/opensearch-project/sql/pull/2981/files/770ae4151d3e46a9fcd8246690aa20b266f69d57#diff-96f998c99595de19404d0dd5c38b71b5fb7c52160cf34a847c2785dbb05f1d03