wixData.aggregate Performance

Depending on the size of your dataset and filter, aggregate can be an expensive operation, on any database

Without a filter, it is a full table scan
With a filter, if you do not have an index, it is also a full table scan

Wix offers 3 indexes on regular plans, and using the new Business VIP (being rolled out now) plan you get a dedicated collection + 32 indexes - which can improve your performance.

Another alternative is to prepare the aggregates before hand using scheduler, as another collection of pre-aggregated values, which you just query directly instead of doing the aggregate