Is your feature request related to a problem?
Consider this query:
SELECT *
FROM orders o
ASOF JOIN market_data md on o.order_symbol = md.market_data_symbol
ORDER BY o.ts DESC
LIMIT 100;
It first executes ASOF join and then sorts and limits the result:

Describe the solution you'd like.
The query only uses columns from the master table for ordering -> It should be possible to push both the LIMIT and ORDER BY down to the master factory and execute it before the join. The join operator would have to join just 100 rows.
Describe alternatives you've considered.
No response
Full Name:
Jaromir Hamala
Affiliation:
QuestDB
Additional context
No response
Is your feature request related to a problem?
Consider this query:
It first executes ASOF join and then sorts and limits the result:
Describe the solution you'd like.
The query only uses columns from the master table for ordering -> It should be possible to push both the LIMIT and ORDER BY down to the master factory and execute it before the join. The join operator would have to join just 100 rows.
Describe alternatives you've considered.
No response
Full Name:
Jaromir Hamala
Affiliation:
QuestDB
Additional context
No response