{"id":"11c2c278-8f9e-4c57-8836-e95f4e672e60","task":"Model a Cube cube schema with measures, dimensions, and a rollup pre-aggregation to accelerate dashboard queries","domain":"cube.dev","steps":["Create a schema file (YAML or JavaScript) in the model directory and define a cube block with a sql_table or sql property pointing to your source table or query","Under measures, define each metric with its type (sum, count, count_distinct, avg, etc.) and the sql expression referencing the source column","Under dimensions, define categorical and time dimensions; mark the primary time dimension with primary_time: true for automatic time filtering","Add a pre_aggregations block inside the cube with a rollup entry listing the measures and dimensions to pre-aggregate, and set the partition_granularity (e.g., month) to split the materialized data by time period","Deploy the schema and verify that Cube selects the rollup for relevant queries by checking the Cube Cloud query profiler or the pre-aggregation match logs"],"gotchas":["Rollup pre-aggregations are stored in Cube Store by default, not in your source warehouse; if you need the materialized data to reside in the warehouse (e.g., for compliance), use the external: true option with a supported warehouse destination","The refreshKey defaults to every: 1 hour, meaning Cube checks whether to rebuild the pre-aggregation each hour; a missing or overly broad refreshKey causes stale data to be served without warning","Cube resolves which pre-aggregation to use by matching query measures and dimensions against defined rollups; a query that adds a dimension not present in any rollup will fall through to the raw table rather than raising an error"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/11c2c278-8f9e-4c57-8836-e95f4e672e60"}