# MATERIALIZED VIEW

Config path: `/<database>/<schema>/materialized_view/<name>.yaml`

Example:

```yaml
text: |-
  SELECT id, name
  FROM test_ext_table_1

is_secure: true
```

## Schema

* **columns** (dict)
  * *{key}* (ident) - column name
  * *{value}* (str) - column comment
* <mark style="background-color:red;">**text**</mark> (str) - view text
* **is\_secure** (bool) - is view secure
* **cluster\_by** (list)
  * *{items}* (str) - SQL expressions for CLUSTER BY
* **comment** (str)

## Usage notes

1. If you include **cluster\_by**, **columns** are also required.
2. Maintenance of materialized views implicitly incurs [additional costs](https://docs.snowflake.com/en/user-guide/views-materialized.html#label-materialized-views-maintenance-billing).
3. Invalid materialized views will be re-created automatically.

## Links

* [CREATE MATERIALIZED VIEW](https://docs.snowflake.com/en/sql-reference/sql/create-materialized-view.html)
* [SHOW MATERIALIZED VIEWS](https://docs.snowflake.com/en/sql-reference/sql/show-materialized-views.html)
* [Working with Materialized Views](https://docs.snowflake.com/en/user-guide/views-materialized.html)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/materialized_view.py)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snowddl.com/basic/yaml-configs/materialized-view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
