OiO.lk Blog SQL How do I make Trino stop early when enough rows have been collected?
SQL

How do I make Trino stop early when enough rows have been collected?


I have a Hive database and I am querying its tables through Trino. Every table has many partitions. Whenever I do a query like

SELECT * FROM my_table LIMIT 100;

it still goes through all partitions first before returning 100 entries. Each partition has multiple hundreds of entries, so the computation should have halted after one partition and just given an output. But it does not, and when looking at the different UI elements, it appears to go through gigabytes of data before returning.
What configuration parameter do I need to tune to tell Trino to stop computations that have a LIMIT clause if it has gathered enough data? No configuration parameter in the documentation sticks out to me.



You need to sign in to view this answers

Exit mobile version