diff --git a/doc/user/content/sql/system-catalog/mz_internal.md b/doc/user/content/sql/system-catalog/mz_internal.md index 5dfccce9ff6ff..b395ec32b0fe0 100644 --- a/doc/user/content/sql/system-catalog/mz_internal.md +++ b/doc/user/content/sql/system-catalog/mz_internal.md @@ -1689,10 +1689,14 @@ The `mz_webhook_sources` table contains a row for each webhook source in the sys + + + + diff --git a/src/catalog/src/builtin.rs b/src/catalog/src/builtin.rs index 5484373ec09d8..49b9504de623b 100644 --- a/src/catalog/src/builtin.rs +++ b/src/catalog/src/builtin.rs @@ -1151,6 +1151,12 @@ pub static BUILTINS_STATIC: LazyLock>> = LazyLock::ne let mut builtin_items = vec![ Builtin::Source(&MZ_CATALOG_RAW), + Builtin::MaterializedView(&MZ_CATALOG_STATE), + Builtin::MaterializedView(&MZ_CATALOG_ITEMS), + Builtin::View(&MZ_CATALOG_ITEM_METADATA), + Builtin::Index(&MZ_CATALOG_ITEM_METADATA_IND), + Builtin::View(&MZ_BUILTIN_OBJECT_MAPPINGS), + Builtin::Index(&MZ_BUILTIN_OBJECT_MAPPINGS_IND), Builtin::Log(&MZ_ARRANGEMENT_SHARING_RAW), Builtin::Log(&MZ_ARRANGEMENT_BATCHES_RAW), Builtin::Log(&MZ_ARRANGEMENT_RECORDS_RAW), diff --git a/src/catalog/src/builtin/mz_internal.rs b/src/catalog/src/builtin/mz_internal.rs index 0c2a2fe8e24d5..7b8292aebfbc9 100644 --- a/src/catalog/src/builtin/mz_internal.rs +++ b/src/catalog/src/builtin/mz_internal.rs @@ -41,6 +41,8 @@ use super::{ SUPPORT_SELECT, }; +// TODO(SQL-932): every builtin relation but `mz_catalog_state` and the audit +// log should stop reading this source and read `mz_catalog_state` instead. pub static MZ_CATALOG_RAW: LazyLock = LazyLock::new(|| BuiltinSource { name: "mz_catalog_raw", schema: MZ_INTERNAL_SCHEMA, @@ -53,6 +55,226 @@ pub static MZ_CATALOG_RAW: LazyLock = LazyLock::new(|| BuiltinSou access: vec![], ontology: None, }); + +/// Every catalog record but the audit log, with its kind as a column. +/// +/// The audit log is append-only, so a relation reading `mz_catalog_raw` decodes +/// the whole audit log at hydration. To optimize on hydration time, +/// catalog relations read this copy instead and filter on `kind`. +pub static MZ_CATALOG_STATE: LazyLock = + LazyLock::new(|| BuiltinMaterializedView { + name: "mz_catalog_state", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::MV_MZ_CATALOG_STATE_OID, + desc: RelationDesc::builder() + .with_column("kind", SqlScalarType::String.nullable(false)) + .with_column("data", SqlScalarType::Jsonb.nullable(false)) + .finish(), + column_comments: BTreeMap::new(), + sql: " +IN CLUSTER mz_catalog_server +WITH (ASSERT NOT NULL kind) AS +SELECT data->>'kind' AS kind, data +FROM mz_internal.mz_catalog_raw +WHERE data->>'kind' <> 'AuditLog'", + is_retained_metrics_object: false, + access: vec![], + ontology: None, + }); +/// Every catalog item that has an `Item` record: user items, including temporary ones, and +/// runtime-alterable builtins such as `mz_internal.mz_analytics`. +/// This is an intermediate layer, intended to be used by +/// downstream builtin item relations (e.g. mz_sources). Without it, +/// they would need to parse DDL statements of all items in the durable catalog +/// then filter down to their specific object type. +/// +/// A temporary item has its owning session in `ephemeral_owner_session`, and its +/// `schema_id` is the placeholder `u0`. +/// +/// A `create_sql` that fails to decode errors this relation and every reader. Once SQL-795 +/// is implemented, per-row errors can be raised in readers through `mz_unsafe.mz_error_if_null`. +pub static MZ_CATALOG_ITEMS: LazyLock = + LazyLock::new(|| BuiltinMaterializedView { + name: "mz_catalog_items", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::MV_MZ_CATALOG_ITEMS_OID, + desc: RelationDesc::builder() + .with_column("id", SqlScalarType::String.nullable(false)) + .with_column("global_id", SqlScalarType::String.nullable(false)) + .with_column("oid", SqlScalarType::Oid.nullable(false)) + .with_column("schema_id", SqlScalarType::String.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column("owner_id", SqlScalarType::String.nullable(false)) + .with_column( + "privileges", + SqlScalarType::Array(Box::new(SqlScalarType::MzAclItem)).nullable(false), + ) + .with_column( + "ephemeral_owner_session", + SqlScalarType::Uuid.nullable(true), + ) + .with_column("type", SqlScalarType::String.nullable(false)) + .with_column("create_sql", SqlScalarType::String.nullable(false)) + .with_column("redacted_create_sql", SqlScalarType::String.nullable(false)) + .with_column("details", SqlScalarType::Jsonb.nullable(false)) + .finish(), + column_comments: BTreeMap::new(), + sql: " +IN CLUSTER mz_catalog_server +WITH ( + ASSERT NOT NULL id, + ASSERT NOT NULL global_id, + ASSERT NOT NULL oid, + ASSERT NOT NULL schema_id, + ASSERT NOT NULL name, + ASSERT NOT NULL owner_id, + ASSERT NOT NULL privileges, + ASSERT NOT NULL type, + ASSERT NOT NULL create_sql, + ASSERT NOT NULL redacted_create_sql, + ASSERT NOT NULL details +) AS +WITH + items AS ( + SELECT + mz_internal.parse_catalog_id(data->'key'->'gid') AS id, + mz_internal.parse_catalog_id(data->'value'->'global_id') AS global_id, + (data->'value'->>'oid')::oid AS oid, + mz_internal.parse_catalog_id(data->'value'->'schema_id') AS schema_id, + data->'value'->>'name' AS name, + mz_internal.parse_catalog_id(data->'value'->'owner_id') AS owner_id, + mz_internal.parse_catalog_privileges(data->'value'->'privileges') AS privileges, + (data->'value'->>'ephemeral_owner_session')::uuid AS ephemeral_owner_session, + data->'value'->'definition'->'V1'->>'create_sql' AS create_sql + FROM mz_internal.mz_catalog_state + WHERE kind = 'Item' + ), + decoded AS ( + SELECT + items.*, + mz_internal.parse_catalog_create_sql(create_sql) AS details + FROM items + ) +SELECT + id, + global_id, + oid, + schema_id, + name, + owner_id, + privileges, + ephemeral_owner_session, + details->>'type' AS type, + create_sql, + mz_internal.redact_sql(create_sql) AS redacted_create_sql, + details +FROM decoded", + is_retained_metrics_object: false, + access: vec![], + ontology: None, + }); + +/// `mz_catalog_items` without the statement text such that the index holds +/// no DDL text. +pub static MZ_CATALOG_ITEM_METADATA: LazyLock = LazyLock::new(|| BuiltinView { + name: "mz_catalog_item_metadata", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::VIEW_MZ_CATALOG_ITEM_METADATA_OID, + desc: RelationDesc::builder() + .with_column("id", SqlScalarType::String.nullable(false)) + .with_column("global_id", SqlScalarType::String.nullable(false)) + .with_column("oid", SqlScalarType::Oid.nullable(false)) + .with_column("schema_id", SqlScalarType::String.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column("owner_id", SqlScalarType::String.nullable(false)) + .with_column( + "privileges", + SqlScalarType::Array(Box::new(SqlScalarType::MzAclItem)).nullable(false), + ) + .with_column( + "ephemeral_owner_session", + SqlScalarType::Uuid.nullable(true), + ) + .with_column("type", SqlScalarType::String.nullable(false)) + .with_column("details", SqlScalarType::Jsonb.nullable(true)) + .finish(), + column_comments: BTreeMap::new(), + sql: " +SELECT + id, + global_id, + oid, + schema_id, + name, + owner_id, + privileges, + ephemeral_owner_session, + type, + details - 'definition' AS details +FROM mz_internal.mz_catalog_items", + access: vec![], + ontology: None, +}); + +pub const MZ_CATALOG_ITEM_METADATA_IND: BuiltinIndex = BuiltinIndex { + name: "mz_catalog_item_metadata_ind", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::INDEX_MZ_CATALOG_ITEM_METADATA_IND_OID, + sql: "IN CLUSTER mz_catalog_server +ON mz_internal.mz_catalog_item_metadata (id)", + is_retained_metrics_object: false, +}; + +/// The catalog ids of builtin objects. +/// +/// Builtin objects' ids come from their `GidMapping` records in the catalog. +pub static MZ_BUILTIN_OBJECT_MAPPINGS: LazyLock = LazyLock::new(|| BuiltinView { + name: "mz_builtin_object_mappings", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::VIEW_MZ_BUILTIN_OBJECT_MAPPINGS_OID, + desc: RelationDesc::builder() + .with_column("schema_name", SqlScalarType::String.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column("object_type", SqlScalarType::String.nullable(false)) + .with_column("id", SqlScalarType::String.nullable(false)) + .with_column("global_id", SqlScalarType::String.nullable(false)) + .finish(), + column_comments: BTreeMap::new(), + // Although these values should never be nullable, JSONB lookup + // types are inferred as nullable. Thus we coalesce to infer as + // non-nullable. + // + // We exclude runtime-alterable builtins to avoid duplicate entries when + // unioning this view with item records in the durable catalog. + sql: Box::leak( + format!( + " +SELECT + COALESCE(data->'key'->>'schema_name', '') AS schema_name, + COALESCE(data->'key'->>'object_name', '') AS name, + COALESCE(data->'key'->>'object_type', '') AS object_type, + COALESCE('s' || (data->'value'->>'catalog_id'), '') AS id, + COALESCE('s' || (data->'value'->>'global_id'), '') AS global_id +FROM mz_internal.mz_catalog_state +WHERE + kind = 'GidMapping' AND + data->'value'->>'fingerprint' <> '{RUNTIME_ALTERABLE_FINGERPRINT_SENTINEL}'" + ) + .into_boxed_str(), + ), + access: vec![], + ontology: None, +}); + +pub const MZ_BUILTIN_OBJECT_MAPPINGS_IND: BuiltinIndex = BuiltinIndex { + name: "mz_builtin_object_mappings_ind", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::INDEX_MZ_BUILTIN_OBJECT_MAPPINGS_IND_OID, + sql: "IN CLUSTER mz_catalog_server +ON mz_internal.mz_builtin_object_mappings (schema_name, name)", + is_retained_metrics_object: false, +}; + pub static MZ_POSTGRES_SOURCES: LazyLock = LazyLock::new(|| { BuiltinMaterializedView { name: "mz_postgres_sources", diff --git a/src/pgrepr-consts/src/oid.rs b/src/pgrepr-consts/src/oid.rs index 60008f175c477..919bf45816c76 100644 --- a/src/pgrepr-consts/src/oid.rs +++ b/src/pgrepr-consts/src/oid.rs @@ -851,3 +851,9 @@ pub const MV_MZ_QUERY_POLICIES_OID: u32 = 17141; pub const MV_MZ_QUERY_POLICY_RULES_OID: u32 = 17142; pub const VIEW_MZ_SHOW_QUERY_POLICIES_OID: u32 = 17143; pub const MV_MZ_QUERY_POLICY_ATTACHMENTS_OID: u32 = 17144; +pub const MV_MZ_CATALOG_STATE_OID: u32 = 17145; +pub const MV_MZ_CATALOG_ITEMS_OID: u32 = 17146; +pub const VIEW_MZ_CATALOG_ITEM_METADATA_OID: u32 = 17147; +pub const INDEX_MZ_CATALOG_ITEM_METADATA_IND_OID: u32 = 17148; +pub const VIEW_MZ_BUILTIN_OBJECT_MAPPINGS_OID: u32 = 17150; +pub const INDEX_MZ_BUILTIN_OBJECT_MAPPINGS_IND_OID: u32 = 17151; diff --git a/test/sqllogictest/autogenerated/mz_internal.slt b/test/sqllogictest/autogenerated/mz_internal.slt index 9ce0b200b5090..7037d0d1443c7 100644 --- a/test/sqllogictest/autogenerated/mz_internal.slt +++ b/test/sqllogictest/autogenerated/mz_internal.slt @@ -843,10 +843,14 @@ mz_builtin_index_columns mz_builtin_indexes mz_builtin_log_indexes mz_builtin_materialized_views +mz_builtin_object_mappings mz_builtin_sources mz_builtin_tables mz_builtin_views +mz_catalog_item_metadata +mz_catalog_items mz_catalog_raw +mz_catalog_state mz_cluster_auto_scaling_strategies mz_cluster_deployment_lineage mz_cluster_reconfigurations diff --git a/test/sqllogictest/catalog_server_explain.slt b/test/sqllogictest/catalog_server_explain.slt index a8dfd2e8aba69..3929141b227b9 100644 --- a/test/sqllogictest/catalog_server_explain.slt +++ b/test/sqllogictest/catalog_server_explain.slt @@ -488,6 +488,25 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN INDEX "mz_internal"."mz_builtin_object_mappings_ind"; +---- +mz_internal.mz_builtin_object_mappings_ind: + →Arrange (#0{schema_name}, #1{name}) + →Stream mz_internal.mz_builtin_object_mappings + +mz_internal.mz_builtin_object_mappings: + →Read mz_internal.mz_catalog_state + +Source mz_internal.mz_catalog_state + project=(#4..=#8) + filter=((#0{kind} = "GidMapping") AND ("" != (#2 ->> "fingerprint"))) + map=((#1{data} -> "value"), (#1{data} -> "key"), coalesce((#3 ->> "schema_name"), ""), coalesce((#3 ->> "object_name"), ""), coalesce((#3 ->> "object_type"), ""), coalesce(("s" || (#2 ->> "catalog_id")), ""), coalesce(("s" || (#2 ->> "global_id")), "")) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN INDEX "mz_internal"."mz_cluster_auto_scaling_strategies_ind"; ---- @@ -501,6 +520,24 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN INDEX "mz_internal"."mz_catalog_item_metadata_ind"; +---- +mz_internal.mz_catalog_item_metadata_ind: + →Arrange (#0{id}) + →Stream mz_internal.mz_catalog_item_metadata + +mz_internal.mz_catalog_item_metadata: + →Read mz_internal.mz_catalog_items + +Source mz_internal.mz_catalog_items + project=(#0..=#8, #12) + map=((#11{details} - "definition")) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN INDEX "mz_internal"."mz_cluster_deployment_lineage_ind"; ---- @@ -4949,7 +4986,7 @@ mz_catalog.mz_columns: Project: #6, #0..=#3, #7, #4, #5 Map: null →Arrange (#0{schema_name}, #1{relation_name}) - →Constant (1956 rows) + →Constant (1985 rows) →Arrange (#1{schema_name}, #2{name}) →Fused with Child Map/Filter/Project Project: #6, #4, #3 @@ -5092,7 +5129,7 @@ mz_catalog.mz_index_columns: Project: #3, #0, #1, #4, #2 Map: null →Arrange (#0{name}) - →Constant (95 rows) + →Constant (98 rows) →Arrange (#1{name}) →Fused with Child Map/Filter/Project Project: #4, #3 @@ -5162,7 +5199,7 @@ mz_catalog.mz_indexes: Project: #2, #0, #1, #3, #4, #7, #5, #6 Map: "s1" →Arrange (#1{name}) (#2{on_schema_name}, #3{on_name}) - →Constant (82 rows) + →Constant (84 rows) →Arrange (empty key) (#1{name}) →Fused with Child Map/Filter/Project Project: #4, #3 @@ -5338,31 +5375,31 @@ mz_catalog.mz_materialized_views: →Delta Cross Join [%0[#1{schema_name}, #2{name}] » %1:mz_catalog_raw[#0{schema_name}, #1{name}] » %2:mz_schemas[#1{name}] » %3:mz_clusters[×]] [%1:mz_catalog_raw[×] » %0[#1{schema_name}, #2{name}] » %2:mz_schemas[#1{name}] » %3:mz_clusters[×]] [%2:mz_schemas[#1{name}] » %1:mz_catalog_raw[#0{schema_name}] » %0[#1{schema_name}, #2{name}] » %3:mz_clusters[×]] [%3:mz_clusters[×] » %1:mz_catalog_raw[×] » %0[#1{schema_name}, #2{name}] » %2:mz_schemas[#1{name}]] path %0: Final closure: - Project: #4, #0, #5, #1, #6, #2, #9, #8, #3, #7 - Map: {=r/s1, s1=r/s1}, "s1" + Project: #5, #0, #6, #1, #7, #2, #9, #3, #4, #8 + Map: "s1" path %1: after %0: - Project: #3, #1, #4, #5, #0, #2, #6 - Map: redact_sql(#5{create_sql}) + Project: #3, #1, #4..=#6, #0, #2, #7 + Map: redact_sql(#6{create_sql}) Final closure: - Project: #4, #0, #5, #1, #6, #2, #9, #8, #3, #7 - Map: {=r/s1, s1=r/s1}, "s1" + Project: #5, #0, #6, #1, #7, #2, #9, #3, #4, #8 + Map: "s1" path %2: after %0: - Project: #4, #1, #5, #6, #2, #3, #7 - Map: redact_sql(#6{create_sql}) + Project: #4, #1, #5..=#7, #2, #3, #8 + Map: redact_sql(#7{create_sql}) Final closure: - Project: #4, #0, #5, #1, #6, #2, #9, #8, #3, #7 - Map: {=r/s1, s1=r/s1}, "s1" + Project: #5, #0, #6, #1, #7, #2, #9, #3, #4, #8 + Map: "s1" path %3: after %0: - Project: #4, #1, #5, #6, #0, #2, #3, #7 - Map: redact_sql(#6{create_sql}) + Project: #4, #1, #5..=#7, #0, #2, #3, #8 + Map: redact_sql(#7{create_sql}) Final closure: - Project: #4, #0, #5, #1, #6, #2, #9, #8, #3, #7 - Map: {=r/s1, s1=r/s1}, "s1" + Project: #5, #0, #6, #1, #7, #2, #9, #3, #4, #8 + Map: "s1" →Arrange (#1{schema_name}, #2{name}) - →Constant (54 rows) + →Constant (56 rows) →Arrange (empty key) (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project Project: #4, #3, #5 @@ -5762,7 +5799,7 @@ mz_catalog.mz_views: Project: #5, #0, #6, #1, #2, #8, #3, #4, #7 Map: "s1" →Arrange (#1{schema_name}, #2{name}) - →Constant (199 rows) + →Constant (201 rows) →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project Project: #5, #4, #6 @@ -5802,6 +5839,36 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN MATERIALIZED VIEW "mz_internal"."mz_catalog_items"; +---- +mz_internal.mz_catalog_items: + →Read mz_internal.mz_catalog_state + +Source mz_internal.mz_catalog_state + project=(#2, #4..=#10, #13, #11, #14, #12) + filter=((#0{kind} = "Item")) + map=(parse_catalog_id(((#1{data} -> "key") -> "gid")), (#1{data} -> "value"), parse_catalog_id((#3 -> "global_id")), text_to_oid((#3 ->> "oid")), parse_catalog_id((#3 -> "schema_id")), (#3 ->> "name"), parse_catalog_id((#3 -> "owner_id")), parse_catalog_privileges((#3 -> "privileges")), text_to_uuid((#3 ->> "ephemeral_owner_session")), (((#3 -> "definition") -> "V1") ->> "create_sql"), parse_catalog_create_sql(#11{create_sql}), (#12{details} ->> "type"), redact_sql(#11{create_sql})) + +Target cluster: mz_catalog_server + +EOF + +query T multiline +EXPLAIN MATERIALIZED VIEW "mz_internal"."mz_catalog_state"; +---- +mz_internal.mz_catalog_state: + →Read mz_internal.mz_catalog_raw + +Source mz_internal.mz_catalog_raw + project=(#1, #0) + filter=(("AuditLog" != #1) AND (#1 != "AuditLog")) + map=((#0{data} ->> "kind")) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN MATERIALIZED VIEW "mz_internal"."mz_cluster_auto_scaling_strategies"; ---- @@ -5903,7 +5970,7 @@ mz_internal.mz_history_retention_strategies: Project: #3, #5 Map: ("s" || ((#4{data} -> "value") ->> "catalog_id")) →Arrange (#2{name}, #0{object_type}, #1{schema_name}) - →Constant (183 rows) + →Constant (187 rows) →Arrange (((#0{data} -> "key") ->> "object_name"), ((#0{data} -> "key") ->> "object_type"), ((#0{data} -> "key") ->> "schema_name")) →Fused with Child Map/Filter/Project Project: #0 @@ -6065,7 +6132,7 @@ mz_internal.mz_materialized_view_refresh_strategies: Project: #0..=#3, #3 Map: "on-commit", null, null →Arrange (#1{name}, #0{schema_name}) - →Constant (54 rows) + →Constant (56 rows) →Arrange (((#0{data} -> "key") ->> "object_name"), ((#0{data} -> "key") ->> "schema_name")) →Fused with Child Map/Filter/Project Project: #0 @@ -6249,7 +6316,7 @@ mz_internal.mz_object_dependencies: Project: #4..=#6, #2 Filter: case when (#7{ref_kind} = "func") then (#3{object_type} = "8") else case when (#7{ref_kind} = "type") then (#3{object_type} = "7") else ((#3{object_type} != "7") AND (#3{object_type} != "8")) end end →Arrange (#0{object_schema}..=#2{object_type}) (#3{ref_schema}, #4{ref_name}) - →Constant (1106 rows) + →Constant (1118 rows) →Arrange (#1{schema_name}..=#3{object_type}) →Fused with Child Map/Filter/Project Project: #5, #4, #2, #3 @@ -8862,7 +8929,7 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_columns"; ---- Explained Query (fast path): - →Constant (1956 rows) + →Constant (1985 rows) Target cluster: mz_catalog_server @@ -8872,7 +8939,7 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_index_columns"; ---- Explained Query (fast path): - →Constant (178 rows) + →Constant (181 rows) Target cluster: mz_catalog_server @@ -8882,7 +8949,7 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_indexes"; ---- Explained Query (fast path): - →Constant (82 rows) + →Constant (84 rows) Target cluster: mz_catalog_server @@ -8902,7 +8969,21 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_materialized_views"; ---- Explained Query (fast path): - →Constant (54 rows) + →Constant (56 rows) + +Target cluster: mz_catalog_server + +EOF + +query T multiline +EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_object_mappings"; +---- +Explained Query (fast path): + →Map/Filter/Project + →Indexed mz_internal.mz_builtin_object_mappings (using mz_internal.mz_builtin_object_mappings_ind) + +Used Indexes: + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) Target cluster: mz_catalog_server @@ -8932,7 +9013,21 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_views"; ---- Explained Query (fast path): - →Constant (199 rows) + →Constant (201 rows) + +Target cluster: mz_catalog_server + +EOF + +query T multiline +EXPLAIN SELECT * FROM "mz_internal"."mz_catalog_item_metadata"; +---- +Explained Query (fast path): + →Map/Filter/Project + →Indexed mz_internal.mz_catalog_item_metadata (using mz_internal.mz_catalog_item_metadata_ind) + +Used Indexes: + - mz_internal.mz_catalog_item_metadata_ind (*** full scan ***) Target cluster: mz_catalog_server @@ -10883,7 +10978,7 @@ Explained Query: Project: #3, #4 Filter: case when (#2{ref_kind} = "func") then (#5{object_type} = "8") else case when (#2{ref_kind} = "type") then (#5{object_type} = "7") else ((#5{object_type} != "7") AND (#5{object_type} != "8")) end end →Unarranged Raw Stream - →Constant (1106 rows) + →Constant (1118 rows) →Arrange (#1{schema_name}..=#3{object_type}) →Fused with Child Map/Filter/Project Project: #5, #4, #2, #3 diff --git a/test/sqllogictest/cluster.slt b/test/sqllogictest/cluster.slt index cce0e570accd3..57dabf78eaa67 100644 --- a/test/sqllogictest/cluster.slt +++ b/test/sqllogictest/cluster.slt @@ -424,7 +424,7 @@ CREATE CLUSTER test REPLICAS (foo (SIZE 'scale=1,workers=1')); query I SELECT COUNT(name) FROM mz_indexes; ---- -313 +315 statement ok DROP CLUSTER test CASCADE @@ -432,7 +432,7 @@ DROP CLUSTER test CASCADE query T SELECT COUNT(name) FROM mz_indexes; ---- -280 +282 simple conn=mz_system,user=mz_system ALTER CLUSTER quickstart OWNER TO materialize diff --git a/test/sqllogictest/cockroach/srfs.slt b/test/sqllogictest/cockroach/srfs.slt index 22e90ff5990a9..ed905912b6a57 100644 --- a/test/sqllogictest/cockroach/srfs.slt +++ b/test/sqllogictest/cockroach/srfs.slt @@ -1138,6 +1138,9 @@ mz_arrangement_sharing_raw 2 mz_arrangement_sharing_raw 2 mz_arrangement_sharing_raw 2 mz_arrangement_sharing_raw 2 +mz_builtin_object_mappings 1 +mz_builtin_object_mappings 2 +mz_catalog_item_metadata 1 mz_cluster_auto_scaling_strategies 1 mz_cluster_deployment_lineage 1 mz_cluster_prometheus_metrics 1 diff --git a/test/sqllogictest/information_schema_tables.slt b/test/sqllogictest/information_schema_tables.slt index d77cf67cdf072..12a990ca960c4 100644 --- a/test/sqllogictest/information_schema_tables.slt +++ b/test/sqllogictest/information_schema_tables.slt @@ -309,6 +309,10 @@ mz_builtin_materialized_views VIEW materialize mz_internal +mz_builtin_object_mappings +VIEW +materialize +mz_internal mz_builtin_sources VIEW materialize @@ -321,10 +325,22 @@ mz_builtin_views VIEW materialize mz_internal +mz_catalog_item_metadata +VIEW +materialize +mz_internal +mz_catalog_items +MATERIALIZED VIEW +materialize +mz_internal mz_catalog_raw SOURCE materialize mz_internal +mz_catalog_state +MATERIALIZED VIEW +materialize +mz_internal mz_cluster_auto_scaling_strategies MATERIALIZED VIEW materialize diff --git a/test/sqllogictest/mz_catalog_items.slt b/test/sqllogictest/mz_catalog_items.slt new file mode 100644 index 0000000000000..abdffa5d1d260 --- /dev/null +++ b/test/sqllogictest/mz_catalog_items.slt @@ -0,0 +1,105 @@ +# Copyright Materialize, Inc. and contributors. All rights reserved. +# +# Use of this software is governed by the Business Source License +# included in the LICENSE file at the root of this repository. +# +# As of the Change Date specified in that file, in accordance with +# the Business Source License, use of this software will be governed +# by the Apache License, Version 2.0. + +mode cockroach + +reset-server + +statement ok +CREATE TABLE t (a INT DEFAULT 1, b TEXT) + +statement ok +CREATE VIEW v AS SELECT 'secret' AS s, a FROM t + +statement ok +CREATE DEFAULT INDEX ON v + +# mz_catalog_items decodes every item the way the existing decoders do. + +simple conn=mz_system,user=mz_system +SELECT + count(*) FILTER (WHERE name IN ('t', 'v', 'v_primary_idx')), + count(*) FILTER ( + WHERE type IS DISTINCT FROM details->>'type' + OR details IS DISTINCT FROM mz_internal.parse_catalog_create_sql(create_sql) + OR redacted_create_sql IS DISTINCT FROM mz_internal.redact_sql(create_sql) + ) +FROM mz_internal.mz_catalog_items; +---- +3,0 +COMPLETE 1 + +# Its identity columns match mz_objects, and every user object is in it. + +simple conn=mz_system,user=mz_system +WITH items AS (SELECT id, oid, schema_id, name, owner_id, type FROM mz_internal.mz_catalog_items), +objects AS (SELECT id, oid, schema_id, name, owner_id, type FROM mz_catalog.mz_objects) +SELECT count(*) FROM ( + (SELECT * FROM items EXCEPT ALL SELECT * FROM objects) + UNION ALL + (SELECT * FROM objects WHERE id LIKE 'u%' EXCEPT ALL SELECT * FROM items) +); +---- +0 +COMPLETE 1 + +# mz_builtin_object_mappings names every builtin object it maps. + +simple conn=mz_system,user=mz_system +SELECT count(*) > 800, count(*) FILTER (WHERE o.id IS NULL OR o.name <> m.name OR s.name <> m.schema_name) +FROM mz_internal.mz_builtin_object_mappings m +LEFT JOIN (SELECT DISTINCT id, name, schema_id FROM mz_catalog.mz_objects) o ON o.id = m.id +LEFT JOIN mz_catalog.mz_schemas s ON s.id = o.schema_id; +---- +t,0 +COMPLETE 1 + +# A runtime-alterable builtin has an Item record, so it is in mz_catalog_items +# and not in mz_builtin_object_mappings. + +simple conn=mz_system,user=mz_system +SELECT + (SELECT count(*) FROM mz_internal.mz_catalog_items WHERE name = 'mz_analytics'), + (SELECT count(*) FROM mz_internal.mz_builtin_object_mappings WHERE name = 'mz_analytics'), + (SELECT count(*) FROM mz_internal.mz_catalog_items JOIN mz_internal.mz_builtin_object_mappings USING (id)); +---- +1,0,0 +COMPLETE 1 + +# A temporary item carries the session that owns it. + +statement ok +CREATE TEMPORARY TABLE temp_t (a INT) + +simple conn=mz_system,user=mz_system +SELECT name, schema_id, ephemeral_owner_session IN (SELECT id FROM mz_internal.mz_sessions) +FROM mz_internal.mz_catalog_items +WHERE ephemeral_owner_session IS NOT NULL; +---- +temp_t,u0,t +COMPLETE 1 + +# `global_id` is the item's own global id, also where it differs from the catalog id. + +statement ok +CREATE MATERIALIZED VIEW mv AS SELECT count(*) AS c FROM t + +statement ok +CREATE REPLACEMENT MATERIALIZED VIEW mv_r FOR mv AS SELECT count(*) + 1 AS c FROM t + +statement ok +ALTER MATERIALIZED VIEW mv APPLY REPLACEMENT mv_r + +simple conn=mz_system,user=mz_system +SELECT count(*) FILTER (WHERE i.id <> i.global_id), count(*) FILTER (WHERE g.id IS NULL) +FROM mz_internal.mz_catalog_items i +LEFT JOIN mz_internal.mz_object_global_ids g ON g.id = i.id AND g.global_id = i.global_id; +---- +1,0 +COMPLETE 1 diff --git a/test/sqllogictest/mz_catalog_server_index_accounting.slt b/test/sqllogictest/mz_catalog_server_index_accounting.slt index 0b15333a68d2a..a40c89714335e 100644 --- a/test/sqllogictest/mz_catalog_server_index_accounting.slt +++ b/test/sqllogictest/mz_catalog_server_index_accounting.slt @@ -37,110 +37,112 @@ mz_arrangement_heap_capacity_raw_s2_primary_idx CREATE␠INDEX␠"mz_arrangemen mz_arrangement_heap_size_raw_s2_primary_idx CREATE␠INDEX␠"mz_arrangement_heap_size_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_arrangement_heap_size_raw"␠("operator_id",␠"worker_id") mz_arrangement_records_raw_s2_primary_idx CREATE␠INDEX␠"mz_arrangement_records_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_arrangement_records_raw"␠("operator_id",␠"worker_id") mz_arrangement_sharing_raw_s2_primary_idx CREATE␠INDEX␠"mz_arrangement_sharing_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_arrangement_sharing_raw"␠("operator_id",␠"worker_id") -mz_cluster_auto_scaling_strategies_ind CREATE␠INDEX␠"mz_cluster_auto_scaling_strategies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s528␠AS␠"mz_internal"."mz_cluster_auto_scaling_strategies"]␠("cluster_id") -mz_cluster_deployment_lineage_ind CREATE␠INDEX␠"mz_cluster_deployment_lineage_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s781␠AS␠"mz_internal"."mz_cluster_deployment_lineage"]␠("cluster_id") +mz_builtin_object_mappings_ind CREATE␠INDEX␠"mz_builtin_object_mappings_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s459␠AS␠"mz_internal"."mz_builtin_object_mappings"]␠("schema_name",␠"name") +mz_catalog_item_metadata_ind CREATE␠INDEX␠"mz_catalog_item_metadata_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s457␠AS␠"mz_internal"."mz_catalog_item_metadata"]␠("id") +mz_cluster_auto_scaling_strategies_ind CREATE␠INDEX␠"mz_cluster_auto_scaling_strategies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s534␠AS␠"mz_internal"."mz_cluster_auto_scaling_strategies"]␠("cluster_id") +mz_cluster_deployment_lineage_ind CREATE␠INDEX␠"mz_cluster_deployment_lineage_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s787␠AS␠"mz_internal"."mz_cluster_deployment_lineage"]␠("cluster_id") mz_cluster_prometheus_metrics_s2_primary_idx CREATE␠INDEX␠"mz_cluster_prometheus_metrics_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_cluster_prometheus_metrics"␠("process_id",␠"metric_name",␠"labels") -mz_cluster_reconfigurations_ind CREATE␠INDEX␠"mz_cluster_reconfigurations_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s527␠AS␠"mz_internal"."mz_cluster_reconfigurations"]␠("cluster_id") -mz_cluster_replica_frontiers_ind CREATE␠INDEX␠"mz_cluster_replica_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s774␠AS␠"mz_catalog"."mz_cluster_replica_frontiers"]␠("object_id") -mz_cluster_replica_history_ind CREATE␠INDEX␠"mz_cluster_replica_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s629␠AS␠"mz_internal"."mz_cluster_replica_history"]␠("dropped_at") -mz_cluster_replica_metrics_history_ind CREATE␠INDEX␠"mz_cluster_replica_metrics_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s533␠AS␠"mz_internal"."mz_cluster_replica_metrics_history"]␠("replica_id") -mz_cluster_replica_metrics_ind CREATE␠INDEX␠"mz_cluster_replica_metrics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s534␠AS␠"mz_internal"."mz_cluster_replica_metrics"]␠("replica_id") -mz_cluster_replica_name_history_ind CREATE␠INDEX␠"mz_cluster_replica_name_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s630␠AS␠"mz_internal"."mz_cluster_replica_name_history"]␠("id") +mz_cluster_reconfigurations_ind CREATE␠INDEX␠"mz_cluster_reconfigurations_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s533␠AS␠"mz_internal"."mz_cluster_reconfigurations"]␠("cluster_id") +mz_cluster_replica_frontiers_ind CREATE␠INDEX␠"mz_cluster_replica_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s780␠AS␠"mz_catalog"."mz_cluster_replica_frontiers"]␠("object_id") +mz_cluster_replica_history_ind CREATE␠INDEX␠"mz_cluster_replica_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s635␠AS␠"mz_internal"."mz_cluster_replica_history"]␠("dropped_at") +mz_cluster_replica_metrics_history_ind CREATE␠INDEX␠"mz_cluster_replica_metrics_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s539␠AS␠"mz_internal"."mz_cluster_replica_metrics_history"]␠("replica_id") +mz_cluster_replica_metrics_ind CREATE␠INDEX␠"mz_cluster_replica_metrics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s540␠AS␠"mz_internal"."mz_cluster_replica_metrics"]␠("replica_id") +mz_cluster_replica_name_history_ind CREATE␠INDEX␠"mz_cluster_replica_name_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s636␠AS␠"mz_internal"."mz_cluster_replica_name_history"]␠("id") mz_cluster_replica_resource_usage_s2_primary_idx CREATE␠INDEX␠"mz_cluster_replica_resource_usage_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_cluster_replica_resource_usage"␠("process_id",␠"source",␠"metric") -mz_cluster_replica_size_internal_ind CREATE␠INDEX␠"mz_cluster_replica_size_internal_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s523␠AS␠"mz_internal"."mz_cluster_replica_size_internal"]␠("size") -mz_cluster_replica_sizes_ind CREATE␠INDEX␠"mz_cluster_replica_sizes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s522␠AS␠"mz_catalog"."mz_cluster_replica_sizes"]␠("size") -mz_cluster_replica_status_history_ind CREATE␠INDEX␠"mz_cluster_replica_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s535␠AS␠"mz_internal"."mz_cluster_replica_status_history"]␠("replica_id") -mz_cluster_replica_statuses_ind CREATE␠INDEX␠"mz_cluster_replica_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s536␠AS␠"mz_internal"."mz_cluster_replica_statuses"]␠("replica_id") -mz_cluster_replicas_ind CREATE␠INDEX␠"mz_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s532␠AS␠"mz_catalog"."mz_cluster_replicas"]␠("id") -mz_clusters_ind CREATE␠INDEX␠"mz_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s524␠AS␠"mz_catalog"."mz_clusters"]␠("id") -mz_columns_ind CREATE␠INDEX␠"mz_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s495␠AS␠"mz_catalog"."mz_columns"]␠("name") -mz_comments_ind CREATE␠INDEX␠"mz_comments_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s551␠AS␠"mz_internal"."mz_comments"]␠("id") +mz_cluster_replica_size_internal_ind CREATE␠INDEX␠"mz_cluster_replica_size_internal_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s529␠AS␠"mz_internal"."mz_cluster_replica_size_internal"]␠("size") +mz_cluster_replica_sizes_ind CREATE␠INDEX␠"mz_cluster_replica_sizes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s528␠AS␠"mz_catalog"."mz_cluster_replica_sizes"]␠("size") +mz_cluster_replica_status_history_ind CREATE␠INDEX␠"mz_cluster_replica_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s541␠AS␠"mz_internal"."mz_cluster_replica_status_history"]␠("replica_id") +mz_cluster_replica_statuses_ind CREATE␠INDEX␠"mz_cluster_replica_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s542␠AS␠"mz_internal"."mz_cluster_replica_statuses"]␠("replica_id") +mz_cluster_replicas_ind CREATE␠INDEX␠"mz_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s538␠AS␠"mz_catalog"."mz_cluster_replicas"]␠("id") +mz_clusters_ind CREATE␠INDEX␠"mz_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s530␠AS␠"mz_catalog"."mz_clusters"]␠("id") +mz_columns_ind CREATE␠INDEX␠"mz_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s501␠AS␠"mz_catalog"."mz_columns"]␠("name") +mz_comments_ind CREATE␠INDEX␠"mz_comments_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s557␠AS␠"mz_internal"."mz_comments"]␠("id") mz_compute_dataflow_global_ids_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_dataflow_global_ids_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_dataflow_global_ids_per_worker"␠("id",␠"worker_id",␠"global_id") -mz_compute_dependencies_ind CREATE␠INDEX␠"mz_compute_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s755␠AS␠"mz_internal"."mz_compute_dependencies"]␠("dependency_id") +mz_compute_dependencies_ind CREATE␠INDEX␠"mz_compute_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s761␠AS␠"mz_internal"."mz_compute_dependencies"]␠("dependency_id") mz_compute_error_counts_raw_s2_primary_idx CREATE␠INDEX␠"mz_compute_error_counts_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_error_counts_raw"␠("export_id",␠"worker_id") mz_compute_exports_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_exports_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_exports_per_worker"␠("export_id",␠"worker_id") mz_compute_frontiers_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_frontiers_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_frontiers_per_worker"␠("export_id",␠"worker_id") -mz_compute_hydration_times_ind CREATE␠INDEX␠"mz_compute_hydration_times_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s765␠AS␠"mz_internal"."mz_compute_hydration_times"]␠("replica_id") +mz_compute_hydration_times_ind CREATE␠INDEX␠"mz_compute_hydration_times_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s771␠AS␠"mz_internal"."mz_compute_hydration_times"]␠("replica_id") mz_compute_hydration_times_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_hydration_times_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_hydration_times_per_worker"␠("export_id",␠"worker_id") mz_compute_import_frontiers_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_import_frontiers_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_import_frontiers_per_worker"␠("export_id",␠"import_id",␠"worker_id") mz_compute_lir_mapping_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_lir_mapping_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_lir_mapping_per_worker"␠("global_id",␠"lir_id",␠"worker_id") mz_compute_operator_durations_histogram_raw_s2_primary_idx CREATE␠INDEX␠"mz_compute_operator_durations_histogram_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_operator_durations_histogram_raw"␠("id",␠"worker_id",␠"duration_ns") mz_compute_operator_hydration_statuses_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_operator_hydration_statuses_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_operator_hydration_statuses_per_worker"␠("export_id",␠"lir_id",␠"worker_id") -mz_connections_ind CREATE␠INDEX␠"mz_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s530␠AS␠"mz_catalog"."mz_connections"]␠("schema_id") -mz_console_cluster_utilization_overview_24h_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_24h_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s761␠AS␠"mz_internal"."mz_console_cluster_utilization_overview_24h"]␠("cluster_id") -mz_console_cluster_utilization_overview_3h_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_3h_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s760␠AS␠"mz_internal"."mz_console_cluster_utilization_overview_3h"]␠("cluster_id") -mz_console_cluster_utilization_overview_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s759␠AS␠"mz_internal"."mz_console_cluster_utilization_overview"]␠("cluster_id") -mz_databases_ind CREATE␠INDEX␠"mz_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s493␠AS␠"mz_catalog"."mz_databases"]␠("name") +mz_connections_ind CREATE␠INDEX␠"mz_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s536␠AS␠"mz_catalog"."mz_connections"]␠("schema_id") +mz_console_cluster_utilization_overview_24h_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_24h_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s767␠AS␠"mz_internal"."mz_console_cluster_utilization_overview_24h"]␠("cluster_id") +mz_console_cluster_utilization_overview_3h_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_3h_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s766␠AS␠"mz_internal"."mz_console_cluster_utilization_overview_3h"]␠("cluster_id") +mz_console_cluster_utilization_overview_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s765␠AS␠"mz_internal"."mz_console_cluster_utilization_overview"]␠("cluster_id") +mz_databases_ind CREATE␠INDEX␠"mz_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s499␠AS␠"mz_catalog"."mz_databases"]␠("name") mz_dataflow_addresses_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_dataflow_addresses_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_dataflow_addresses_per_worker"␠("id",␠"worker_id") mz_dataflow_channels_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_dataflow_channels_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_dataflow_channels_per_worker"␠("id",␠"worker_id") mz_dataflow_operator_reachability_raw_s2_primary_idx CREATE␠INDEX␠"mz_dataflow_operator_reachability_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_dataflow_operator_reachability_raw"␠("id",␠"worker_id",␠"source",␠"port",␠"update_type",␠"time") mz_dataflow_operators_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_dataflow_operators_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_dataflow_operators_per_worker"␠("id",␠"worker_id") -mz_frontiers_ind CREATE␠INDEX␠"mz_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s746␠AS␠"mz_internal"."mz_frontiers"]␠("object_id") -mz_hydration_statuses_ind CREATE␠INDEX␠"mz_hydration_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s776␠AS␠"mz_internal"."mz_hydration_statuses"]␠("object_id",␠"replica_id") -mz_indexes_ind CREATE␠INDEX␠"mz_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s496␠AS␠"mz_catalog"."mz_indexes"]␠("id") -mz_kafka_sources_ind CREATE␠INDEX␠"mz_kafka_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s489␠AS␠"mz_catalog"."mz_kafka_sources"]␠("id") -mz_materialized_views_ind CREATE␠INDEX␠"mz_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s555␠AS␠"mz_catalog"."mz_materialized_views"]␠("id") +mz_frontiers_ind CREATE␠INDEX␠"mz_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s752␠AS␠"mz_internal"."mz_frontiers"]␠("object_id") +mz_hydration_statuses_ind CREATE␠INDEX␠"mz_hydration_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s782␠AS␠"mz_internal"."mz_hydration_statuses"]␠("object_id",␠"replica_id") +mz_indexes_ind CREATE␠INDEX␠"mz_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s502␠AS␠"mz_catalog"."mz_indexes"]␠("id") +mz_kafka_sources_ind CREATE␠INDEX␠"mz_kafka_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s495␠AS␠"mz_catalog"."mz_kafka_sources"]␠("id") +mz_materialized_views_ind CREATE␠INDEX␠"mz_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s561␠AS␠"mz_catalog"."mz_materialized_views"]␠("id") mz_message_batch_counts_received_raw_s2_primary_idx CREATE␠INDEX␠"mz_message_batch_counts_received_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_message_batch_counts_received_raw"␠("channel_id",␠"from_worker_id",␠"to_worker_id") mz_message_batch_counts_sent_raw_s2_primary_idx CREATE␠INDEX␠"mz_message_batch_counts_sent_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_message_batch_counts_sent_raw"␠("channel_id",␠"from_worker_id",␠"to_worker_id") mz_message_counts_received_raw_s2_primary_idx CREATE␠INDEX␠"mz_message_counts_received_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_message_counts_received_raw"␠("channel_id",␠"from_worker_id",␠"to_worker_id") mz_message_counts_sent_raw_s2_primary_idx CREATE␠INDEX␠"mz_message_counts_sent_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_message_counts_sent_raw"␠("channel_id",␠"from_worker_id",␠"to_worker_id") -mz_metric_sinks_ind CREATE␠INDEX␠"mz_metric_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s553␠AS␠"mz_internal"."mz_metric_sinks"]␠("id") -mz_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s855␠AS␠"mz_internal"."mz_notices"]␠("id") -mz_object_arrangement_size_history_object_ind CREATE␠INDEX␠"mz_object_arrangement_size_history_object_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s768␠AS␠"mz_internal"."mz_object_arrangement_size_history"]␠("object_id") -mz_object_arrangement_size_history_ts_ind CREATE␠INDEX␠"mz_object_arrangement_size_history_ts_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s768␠AS␠"mz_internal"."mz_object_arrangement_size_history"]␠("collection_timestamp") -mz_object_arrangement_sizes_ind CREATE␠INDEX␠"mz_object_arrangement_sizes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s766␠AS␠"mz_internal"."mz_object_arrangement_sizes"]␠("replica_id") -mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s491␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") -mz_object_graph_edges_ind CREATE␠INDEX␠"mz_object_graph_edges_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s757␠AS␠"mz_internal"."mz_object_graph_edges"]␠("object_id") -mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s569␠AS␠"mz_internal"."mz_object_history"]␠("id") -mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s570␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") -mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s586␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") -mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s566␠AS␠"mz_catalog"."mz_objects"]␠("schema_id") +mz_metric_sinks_ind CREATE␠INDEX␠"mz_metric_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s559␠AS␠"mz_internal"."mz_metric_sinks"]␠("id") +mz_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s861␠AS␠"mz_internal"."mz_notices"]␠("id") +mz_object_arrangement_size_history_object_ind CREATE␠INDEX␠"mz_object_arrangement_size_history_object_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s774␠AS␠"mz_internal"."mz_object_arrangement_size_history"]␠("object_id") +mz_object_arrangement_size_history_ts_ind CREATE␠INDEX␠"mz_object_arrangement_size_history_ts_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s774␠AS␠"mz_internal"."mz_object_arrangement_size_history"]␠("collection_timestamp") +mz_object_arrangement_sizes_ind CREATE␠INDEX␠"mz_object_arrangement_sizes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s772␠AS␠"mz_internal"."mz_object_arrangement_sizes"]␠("replica_id") +mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s497␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") +mz_object_graph_edges_ind CREATE␠INDEX␠"mz_object_graph_edges_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s763␠AS␠"mz_internal"."mz_object_graph_edges"]␠("object_id") +mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s575␠AS␠"mz_internal"."mz_object_history"]␠("id") +mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s576␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") +mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s592␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") +mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s572␠AS␠"mz_catalog"."mz_objects"]␠("schema_id") mz_peek_durations_histogram_raw_s2_primary_idx CREATE␠INDEX␠"mz_peek_durations_histogram_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_peek_durations_histogram_raw"␠("worker_id",␠"type",␠"duration_ns") -mz_recent_activity_log_thinned_ind CREATE␠INDEX␠"mz_recent_activity_log_thinned_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s730␠AS␠"mz_internal"."mz_recent_activity_log_thinned"]␠("sql_hash") -mz_recent_sql_text_ind CREATE␠INDEX␠"mz_recent_sql_text_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s726␠AS␠"mz_internal"."mz_recent_sql_text"]␠("sql_hash") -mz_recent_storage_usage_ind CREATE␠INDEX␠"mz_recent_storage_usage_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s846␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") -mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s514␠AS␠"mz_catalog"."mz_roles"]␠("id") +mz_recent_activity_log_thinned_ind CREATE␠INDEX␠"mz_recent_activity_log_thinned_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s736␠AS␠"mz_internal"."mz_recent_activity_log_thinned"]␠("sql_hash") +mz_recent_sql_text_ind CREATE␠INDEX␠"mz_recent_sql_text_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s732␠AS␠"mz_internal"."mz_recent_sql_text"]␠("sql_hash") +mz_recent_storage_usage_ind CREATE␠INDEX␠"mz_recent_storage_usage_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s852␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") +mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s520␠AS␠"mz_catalog"."mz_roles"]␠("id") mz_scheduling_elapsed_raw_s2_primary_idx CREATE␠INDEX␠"mz_scheduling_elapsed_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_scheduling_elapsed_raw"␠("id",␠"worker_id") mz_scheduling_parks_histogram_raw_s2_primary_idx CREATE␠INDEX␠"mz_scheduling_parks_histogram_raw_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_scheduling_parks_histogram_raw"␠("worker_id",␠"slept_for_ns",␠"requested_ns") -mz_schemas_ind CREATE␠INDEX␠"mz_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s494␠AS␠"mz_catalog"."mz_schemas"]␠("database_id") -mz_secrets_ind CREATE␠INDEX␠"mz_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s529␠AS␠"mz_catalog"."mz_secrets"]␠("name") -mz_show_all_objects_ind CREATE␠INDEX␠"mz_show_all_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s614␠AS␠"mz_internal"."mz_show_all_objects"]␠("schema_id") -mz_show_cluster_replicas_ind CREATE␠INDEX␠"mz_show_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s778␠AS␠"mz_internal"."mz_show_cluster_replicas"]␠("cluster") -mz_show_clusters_ind CREATE␠INDEX␠"mz_show_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s616␠AS␠"mz_internal"."mz_show_clusters"]␠("name") -mz_show_columns_ind CREATE␠INDEX␠"mz_show_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s615␠AS␠"mz_internal"."mz_show_columns"]␠("id") -mz_show_connections_ind CREATE␠INDEX␠"mz_show_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s624␠AS␠"mz_internal"."mz_show_connections"]␠("schema_id") -mz_show_databases_ind CREATE␠INDEX␠"mz_show_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s618␠AS␠"mz_internal"."mz_show_databases"]␠("name") -mz_show_indexes_ind CREATE␠INDEX␠"mz_show_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s628␠AS␠"mz_internal"."mz_show_indexes"]␠("schema_id") -mz_show_materialized_views_ind CREATE␠INDEX␠"mz_show_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s627␠AS␠"mz_internal"."mz_show_materialized_views"]␠("schema_id") -mz_show_roles_ind CREATE␠INDEX␠"mz_show_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s623␠AS␠"mz_internal"."mz_show_roles"]␠("name") -mz_show_schemas_ind CREATE␠INDEX␠"mz_show_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s619␠AS␠"mz_internal"."mz_show_schemas"]␠("database_id") -mz_show_secrets_ind CREATE␠INDEX␠"mz_show_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s617␠AS␠"mz_internal"."mz_show_secrets"]␠("schema_id") -mz_show_sinks_ind CREATE␠INDEX␠"mz_show_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s626␠AS␠"mz_internal"."mz_show_sinks"]␠("schema_id") -mz_show_sources_ind CREATE␠INDEX␠"mz_show_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s625␠AS␠"mz_internal"."mz_show_sources"]␠("schema_id") -mz_show_tables_ind CREATE␠INDEX␠"mz_show_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s620␠AS␠"mz_internal"."mz_show_tables"]␠("schema_id") -mz_show_types_ind CREATE␠INDEX␠"mz_show_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s622␠AS␠"mz_internal"."mz_show_types"]␠("schema_id") -mz_show_views_ind CREATE␠INDEX␠"mz_show_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s621␠AS␠"mz_internal"."mz_show_views"]␠("schema_id") -mz_sink_statistics_ind CREATE␠INDEX␠"mz_sink_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s743␠AS␠"mz_internal"."mz_sink_statistics"]␠("id",␠"replica_id") -mz_sink_status_history_ind CREATE␠INDEX␠"mz_sink_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s715␠AS␠"mz_internal"."mz_sink_status_history"]␠("sink_id") -mz_sink_statuses_ind CREATE␠INDEX␠"mz_sink_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s716␠AS␠"mz_internal"."mz_sink_statuses"]␠("id") -mz_sinks_ind CREATE␠INDEX␠"mz_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s506␠AS␠"mz_catalog"."mz_sinks"]␠("id") -mz_source_statistics_ind CREATE␠INDEX␠"mz_source_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s741␠AS␠"mz_internal"."mz_source_statistics"]␠("id",␠"replica_id") -mz_source_statistics_with_history_ind CREATE␠INDEX␠"mz_source_statistics_with_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s739␠AS␠"mz_internal"."mz_source_statistics_with_history"]␠("id",␠"replica_id") -mz_source_status_history_ind CREATE␠INDEX␠"mz_source_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s717␠AS␠"mz_internal"."mz_source_status_history"]␠("source_id") -mz_source_statuses_ind CREATE␠INDEX␠"mz_source_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s734␠AS␠"mz_internal"."mz_source_statuses"]␠("id") -mz_sources_ind CREATE␠INDEX␠"mz_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s499␠AS␠"mz_catalog"."mz_sources"]␠("id") -mz_tables_ind CREATE␠INDEX␠"mz_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s498␠AS␠"mz_catalog"."mz_tables"]␠("schema_id") -mz_types_ind CREATE␠INDEX␠"mz_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s508␠AS␠"mz_catalog"."mz_types"]␠("schema_id") -mz_views_ind CREATE␠INDEX␠"mz_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s507␠AS␠"mz_catalog"."mz_views"]␠("schema_id") -mz_wallclock_global_lag_recent_history_ind CREATE␠INDEX␠"mz_wallclock_global_lag_recent_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s750␠AS␠"mz_internal"."mz_wallclock_global_lag_recent_history"]␠("object_id") -mz_webhook_sources_ind CREATE␠INDEX␠"mz_webhook_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s552␠AS␠"mz_internal"."mz_webhook_sources"]␠("id") -pg_attrdef_all_databases_ind CREATE␠INDEX␠"pg_attrdef_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s655␠AS␠"mz_internal"."pg_attrdef_all_databases"]␠("oid",␠"adrelid",␠"adnum",␠"adbin",␠"adsrc") -pg_attribute_all_databases_ind CREATE␠INDEX␠"pg_attribute_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s648␠AS␠"mz_internal"."pg_attribute_all_databases"]␠("attrelid") -pg_authid_core_ind CREATE␠INDEX␠"pg_authid_core_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s665␠AS␠"mz_internal"."pg_authid_core"]␠("rolname") -pg_class_all_databases_ind CREATE␠INDEX␠"pg_class_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s636␠AS␠"mz_internal"."pg_class_all_databases"]␠("relname") -pg_description_all_databases_ind CREATE␠INDEX␠"pg_description_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s645␠AS␠"mz_internal"."pg_description_all_databases"]␠("objoid",␠"classoid",␠"objsubid",␠"description",␠"oid_database_name",␠"class_database_name") -pg_namespace_all_databases_ind CREATE␠INDEX␠"pg_namespace_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s633␠AS␠"mz_internal"."pg_namespace_all_databases"]␠("nspname") -pg_type_all_databases_ind CREATE␠INDEX␠"pg_type_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s642␠AS␠"mz_internal"."pg_type_all_databases"]␠("oid") +mz_schemas_ind CREATE␠INDEX␠"mz_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s500␠AS␠"mz_catalog"."mz_schemas"]␠("database_id") +mz_secrets_ind CREATE␠INDEX␠"mz_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s535␠AS␠"mz_catalog"."mz_secrets"]␠("name") +mz_show_all_objects_ind CREATE␠INDEX␠"mz_show_all_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s620␠AS␠"mz_internal"."mz_show_all_objects"]␠("schema_id") +mz_show_cluster_replicas_ind CREATE␠INDEX␠"mz_show_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s784␠AS␠"mz_internal"."mz_show_cluster_replicas"]␠("cluster") +mz_show_clusters_ind CREATE␠INDEX␠"mz_show_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s622␠AS␠"mz_internal"."mz_show_clusters"]␠("name") +mz_show_columns_ind CREATE␠INDEX␠"mz_show_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s621␠AS␠"mz_internal"."mz_show_columns"]␠("id") +mz_show_connections_ind CREATE␠INDEX␠"mz_show_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s630␠AS␠"mz_internal"."mz_show_connections"]␠("schema_id") +mz_show_databases_ind CREATE␠INDEX␠"mz_show_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s624␠AS␠"mz_internal"."mz_show_databases"]␠("name") +mz_show_indexes_ind CREATE␠INDEX␠"mz_show_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s634␠AS␠"mz_internal"."mz_show_indexes"]␠("schema_id") +mz_show_materialized_views_ind CREATE␠INDEX␠"mz_show_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s633␠AS␠"mz_internal"."mz_show_materialized_views"]␠("schema_id") +mz_show_roles_ind CREATE␠INDEX␠"mz_show_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s629␠AS␠"mz_internal"."mz_show_roles"]␠("name") +mz_show_schemas_ind CREATE␠INDEX␠"mz_show_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s625␠AS␠"mz_internal"."mz_show_schemas"]␠("database_id") +mz_show_secrets_ind CREATE␠INDEX␠"mz_show_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s623␠AS␠"mz_internal"."mz_show_secrets"]␠("schema_id") +mz_show_sinks_ind CREATE␠INDEX␠"mz_show_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s632␠AS␠"mz_internal"."mz_show_sinks"]␠("schema_id") +mz_show_sources_ind CREATE␠INDEX␠"mz_show_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s631␠AS␠"mz_internal"."mz_show_sources"]␠("schema_id") +mz_show_tables_ind CREATE␠INDEX␠"mz_show_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s626␠AS␠"mz_internal"."mz_show_tables"]␠("schema_id") +mz_show_types_ind CREATE␠INDEX␠"mz_show_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s628␠AS␠"mz_internal"."mz_show_types"]␠("schema_id") +mz_show_views_ind CREATE␠INDEX␠"mz_show_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s627␠AS␠"mz_internal"."mz_show_views"]␠("schema_id") +mz_sink_statistics_ind CREATE␠INDEX␠"mz_sink_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s749␠AS␠"mz_internal"."mz_sink_statistics"]␠("id",␠"replica_id") +mz_sink_status_history_ind CREATE␠INDEX␠"mz_sink_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s721␠AS␠"mz_internal"."mz_sink_status_history"]␠("sink_id") +mz_sink_statuses_ind CREATE␠INDEX␠"mz_sink_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s722␠AS␠"mz_internal"."mz_sink_statuses"]␠("id") +mz_sinks_ind CREATE␠INDEX␠"mz_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s512␠AS␠"mz_catalog"."mz_sinks"]␠("id") +mz_source_statistics_ind CREATE␠INDEX␠"mz_source_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s747␠AS␠"mz_internal"."mz_source_statistics"]␠("id",␠"replica_id") +mz_source_statistics_with_history_ind CREATE␠INDEX␠"mz_source_statistics_with_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s745␠AS␠"mz_internal"."mz_source_statistics_with_history"]␠("id",␠"replica_id") +mz_source_status_history_ind CREATE␠INDEX␠"mz_source_status_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s723␠AS␠"mz_internal"."mz_source_status_history"]␠("source_id") +mz_source_statuses_ind CREATE␠INDEX␠"mz_source_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s740␠AS␠"mz_internal"."mz_source_statuses"]␠("id") +mz_sources_ind CREATE␠INDEX␠"mz_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s505␠AS␠"mz_catalog"."mz_sources"]␠("id") +mz_tables_ind CREATE␠INDEX␠"mz_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s504␠AS␠"mz_catalog"."mz_tables"]␠("schema_id") +mz_types_ind CREATE␠INDEX␠"mz_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s514␠AS␠"mz_catalog"."mz_types"]␠("schema_id") +mz_views_ind CREATE␠INDEX␠"mz_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s513␠AS␠"mz_catalog"."mz_views"]␠("schema_id") +mz_wallclock_global_lag_recent_history_ind CREATE␠INDEX␠"mz_wallclock_global_lag_recent_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s756␠AS␠"mz_internal"."mz_wallclock_global_lag_recent_history"]␠("object_id") +mz_webhook_sources_ind CREATE␠INDEX␠"mz_webhook_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s558␠AS␠"mz_internal"."mz_webhook_sources"]␠("id") +pg_attrdef_all_databases_ind CREATE␠INDEX␠"pg_attrdef_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s661␠AS␠"mz_internal"."pg_attrdef_all_databases"]␠("oid",␠"adrelid",␠"adnum",␠"adbin",␠"adsrc") +pg_attribute_all_databases_ind CREATE␠INDEX␠"pg_attribute_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s654␠AS␠"mz_internal"."pg_attribute_all_databases"]␠("attrelid") +pg_authid_core_ind CREATE␠INDEX␠"pg_authid_core_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s671␠AS␠"mz_internal"."pg_authid_core"]␠("rolname") +pg_class_all_databases_ind CREATE␠INDEX␠"pg_class_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s642␠AS␠"mz_internal"."pg_class_all_databases"]␠("relname") +pg_description_all_databases_ind CREATE␠INDEX␠"pg_description_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s651␠AS␠"mz_internal"."pg_description_all_databases"]␠("objoid",␠"classoid",␠"objsubid",␠"description",␠"oid_database_name",␠"class_database_name") +pg_namespace_all_databases_ind CREATE␠INDEX␠"pg_namespace_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s639␠AS␠"mz_internal"."pg_namespace_all_databases"]␠("nspname") +pg_type_all_databases_ind CREATE␠INDEX␠"pg_type_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s648␠AS␠"mz_internal"."pg_type_all_databases"]␠("oid") # Record all transitive dependencies (tables, sources, views, mvs) of indexes on # the mz_catalog_server cluster. @@ -256,6 +258,11 @@ mz_builtin_materialized_views object_type mz_builtin_materialized_views oid mz_builtin_materialized_views privileges mz_builtin_materialized_views schema_name +mz_builtin_object_mappings global_id +mz_builtin_object_mappings id +mz_builtin_object_mappings name +mz_builtin_object_mappings object_type +mz_builtin_object_mappings schema_name mz_builtin_sources is_retained_metrics_object mz_builtin_sources name mz_builtin_sources object_type @@ -275,7 +282,31 @@ mz_builtin_views name mz_builtin_views oid mz_builtin_views privileges mz_builtin_views schema_name +mz_catalog_item_metadata details +mz_catalog_item_metadata ephemeral_owner_session +mz_catalog_item_metadata global_id +mz_catalog_item_metadata id +mz_catalog_item_metadata name +mz_catalog_item_metadata oid +mz_catalog_item_metadata owner_id +mz_catalog_item_metadata privileges +mz_catalog_item_metadata schema_id +mz_catalog_item_metadata type +mz_catalog_items create_sql +mz_catalog_items details +mz_catalog_items ephemeral_owner_session +mz_catalog_items global_id +mz_catalog_items id +mz_catalog_items name +mz_catalog_items oid +mz_catalog_items owner_id +mz_catalog_items privileges +mz_catalog_items redacted_create_sql +mz_catalog_items schema_id +mz_catalog_items type mz_catalog_raw data +mz_catalog_state data +mz_catalog_state kind mz_cluster_auto_scaling_strategies cluster_id mz_cluster_auto_scaling_strategies state mz_cluster_auto_scaling_strategies strategy diff --git a/test/sqllogictest/oid.slt b/test/sqllogictest/oid.slt index 85f5b5197e5a2..cc00776df3af1 100644 --- a/test/sqllogictest/oid.slt +++ b/test/sqllogictest/oid.slt @@ -1271,3 +1271,9 @@ SELECT oid, name FROM mz_objects WHERE id LIKE 's%' AND oid < 20000 ORDER BY oid 17142 mz_query_policy_rules 17143 mz_show_query_policies 17144 mz_query_policy_attachments +17145 mz_catalog_state +17146 mz_catalog_items +17147 mz_catalog_item_metadata +17148 mz_catalog_item_metadata_ind +17150 mz_builtin_object_mappings +17151 mz_builtin_object_mappings_ind diff --git a/test/testdrive/catalog.td b/test/testdrive/catalog.td index fcb52f1028788..944f55e7e1ea8 100644 --- a/test/testdrive/catalog.td +++ b/test/testdrive/catalog.td @@ -624,9 +624,11 @@ mz_builtin_index_columns "" mz_builtin_indexes "" mz_builtin_log_indexes "" mz_builtin_materialized_views "" +mz_builtin_object_mappings "" mz_builtin_sources "" mz_builtin_tables "" mz_builtin_views "" +mz_catalog_item_metadata "" mz_cluster_deployment_lineage "" mz_cluster_replica_history "" mz_cluster_replica_metrics "" @@ -722,6 +724,8 @@ pg_authid_core "" name cluster comment ---------------------------------------------------- mz_aws_connections mz_catalog_server "" +mz_catalog_items mz_catalog_server "" +mz_catalog_state mz_catalog_server "" mz_cluster_auto_scaling_strategies mz_catalog_server "" mz_cluster_reconfigurations mz_catalog_server "" mz_cluster_schedules mz_catalog_server "" @@ -850,7 +854,7 @@ test_table "" # There is one entry in mz_indexes for each field_number/expression of the index. > SELECT COUNT(id) FROM mz_indexes WHERE id LIKE 's%' -280 +282 # Create a second schema with the same table name as above > CREATE SCHEMA tester2 diff --git a/test/testdrive/indexes.td b/test/testdrive/indexes.td index 33bfa188a0ed8..2cf6fd0fd431a 100644 --- a/test/testdrive/indexes.td +++ b/test/testdrive/indexes.td @@ -298,6 +298,8 @@ mz_arrangement_batcher_records_raw_s2_primary_idx mz_arrangement_batch mz_arrangement_batcher_size_raw_s2_primary_idx mz_arrangement_batcher_size_raw mz_catalog_server {operator_id,worker_id} "" mz_cluster_deployment_lineage_ind mz_cluster_deployment_lineage mz_catalog_server {cluster_id} "" mz_cluster_reconfigurations_ind mz_cluster_reconfigurations mz_catalog_server {cluster_id} "" +mz_builtin_object_mappings_ind mz_builtin_object_mappings mz_catalog_server {schema_name,name} "" +mz_catalog_item_metadata_ind mz_catalog_item_metadata mz_catalog_server {id} "" mz_cluster_auto_scaling_strategies_ind mz_cluster_auto_scaling_strategies mz_catalog_server {cluster_id} "" mz_cluster_replica_frontiers_ind mz_cluster_replica_frontiers mz_catalog_server {object_id} "" mz_cluster_replica_history_ind mz_cluster_replica_history mz_catalog_server {dropped_at} ""