Skip to content
6. ROLLUP for TAG Tables

6. ROLLUP for TAG Tables

ROLLUP preaggregates data from time-axis TAG tables and combines the stored statistics at query time to reduce repeated analysis cost. This chapter distinguishes basic, conditional, extension, JSON, and Custom ROLLUP in Machbase DBMS 8.7.0, covering creation, result validation, and rebuilding.

Distinguish Three Intervals

ConceptMeaningExample
Creation INTERVALWidth of stored aggregation buckets1 MIN
WAKEUP INTERVALHow often the aggregation job wakes up10 SEC
Query bucketResult interval requested by a reportrollup('min', 5, time)

Multiple partial aggregates can be stored for the same bucket. Basic ROLLUP public query syntax merges the required statistics; for Custom target TAG tables, users write the final reaggregation query. Define source retention separately from ROLLUP retention and rebuild policies.

Chapter Contents

SectionTopics
Overview and Use CriteriaBasic exercise and source/aggregate comparison
Target TAG DesignON/FROM, hierarchy constraints, and capacity estimates
Creation and DeletionCREATE, WITH ROLLUP, IF NOT EXISTS, and dependencies
Query SyntaxCandidate selection, time units, and origin
Conditional ROLLUPSource filters and explicit candidate selection
Custom ROLLUPReaggregating incremental results and OHLCV hierarchies
Extension ROLLUPFIRST/LAST and OHLC validation
JSON ROLLUPPath/full-document aggregation and NULL
Control and StatusSTOP/START/WAKEUP/FORCE, V$ROLLUP, and gaps
REBUILDSupported targets, bucket boundaries, and corrections
Performance TuningComparing costs for equivalent results
Usage ScenariosMultiple tags and source/aggregate responsibilities

Each page is a standalone exercise with object names beginning with ch6_. Check for conflicts with existing business objects and keep intentional-error examples separate from success scripts. Query fixed-time data using the stated fixed ranges. Clean up only the exercise tables and ROLLUPs.

Custom and REBUILD are Standard Edition only. Creating a ROLLUP or successfully ingesting data does not mean aggregation has finished. Exercises use a named FORCE call to catch up processing and then check results.

Continue with Support Scope and Troubleshooting for limitations and diagnosis.

Last updated on