.disable | .enable materialized-view.disable | .enable materialized-view

可以通过以下任一方式禁用具体化视图:A materialized view can be disabled in any of the following ways:

  • 系统自动禁用: 如果具体化因永久性错误而失败,则会自动禁用具体化视图。Automatic disable by the system: Materialized view is automatically disabled if materialization fails with a permanent error. 此过程可能在以下情况下发生:This process can occur in the following instances:
    • 与视图定义不一致的架构更改。Schema changes that are inconsistent with the view definition.
    • 对源表的更改导致具体化视图查询在语义上无效。Changes to source table that result in the materialized view query being semantically invalid.
  • 显式禁用具体化视图: 如果具体化视图对群集的运行状况产生负面影响(例如,消耗过多的 CPU),请使用下面的命令禁用该视图。Explicitly disable the materialized view: If the materialized view is negatively impacting the cluster's health (for example, consuming too much CPU), disable the view using the command below.

备注

  • 禁用具体化视图后,具体化会暂停,不会消耗群集中的资源。When a materialized view is disabled, materializing will be paused and won't consume resources from the cluster. 即使具体化视图处于禁用状态,也可以对其进行查询,但性能可能会很差。Querying the materialized view is possible even when disabled, but performance can be poor. 已禁用的具体化视图的性能取决于自禁用后引入到源表的记录数。Performance on a disabled materialized view depends on the number of records that were ingested to the source table since it was disabled.
  • 可以启用以前已禁用的具体化视图。You can enable a materialized view that has previously been disabled. 具体化视图在重新启用后会继续从中断处具体化,不会跳过任何记录。When re-enabled, the materialized view will continue materializing from the point it left off, and no records will be skipped. 如果该视图长时间被禁用,可能需要很长时间才能赶上进度。If the view was disabled for a long time, it may take a long time to catch up.

仅当你怀疑某个视图影响群集的运行状况时,才建议禁用该视图。Disabling a view is only recommended if you suspect that the view is impacting your cluster's health.

语法Syntax

.enable | disable materialized-view MaterializedViewName.enable | disable materialized-view MaterializedViewName

属性Properties

propertiesProperty 类型Type 说明Description
MaterializedViewNameMaterializedViewName 字符串String 具体化视图的名称。Name of the materialized view.

示例Example

.enable materialized-view ViewName

.disable materialized-view ViewName