我们可以使用cube的pre-aggregation 加速数据的查询,以下为一张来自官方的pre-aggregation 架构
参考架构图
pre-aggregation schema
preAggregations: {
amountByCreated: {
type: `rollup`,
measureReferences: [amount],
timeDimensionReference: createdAt,
granularity: `month`
}
}
参考资料
https://cube.dev/docs/caching
https://cube.dev/docs/pre-aggregations