How it works
Every operation that modifies a table creates a new version:Viewing history
Human-readable history
| version | created_at | change_type | inserts | updates | deletes | schema_change |
|---|---|---|---|---|---|---|
| 3 | 2025-01-15 10:30:00 | data | 0 | 1 | 0 | None |
| 2 | 2025-01-15 10:29:00 | schema | 0 | 2 | 0 | Added: price_with_tax |
| 1 | 2025-01-15 10:28:00 | data | 2 | 0 | 0 | None |
| 0 | 2025-01-15 10:27:00 | schema | 0 | 0 | 0 | Initial Version |
Programmatic access
Time travel queries
Query any historical version using thetable_name:version syntax:
Use cases
- Debugging: Compare data before and after a problematic update
- Auditing: Track who changed what and when
- Recovery: Find and extract accidentally deleted or modified data
- Reproducibility: Query exact data used for a specific model training run
Reverting changes
Undo the most recent change withrevert():
revert() multiple times to go back further, but cannot revert past version 0 or past a version referenced by a snapshot.
Snapshots
Create named, persistent point-in-time copies for long-term preservation:- Time travel (
pxt.get_table('table:N')) queries historical versions in place - Snapshots create a named, independent copy that persists even if the source table is modified or deleted
Data lineage
Pixeltable tracks the complete lineage of your data:Schema lineage
Every computed column records its dependencies:View lineage
Views automatically track their source tables:What’s tracked
| Change Type | Tracked Information |
|---|---|
insert() | Row count, timestamp, computed values generated |
update() | Rows affected, old vs new values (via version comparison) |
delete() | Row count removed |
add_column() | Column name, type, dependencies |
add_computed_column() | Column name, expression, dependencies |
drop_column() | Column removed |
rename_column() | Old name → new name |
Best practices
Use Snapshots for Milestones
Create snapshots before major data loads, model training runs, or production deployments.
Version Numbers for Reproducibility
Log table version numbers alongside model artifacts:
products.get_versions()[0]['version']Revert for Quick Fixes
Use
revert() immediately after mistakes. For older issues, use time travel to identify the problem.Namespace by Environment
Use directories like
dev/products, staging/products to isolate versioning across environments.Comparison with other systems
| Feature | Pixeltable | Git | Delta Lake |
|---|---|---|---|
| Automatic versioning | ✅ Every operation | Manual commits | ✅ Every operation |
| Time travel queries | ✅ table:N syntax | Checkout commit | ✅ VERSION AS OF |
| Schema versioning | ✅ Tracked | File-based | ✅ Schema evolution |
| Computed column lineage | ✅ Automatic | N/A | N/A |
| Revert | ✅ revert() | git revert | RESTORE |
| Named snapshots | ✅ create_snapshot() | Tags/branches | N/A |