DROP MATERIALIZED VIEW
Permanently deletes a materialized view and all its data.
Syntax
DROP MATERIALIZED VIEW [ IF EXISTS ] viewName
Parameters
| Parameter | Description |
|---|---|
viewName | Name of the materialized view to drop |
IF EXISTS | Suppress error if view doesn't exist |
Examples
Drop a materialized view
DROP MATERIALIZED VIEW trades_hourly;
Drop only if exists (no error if missing)
DROP MATERIALIZED VIEW IF EXISTS trades_hourly;
Behavior
| 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.
Permissions (Enterprise)
Dropping a materialized view requires the DROP MATERIALIZED VIEW permission on
the specific view:
Grant drop permission
GRANT DROP MATERIALIZED VIEW ON trades_hourly TO user1;
The view creator automatically receives this permission with the GRANT option.
Errors
| Error | Cause |
|---|---|
materialized view does not exist | View doesn't exist and IF EXISTS not specified |
permission denied | Missing DROP MATERIALIZED VIEW permission (Enterprise) |