ALTER INDEX
New in v0.4.3.
ALTER INDEX
changes the parameters of an index.
Syntax
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. |
Details
Enabling indexes
After booting Materialize in
--disable-user-indexes
mode, you can enable
individual indexes. This lets Materialize use the index again, which:
- Restarts the dataflow associated with the index, which can in turn e.g. start ingesting data from sources or sending data to sinks
- Allows inserting into tables
Tables
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.
Examples
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);