外观
本页尚未翻译
本页内容仍为英文原文,源自官方文档 management/view。中文翻译正在分批进行中。
Views
A saved query, evaluated when read.
Applies to: Embedded ❌, Enterprise ✅
A view saves a query that you can refer to by name. Reading the view executes that query against the source tables, using their read-consistency behavior. Views do not store a separate copy of the result.
It is the counterpart to a materialized view, which stores rows and is brought up to date by a refresh. Both are catalog objects defined by a query; choose a materialized view when you need to store and reuse the result.
| View | Materialized view | |
|---|---|---|
| Stores | the query | the rows |
| Freshness | follows source-table reads | as of the last refresh |
| Read cost | executes the saved query | queries the stored result |
| Write cost | none | a refresh |
Views are created in LanceDB Enterprise, either in SQL over the Flight SQL endpoint or with the SDKs' create_view / createView, which send the query to the deployment. Either way, the deployment must have views enabled. See View for CREATE VIEW, DROP VIEW, and listing.
Privileges
A view's OWNERSHIP and SELECT are granted through the REST ACL API or SQL GRANT/REVOKE:
sql
GRANT SELECT ON VIEW dashboard TO ROLE analystsSee Privileges for the full statement syntax and every target it reaches.