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
| This | Not this | |
|---|---|---|
| Written by | The engine, from an expression | Your application, every time |
| Cache | Per row | A full-table refresh |
| Failure | That row, visible | A 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 pxtfrom pixeltable.functions.openai import chat_completionsTableModel = pxt.model_base()class Docs(TableModel, name='docs'):text: pxt.Stringsummary = 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.