Files
lancedb/docs/web/feature-engineering/refresh-materialized-view.mdx
T
Jack YeandClaude Sonnet 5 de95ed3f6d docs: overhaul curation, feature engineering, security and deployment guides (#4748)
A broad documentation pass across the areas LanceDB Enterprise and
Embedded
diverge on most:

**Data Curation** -- GPU Function execution, Slurm scheduling (and what
Slurm is, for readers new to it), blob late materialization as its own
page, joins, aggregation/profiling, sampling, near-duplicate detection,
chunking, distributed shuffle, and IVF-partition clustering.

**Feature Engineering** -- computed columns and materialized views,
restructured to lead with the Function-based path and show the SQL form
side by side with Python throughout; a single Auto Refresh page instead
of
duplicating scheduling details on every refresh page; adaptive
execution;
checkpointing; GPU and Slurm placement for refresh workers; a Training
Cache page for the PyTorch data loader's automatic cache benefit.

**Security & Governance** -- an Audit Log reference (schema, access,
grants), Secrets promoted to an ordinary catalog object with their own
SQL
DDL and a vending/rotation guide, and privilege-table fixes verified
against the authorization source.

**Deployment & Maintenance** -- Horizontal Scaling and OpenTelemetry
moved
into a real Deployment area; Automated Cleanup folded into Intelligent
Auto-Maintenance (every other maintenance decision already lived there);
RTE Compaction and Advanced Conflict Resolution documented in depth.

**Landing page** -- the Enterprise feature comparison table reorganized
(several redundant or stale rows removed, several new areas added), and
the
"why Enterprise" bullets replaced with ones tied to a concrete page
(Performance, Scale, Fault tolerance, Multicloud deployment, Simplify
operations) instead of vague promises.

Plus a full pass addressing lancedb-gatekeeper's review: a real
test-safety
bug (a quickstart test could silently overwrite and delete a
deployment's
own `frames` table), a fabricated SQL statement with no backing
implementation, an actual dedup-guarantee bug in `take_row_ids`, and
dozens
of documentation-accuracy fixes verified against source rather than
taken
on faith -- each either fixed, or left with an explicit note on why it
needs a feature or deployment owner's sign-off instead of being guessed
at.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018PXMCbRH6i5w47TsjeEUMT

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-03 16:17:24 -08:00

89 lines
3.1 KiB
Plaintext

---
title: "Refresh a materialized view"
sidebarTitle: "Refresh Materialized View"
description: "Bring a materialized view up to date after its source data changes."
icon: arrows-rotate
keywords: ["materialized view", "refresh", "auto_refresh_enabled", "auto_refresh_interval_seconds"]
availability:
embedded: unavailable
enterprise: available
---
Refresh a [materialized view](/feature-engineering/materialized-views) to
bring its stored rows up to date after the source table changes.
<Note>
In SQL this is [`REFRESH MATERIALIZED VIEW`](/sql/dml/refresh-materialized-view).
</Note>
## Refresh a view {#refresh}
<CodeGroup>
```python Python icon="python"
view.refresh()
```
</CodeGroup>
In LanceDB Embedded, every refresh rebuilds the view completely from its
source query -- there is no incremental refresh there. Calling it again
with no source changes still rebuilds and commits a new table version. In
LanceDB Enterprise, the server chooses the refresh mode instead; pass
`full=True` to force a full rebuild there too.
In LanceDB Embedded, the result reports what the refresh did:
<CodeGroup>
```python Python icon="python"
result = view.refresh()
result.rows_written # rows in the rebuilt view
result.source_version # the source table version the view now reflects
result.version # the view's own new table version
```
</CodeGroup>
LanceDB Enterprise refreshes run through its SQL job adapter, which doesn't
expose these metrics: `mode`, `rows_written` and `source_version` are all
`None` on an Enterprise result, even though the refresh itself ran.
Pass `source_version=N` to refresh against a particular source version
instead of the latest. This is a LanceDB Embedded capability only --
LanceDB Enterprise's SQL refresh does not support pinning a source version:
<CodeGroup>
```python Python icon="python"
view.refresh(source_version=12) # LanceDB Embedded only
```
</CodeGroup>
Use `view.table.count_rows()` for the view's row count at any time; on
LanceDB Embedded it always matches `rows_written` from the most recent
refresh.
## Automatic refresh {#auto-refresh}
A materialized view can refresh itself on a schedule instead of waiting
for an explicit `refresh()` call. See [Auto Refresh](/enterprise/auto-refresh)
for enabling it at creation, the SQL and SDK forms for changing the
setting afterward, and how it differs from a computed column's
per-output granularity.
## When a refresh fails {#failures}
A refresh replaces the view's stored rows in one commit, so a failure leaves
the view as it was after its last successful refresh. Fix the cause and
refresh again.
## Related guides {#next}
<CardGroup cols={2}>
<Card title="Create a materialized view" icon="table" href="/feature-engineering/materialized-views">
Define the query a view stores.
</Card>
<Card title="Refresh a computed column" icon="arrows-rotate" href="/feature-engineering/refresh-column">
The same idea, for a single derived column.
</Card>
<Card title="Auto Refresh" icon="clock-rotate-left" href="/enterprise/auto-refresh">
Refresh on a schedule instead of calling this yourself.
</Card>
</CardGroup>