DROP MATERIALIZED VIEW

info

Materialized View support is in beta.

It may not be fit for production use.

To enable beta materialized views, set cairo.mat.view.enabled=true in server.conf, or export the equivalent environment variable: QDB_CAIRO_MAT_VIEW_ENABLED=true.

Please let us know if you run into issues.

Either:

  1. Email us at support@questdb.io
  2. Join our public Slack
  3. Post on our Discourse community

DROP MATERIALIZED VIEW permanently deletes a materialized view and its contents.

The deletion is permanent and not recoverable, except if the view was created in a non-standard volume. In such cases, the view is only logically removed while the underlying data remains intact in its volume.

Disk space is reclaimed asynchronously after the materialized view is dropped.

Existing read queries for this view may delay space reclamation.

Syntax

Flow chart showing the syntax of the DROP MATERIALIZED VIEW keyword

Example

DROP MATERIALIZED VIEW trades_1h;

IF EXISTS

Add an optional IF EXISTS clause after the DROP MATERIALIZED VIEW keywords to indicate that the selected materialized view should be dropped, but only if it exists.

See also

For more information on the concept, see the reference on materialized views.