Explainer
Tag Historian vs SQL Bridge storage for a short-term trend database
Short answer
Use Tag Historian for plant-wide short-term trending because it stores narrow, on-change rows; keep SQL Bridge for PLC-to-database handshakes that need one wide row per group execution. Copy closed time partitions and the tag-mapping tables to the downstream historian, and prune only after the copy is confirmed.
On this page
- Should short-term trends go in Tag Historian or SQL Bridge?
- What is the difference between narrow and wide history tables?
- How many rows per day does each approach write?
- How do I enable history on hundreds of tags at once?
- How should the short-term history be partitioned?
- How do I move closed partitions to the downstream historian?
- How do I prove the pipeline before pruning anything?
- Questions asked
Yes to Tag Historian for this database, no to configuring it tag by tag, and no to SQL Bridge for plant-wide trends. Enable history at the UDT level so instances inherit the storage provider and sample mode, let Tag Historian write its own narrow, time-partitioned tables into the short-term database, then move closed partitions plus the tag-mapping rows to the downstream historian and prune only after the copy is confirmed. SQL Bridge keeps its own job: one wide, identically stamped row per transaction-group execution where a PLC and a database exchange a defined record, such as a recipe load.
Should short-term trends go in Tag Historian or SQL Bridge? #
Use Tag Historian for the plant-wide short-term trend database, and keep SQL Bridge for defined PLC-to-database handshakes such as recipe loads: Tag Historian writes narrow rows that suit trends, while SQL Bridge writes one wide row per group execution.
Tag Historian is built for many tags over time: it stores a narrow row per stored value and can log when a value changes rather than on a fixed clock, so steady signals cost almost nothing to keep. SQL Bridge is built for defined records: a transaction group gathers its points and writes one wide row at each execution, every point carrying the same timestamp. The Ignition user manual's comparison of tag history and transaction groups draws the line the same way — the two methods differ in storage shape and in how rows are timestamped.
One caution where the handshake writes back: if a transaction group loads recipes into the PLC, treat that database-to-controller direction as a controlled path, because a single stray row changes what the machine runs.
| Tag Historian | SQL Bridge | |
|---|---|---|
| Table shape | Narrow: one row per stored value, tag named by identifier | Wide: one row per group execution, one column per point |
| Logging trigger | On change, or periodic | Group execution interval, all points stamped together |
| Growth on steady signals | Stops between changes | Fixed by the interval |
| Adding a tag | New mapping rows, no schema change | Group definition and table columns change |
| Fit | Plant-wide short-term trends | PLC-to-database handshakes, recipe and batch records |
Decision: Tag Historian owns the short-term trend database. SQL Bridge groups exist only where a defined record crosses between PLC and database, and no signal appears in both.
What is the difference between narrow and wide history tables? #
Tag Historian stores narrow tables — one row per stored value, with the tag identified by an integer resolved through separate mapping tables — while SQL Bridge stores wide tables: one row per transaction-group execution, one column per point, every point stamped together.
In the narrow store, each data row carries a timestamp, a numeric tag identifier and one value; the mapping tables translate tag paths to those identifiers, so every query by name joins through them. Adding a tag means new mapping rows — no columns change anywhere.
In the wide store, a row is one group execution: the timestamp appears once and each point has its own column, which is what makes the row a consistent snapshot. Adding a point means editing the group and altering the table's columns, which is why wide tables belong to fixed record definitions.
Trends and enterprise analytics layers read narrow time-series directly. When a consumer insists on one row per timestamp, pivot the narrow data after export rather than running a second collection path — for occasional reports, pivoting narrow CSV data into a wide format in a spreadsheet is enough.
How many rows per day does each approach write? #
For 60 tags averaging one stored change per tag per minute, on-change Tag Historian writes 86,400 rows per day, while the same 60 points in a 5-second transaction group write 17,280 wide rows holding 1,036,800 values.
Worked example — 60 analog tags, one plant database:
- Tag Historian, on change, signals averaging one stored change per tag per minute: 60 tags × 1 change/min × 1,440 min/day = 86,400 rows/day, one value per row.
- Tag Historian, periodic at 30 s: 86,400 s/day ÷ 30 s = 2,880 samples per tag per day, and 60 tags × 2,880 samples = 172,800 rows/day.
- SQL Bridge, one transaction group over the same 60 points at a 5 s rate: 86,400 s/day ÷ 5 s = 17,280 executions/day, so 17,280 wide rows × 60 values = 1,036,800 stored values/day.
The group path stores 1,036,800 ÷ 86,400 = 12 times the values, from the interval alone. The on-change figure moves with how often the signals actually change — noisy loops store more until a deadband caps them, quiet signals store less — while the group figure is fixed whether anything changed or not.
Decision: for a 60-tag short-term store, on-change Tag Historian at about 86,400 rows/day is the fit. Move individual signals to periodic only where a report needs a regular grid, and set transaction-group rates by the handshake they serve, never by trending needs.
How do I enable history on hundreds of tags at once? #
Set the history flag and the storage provider on the UDT definition or a shared parent so every instance inherits them, then push bulk changes through tag import and export rather than tag by tag.
The per-tag route — open each tag, enable history, pick the storage provider — works for ten tags and drifts by the hundred. Inheritance from the UDT definition keeps new tags consistent from the day they are created, and tag import and export handles bulk edits after the fact.
Choose the sample mode by signal class:
- Slow analog, setpoints and states: on change. Few rows, and flat trend segments between them are normal.
- Fast or noisy analog: on change with a historical deadband, or periodic. The deadband stores a row only when the value moves at least the deadband from the last stored value, which caps row growth from jitter.
- Signals that feed time-based math: periodic. Calculations such as how to calculate OEE from historian data by time assume aligned intervals, which on-change data does not give.
The storage provider decides which database receives the tables; on an Edge gateway that choice carries its own limits, which where the Ignition Edge tag historian writes its data covers.
How should the short-term history be partitioned? #
Keep the time-based partitions Tag Historian already creates, sized so one drop removes about your retention window, with the tag-mapping tables copied alongside the data and never pruned away from it.
Tag Historian partitions history into time-based tables and keeps the mapping tables beside them; the Ignition Database Table Reference appendix documents the exact table and column names, so read it before writing any copy job or custom query. Size the partition length so one drop removes about the retention window: dropping a partition is cheap, deleting rows from one ever-growing table is not.
The mapping rows are part of the dataset. Data rows without them are unreadable by name, so nothing that prunes data may prune the mapping.
The gateway, the short-term database and the copy job normally share one plant-side host, and a fanless mini PC in the cabinet is the standard fit for that role.
If enabling history produces no tables at all, that is a provisioning fault rather than a partitioning choice — why Ignition tag historian tables are not created walks through that check.
How do I move closed partitions to the downstream historian? #
Copy whole closed partitions plus their tag-mapping rows to the downstream historian behind a timestamp watermark, and let anything be pruned locally only after the copy of that partition is confirmed — by a row-count match.
You have three workable architectures. A: point Tag Historian straight at the shared downstream database — one copy and no transfer job, but enterprise queries then load the same database the gateway writes to, and nothing stays short-term or local. B: write locally and copy with a database-side job — the local store stays small, IT reads its own system, and trending survives a link outage, at the cost of owning the copy job, its watermark and its mapping refresh. C: add a transaction group feeding a wide table for the one consumer that cannot read narrow data. Decision: B, with C added only for that consumer.
The copy job moves closed partitions or advances a timestamp watermark, and carries the tag-mapping rows with every transfer, refreshing them whenever tags are added or renamed. On the downstream side, index the tag identifier and timestamp together, because that is how time-series queries filter. For the first fill of a large downstream database, seeding a large Ignition historian database for replication covers the backup-and-restore route, and evaluating Ignition historian with TimescaleDB for your plant is the engine comparison to run.
Pruning is the last step, never a schedule of its own: a closed partition drops locally only after its copy is confirmed by a row-count match. Configuring Ignition pruning for old data partitions covers the mechanics of that drop, and setting historian pruning and retention for Ignition tag history covers the retention planning behind it.
How do I prove the pipeline before pruning anything? #
Prove it with one on-change test tag, a value forced from the PLC, a row-count comparison across both databases after the copy job runs, and a deliberate stop-and-restart of the copy job — all before the first real partition is pruned.
- Enable history on one test tag set to on-change, change its value from the PLC, and confirm a new row with the correct timestamp in the short-term database.
- Trend that tag and compare the plotted points to the raw rows; flat segments between stored points are expected on-change behavior, not data loss.
- After the copy job runs, compare row counts for that tag over a fixed window across both databases.
- Query the downstream side by tag path through the mapping tables and confirm the values match the source for identical timestamps.
- Stop the copy job for one interval, restart it, and check for neither a gap nor duplicate rows at the watermark.
- Prune one old partition locally and confirm the downstream copy still answers queries for that period.
Run all six on the test tag before the first production partition is pruned; from then on, the row-count match on each closed partition is the standing gate.
Questions asked
What happens if the mapping rows are not copied with the data?
The values arrive but nothing answers to a tag path, because the data rows carry only the numeric identifiers. Copy the mapping rows with every transfer and refresh them whenever tags are added or renamed; a downstream query that suddenly returns nothing usually points there first.
Why don't the two stores line up when both modules log the same points?
On-change rows are stamped at the moment of change while group rows are stamped at the group interval, so the same event carries two different timestamps and the stores never reconcile. Assign each signal to exactly one module and keep transaction groups limited to their handshake points.
How does a historical deadband change the row count?
It stores a row only when the value moves at least the deadband away from the last stored value, so jitter inside the band writes nothing. The trade shows on the trend: a deadband wide enough to cut the rows sharply also hides real moves of that same size.
How short should the short-term retention be?
Long enough to survive your worst copy outage plus one full partition. If the link to the downstream historian can be down over a weekend, keep about a week of local history; anything pruned before the copy confirms it is gone for good.
Is it safe to point enterprise queries at the local database instead of copying?
It works until a heavy aggregate lands: enterprise queries then compete with the gateway writes on the same connection and disk, and the store stops being short-term. The copy job exists to keep that query load on the downstream system, which is why it is the recommended architecture.