Materialize Documentation
Join the Community github/materialize


New in v0.4.3.

ALTER INDEX changes the parameters of an index.


ALTER INDEX name SET ENABLED ( field = val , ) RESET ( field , )
Field Use
name The identifier of the index you want to alter.
ENABLED Enable the index, which lets Materialize use it again after being disabled.
field The name of the option you want to alter.
val The new value for the option.

SET/RESET options

The following option is valid within the SET and RESET clauses:

Name Permitted values Default value Description
logical_compaction_window SQL interval string ‘1ms’ Overrides the logical compaction window for the data stored in this index. The default value is controlled by the --logical-compaction-window command-line option.


Enabling indexes

After booting Materialize in --disable-user-indexes mode, you can enable individual indexes. This lets Materialize use the index again, which:


Note that when enabling indexes on tables, the first index you enable must be the table’s primary index, which was created at the same time as the table itself. Only after enabling the primary index can you enable any secondary indexes.


To adjust the logical compaction window for the index named some_primary_idx:

ALTER INDEX some_primary_idx SET (logical_compaction_window = '500ms');

To reset the logical compaction window to its default value:

ALTER INDEX some_primary_idx RESET (logical_compaction_window);

See also