You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a common use case in the product of wanting to create a table, where each row is grouped by a tag column, and there are multiple aggregates.
It's possible to create a such a table with a single SnQL query (assuming all the aggregates are in the same table) however that's not the case with MQL. The current process is to make the first query to fetch the set of grouped by values {V}, and then make N more queries with a filter on column IN {V}. This gets more complicated since the table can also be ordered by any column in the table, and changing the order requires rerunning all N queries with new filters.
Once we support JOIN queries to build multi-type formulas, we should be able to use a similar principle to return an entire table in a single query.
For example (this is pseudocode)
SELECT transaction, c.sum(value) AS sum, d.quantiles(99)(value) AS p99
FROM counters c JOIN distributions d ONc.transaction=d.transactionGROUP BY transaction
ORDER BY p99 DESC
The text was updated successfully, but these errors were encountered:
There is a common use case in the product of wanting to create a table, where each row is grouped by a tag column, and there are multiple aggregates.
It's possible to create a such a table with a single SnQL query (assuming all the aggregates are in the same table) however that's not the case with MQL. The current process is to make the first query to fetch the set of grouped by values
{V}
, and then make N more queries with a filter oncolumn IN {V}
. This gets more complicated since the table can also be ordered by any column in the table, and changing the order requires rerunning all N queries with new filters.Once we support JOIN queries to build multi-type formulas, we should be able to use a similar principle to return an entire table in a single query.
For example (this is pseudocode)
The text was updated successfully, but these errors were encountered: