Skip to content

Orchestration

What is a computed column?

A computed column is a value produced by an expression or a model when a row is inserted or a dependency is updated, then stored.

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 stored 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
FailureThe insert aborts; with on_error='ignore', that row keeps the errorA 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 stored 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.

Next step

Install the Pixeltable skill, or sign up for Cloud and run the same file on a hosted database.