Streaming of partial results in chunks to improve TTFB

Hello,

Does the Trino engine provide the ability to push the results of a query to the client side even though the execution has not been fully computed by the executors?

Example:

SELECT C1, C2, C3 from TABLE1 order by C3 desc;

In this case, lets assume the table contains several billion records and it takes 10 minutes to fully sort the result set and complete the processing of the query. Does the engine provide the feature to start pushing N rows to the client that uses the JDBC driver so that from the client side, time-to-first-byte is significantly lower than the overall processing time of the query.

Essentially the answer is yes. Trino will stream results back as soon as they are available. Only the first batch of the results is retrieved and returned… more results are only created and returned if the user requests more … like scrolling down or going to the next page of results.