Hi @Gavin Cheung , Because we don't have your dataset, so I have to make a guess. But a Kusto query is treated like a tunnel, we start at the top with lots of data. At each statement, the data if filtered or manipulated.
Could it be that the filter on match_id removes many records of the original dataset? So that the summarize needs to calculate with a smaller dataset.
For example:
event_table //Contains 100M records
| where match_id == 12345 //After filtering the dataset contains only 1M records
| summarize take_any(*) by id //The summarize only needs to calculate with a set of 1M records
The query with the materialized view is basically:
event_table //Contains 100M records
| summarize take_any(*) by id //The summarize only needs to calculate over 100M records
| where match_id == 12345 //Then the filter is applied
Try executing both queries, I think it the second query will be a slower than the first one.
I have tried to imitate this situation, but I only see a small difference where the second option is a bit slower. Kind Regards, Wilko
---Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members. If you have extra questions about this answer, please click "Comment".