> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://docs.lancedb.com/management/materialized-view.md), which stores rows and is
brought up to date by a refresh. Both are [catalog objects](https://docs.lancedb.com/basics/catalog.md)
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](https://docs.lancedb.com/sql.md#connecting) or with the SDKs' `create_view` /
`createView`, which send the query to the deployment. Either way, the deployment
must have views enabled. See [View](https://docs.lancedb.com/sql/ddl/view.md) 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 SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
GRANT SELECT ON VIEW dashboard TO ROLE analysts
```

See [Privileges](https://docs.lancedb.com/governance/privileges.md#sql) for the full statement syntax
and every target it reaches.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.