documentation/query/sql/drop-mat-view.md
Permanently deletes a materialized view and all its data.
DROP MATERIALIZED VIEW [ IF EXISTS ] viewName
| Parameter | Description |
|---|---|
viewName | Name of the materialized view to drop |
IF EXISTS | Suppress error if view doesn't exist |
DROP MATERIALIZED VIEW trades_hourly;
DROP MATERIALIZED VIEW IF EXISTS trades_hourly;
| Aspect | Description |
|---|---|
| Permanence | Deletion is permanent and not recoverable |
| Space reclamation | Disk space is reclaimed asynchronously |
| Active queries | Existing read queries may delay space reclamation |
| Non-standard volumes | View is logically removed; data remains in the volume |
:::warning This operation cannot be undone. The view and all its pre-computed data will be permanently deleted. :::
Dropping a materialized view requires the DROP MATERIALIZED VIEW permission on
the specific view:
GRANT DROP MATERIALIZED VIEW ON trades_hourly TO user1;
The view creator automatically receives this permission with the GRANT option.
| Error | Cause |
|---|---|
materialized view does not exist | View doesn't exist and IF EXISTS not specified |
permission denied | Missing DROP MATERIALIZED VIEW permission (Enterprise) |