ALTER MATERIALIZED VIEW ADD INDEX

Indexes an existing symbol column.

Syntax

Flow chart showing the syntax of the ALTER MATERIALIZED VIEW with ADD INDEX keyword

Adding an index is an atomic, non-blocking, and non-waiting operation. Once complete, the SQL optimizer will start using the new index for SQL executions.

warning
  • The index capacity and symbol capacity are different settings.
  • The index capacity value should not be changed, unless a user is aware of all the implications.
  • To learn more about index capacity, check the Index concept page.

Example

Adding an index with default capacity
ALTER MATERIALIZED VIEW trades_1h
ALTER COLUMN symbol ADD INDEX;