The Multi-Stage Query Engine (MSQE) is StarTree Cloud’s advanced query processing system that enables complex analytical operations such as joins, window functions, and set operations across multiple tables. Unlike the traditional single-stage engine that uses a simple scatter-gather approach, MSQE breaks queries into multiple processing stages that can be efficiently executed across distributed servers.MSQE is particularly valuable for:
Queries involving window functions and advanced aggregations
Set operations (UNION, INTERSECT, MINUS)
Applications requiring insights from related data in separate tables
Note: MSQE is the primary query mode in StarTree Cloud and is recommended for most analytical workloads, especially those involving joins or complex processing.
To query using distributed joins, window functions, and other multi-stage operators, you need to enable the multi-stage query engine. There are several ways to do this:
MSQE enables analytical functions over partitions of result sets:
Copy
Ask AI
SELECT product_id, date, sales, SUM(sales) OVER (PARTITION BY product_id ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS rolling_7day_salesFROM sales