5. Using TAG Tables
TAG tables store measurement histories by repeatedly observed entity name and a time or distance axis. This chapter covers Machbase DBMS 8.7.0 TAG structure, ingestion, queries, metadata, correction, and operations. It validates the deployment and data-model choices from Chapters 3 and 4 through practical SQL.
A tag is an observed entity; a DATA row is one observation. METADATA holds one attribute row per tag, not separate attributes per historical observation. Distinguish original measurements, current attributes, interval aggregates, and ingestion times to interpret results and correction scope consistently.
Chapter Contents
| Section | Content |
|---|---|
| Overview and Selection Criteria | Tag identifiers, observation rows, time/distance axes |
| Table Structure and Schema | Column order/types, LSL/USL, BINARY, storage design |
| Create, Alter, and Drop | Basic DDL, METADATA expansion, object cleanup |
| Data Ingestion and Changes | Automatic registration, SQL/Append/file input |
| Queries and Analysis | Range/latest-value/STAT queries and interpretation |
| Indexes and Performance | Validate access paths with actual data |
| Operations and Data Lifecycle | Deletion, retention, deduplication completion |
| Constraints, Errors, and Troubleshooting | Valid conditions and intentional failure examples |
| Usage Patterns and Scenarios | Observation granularity, units, missing-data models |
| TAG Metadata | Registration, queries, changes, deletion, JSON, ARRAY |
| TAG Data UPDATE and Correction | Direct correction, NULL correction, audit history |
| tagmetaimport and Bulk Metadata Registration | CSV setup, input targets, rerun errors |
Exercises and Support Scope
Each page is an independent exercise. If a setup table exists, determine whether it belongs to another workload; do not delete it arbitrarily. Run success examples separately from intentional failures. Apply cleanup SQL only to objects created for that exercise.
TAG DATA UPDATE is Standard Edition only. Check Edition-specific scope for duplicate-check intervals, METADATA ALTER, and individual LSL/USL operations. SQL INSERT, Append responses, storage-buffer flush, and index/statistics completion are different events.
Chapter 6 covers full ROLLUP creation, query, and rebuild procedures. This chapter addresses only how TAG corrections and deletions relate to aggregates.