> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/sql-commands/materialized-views/drop-materialized-view.md).

# DROP MATERIALIZED VIEW

This command drops the specified materialized view and deletes its data.

Note that if there are existing jobs that are dependent upon the materialized view in question, then it cannot be dropped.

## Syntax

```sql
DROP MATERIALIZED VIEW [ IF EXISTS ] <mv_identifier>
    [ COMPUTE_CLUSTER = <cluster_identifier> ];
```

#### `COMPUTE_CLUSTER`

Type: `identifier`

Default: The sole cluster in your environment

(Optional) The cluster that processes the deletion.

This option can only be omitted when there is just one cluster in your environment.

When you have more than one compute cluster, you are required to provide which one to use through this option.

#### `IF EXISTS`&#x20;

(Optional) To prevent the Upsolver query engine from returning an error if the materialized view does not exist, include `IF EXISTS` in your `DROP` statement; instead, you will see the message **Operation resulted in no change**.&#x20;

## Example&#x20;

The following example runs a `DROP` statement with `IF EXISTS` to drop the materialized view, **sales\_data\_totals**. By including `IF EXISTS`, an error is not encountered if the materialized view does not exist. Otherwise, if the materialized view exists, it will be dropped from the organization:&#x20;

```sql
DROP MATERIALIZED VIEW IF EXISTS "sales_data_totals";
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/sql-commands/materialized-views/drop-materialized-view.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
