Orchestration

What is a computed column?

A computed column is a value produced by an expression or a model when the row or its dependencies change, then cached.

Updated · Part of What is a declarative pipeline?

How it works

  • The expression reads other columns.
  • Inserting or editing a dependency recomputes the dependents of that row.
  • Unchanged rows keep their cached values.

What it is not

It is not a trigger you maintain by hand, an edge function, or a batch job that rewrites the whole table.

computed column: this, and the thing it is confused with

computed column: this, and the thing it is confused with
ThisNot this
Written byThe engine, from an expressionYour application, every time
CachePer rowA full-table refresh
FailureThat row, visibleA job that retries the world

Where Pixeltable fits

In Pixeltable a computed column is an assignment on the class. Insert a row and the expression runs.

import pixeltable as pxt
from pixeltable.functions.openai import chat_completions
TableModel = pxt.model_base()
class Docs(TableModel, name='docs'):
text: pxt.String
summary = chat_completions(
messages=[{'role': 'user', 'content': text}],
model='gpt-4o-mini',
).choices[0].message.content

Questions

How does computed column work?
The expression reads other columns. Inserting or editing a dependency recomputes the dependents of that row. Unchanged rows keep their cached values.
What is computed column often confused with?
It is not a trigger you maintain by hand, an edge function, or a batch job that rewrites the whole table.