From 9b13bae12a85346a52b69f5e1c0ba27ed70455aa Mon Sep 17 00:00:00 2001 From: SangJunBak Date: Mon, 16 Nov 2026 19:36:08 -0500 Subject: [PATCH 1/3] catalog: define the function and operator relations as views --- .../src/catalog/builtin_table_updates.rs | 148 +-------- src/adapter/src/catalog/open.rs | 16 - src/catalog/src/builtin.rs | 11 +- src/catalog/src/builtin/builtin.rs | 185 ++++++++++- src/catalog/src/builtin/mz_catalog.rs | 300 +++++++++++------- src/catalog/src/builtin/mz_internal.rs | 12 +- src/catalog/src/builtin/pg_catalog.rs | 1 + src/pgrepr-consts/src/oid.rs | 8 +- test/sqllogictest/function_relations.slt | 158 +++++++++ test/sqllogictest/mz_views.slt | 2 + test/testdrive/catalog.td | 10 +- 11 files changed, 561 insertions(+), 290 deletions(-) create mode 100644 test/sqllogictest/function_relations.slt diff --git a/src/adapter/src/catalog/builtin_table_updates.rs b/src/adapter/src/catalog/builtin_table_updates.rs index 4d0d9192f7b2d..e6c8e2af864ff 100644 --- a/src/adapter/src/catalog/builtin_table_updates.rs +++ b/src/adapter/src/catalog/builtin_table_updates.rs @@ -12,24 +12,20 @@ mod notice; use bytesize::ByteSize; use ipnet::IpNet; use mz_audit_log::VersionedStorageUsage; -use mz_catalog::SYSTEM_CONN_ID; use mz_catalog::builtin::{ - BuiltinTable, MZ_AGGREGATES, MZ_CLUSTER_REPLICA_SIZE_INTERNAL, MZ_CLUSTER_REPLICA_SIZES, - MZ_EGRESS_IPS, MZ_FUNCTIONS, MZ_LICENSE_KEYS, MZ_OPERATORS, MZ_ROLE_AUTH, MZ_SESSIONS, - MZ_STORAGE_USAGE_BY_SHARD, MZ_SUBSCRIPTIONS, MZ_WEBHOOKS_SOURCES, + BuiltinTable, MZ_CLUSTER_REPLICA_SIZE_INTERNAL, MZ_CLUSTER_REPLICA_SIZES, MZ_EGRESS_IPS, + MZ_LICENSE_KEYS, MZ_ROLE_AUTH, MZ_SESSIONS, MZ_STORAGE_USAGE_BY_SHARD, MZ_SUBSCRIPTIONS, + MZ_WEBHOOKS_SOURCES, }; use mz_catalog::memory::error::Error; -use mz_catalog::memory::objects::{CatalogItem, DataSourceDesc, Func}; +use mz_catalog::memory::objects::{CatalogItem, DataSourceDesc}; use mz_controller::clusters::ReplicaAllocation; use mz_license_keys::ValidatedLicenseKey; use mz_orchestrator::{CpuLimit, DiskLimit, MemoryLimit}; use mz_ore::cast::CastFrom; use mz_persist_client::batch::ProtoBatch; -use mz_repr::adt::array::ArrayDimension; use mz_repr::role_id::RoleId; use mz_repr::{CatalogItemId, Datum, Diff, GlobalId, Row}; -use mz_sql::func::FuncImplCatalogDetails; -use mz_sql::names::SchemaSpecifier; use mz_storage_client::client::TableData; use smallvec::smallvec; use uuid::Uuid; @@ -116,16 +112,6 @@ impl CatalogState { diff: Diff, ) -> Vec> { let entry = self.get_entry(&id); - let conn_id = entry.item().conn_id().unwrap_or(&SYSTEM_CONN_ID); - let schema_id = &self - .get_schema( - &entry.name().qualifiers.database_spec, - &entry.name().qualifiers.schema_spec, - conn_id, - ) - .id; - let name = &entry.name().item; - let owner_id = entry.owner_id(); let updates = match entry.item() { CatalogItem::Source(source) => { match &source.data_source { @@ -146,18 +132,16 @@ impl CatalogState { // mz_sinks, mz_kafka_sinks and mz_iceberg_sinks read create_sql // out of mz_catalog_raw, so there is nothing to pack here. CatalogItem::Sink(_) => vec![], - CatalogItem::Func(func) => { - self.pack_func_update(id, schema_id, name, owner_id, func, diff) - } - // Tables, views, materialized views, indexes, types and metric - // sinks are exposed through relations derived from - // `mz_catalog_raw`, and logs and secrets never had builtin-table - // rows, so none pack a row here. + // Tables, views, materialized views, indexes, types, functions + // and metric sinks are exposed through materialized views derived + // from `mz_catalog_raw`, and logs and secrets never had + // builtin-table rows, so none pack a row here. CatalogItem::Table(_) | CatalogItem::View(_) | CatalogItem::MaterializedView(_) | CatalogItem::Index(_) | CatalogItem::Type(_) + | CatalogItem::Func(_) | CatalogItem::Log(_) | CatalogItem::Secret(_) | CatalogItem::MetricSink(_) => vec![], @@ -171,120 +155,6 @@ impl CatalogState { updates } - fn pack_func_update( - &self, - id: CatalogItemId, - schema_id: &SchemaSpecifier, - name: &str, - owner_id: &RoleId, - func: &Func, - diff: Diff, - ) -> Vec> { - let mut updates = vec![]; - for func_impl_details in func.inner.func_impls() { - let arg_type_ids = func_impl_details - .arg_typs - .iter() - .map(|typ| self.get_system_type(typ).id().to_string()) - .collect::>(); - - let mut row = Row::default(); - row.packer() - .try_push_array( - &[ArrayDimension { - lower_bound: 1, - length: arg_type_ids.len(), - }], - arg_type_ids.iter().map(|id| Datum::String(id)), - ) - .expect( - "arg_type_ids is 1 dimensional, and its length is used for the array length", - ); - let arg_type_ids = row.unpack_first(); - - updates.push(BuiltinTableUpdate::row( - &*MZ_FUNCTIONS, - Row::pack_slice(&[ - Datum::String(&id.to_string()), - Datum::UInt32(func_impl_details.oid), - Datum::String(&schema_id.to_string()), - Datum::String(name), - arg_type_ids, - Datum::from( - func_impl_details - .variadic_typ - .map(|typ| self.get_system_type(typ).id().to_string()) - .as_deref(), - ), - Datum::from( - func_impl_details - .return_typ - .map(|typ| self.get_system_type(typ).id().to_string()) - .as_deref(), - ), - func_impl_details.return_is_set.into(), - Datum::String(&owner_id.to_string()), - ]), - diff, - )); - - if let mz_sql::func::Func::Aggregate(_) = func.inner { - updates.push(BuiltinTableUpdate::row( - &*MZ_AGGREGATES, - Row::pack_slice(&[ - Datum::UInt32(func_impl_details.oid), - // TODO(database-issues#1064): Support ordered-set aggregate functions. - Datum::String("n"), - Datum::Int16(0), - ]), - diff, - )); - } - } - updates - } - - pub fn pack_op_update( - &self, - operator: &str, - func_impl_details: FuncImplCatalogDetails, - diff: Diff, - ) -> BuiltinTableUpdate<&'static BuiltinTable> { - let arg_type_ids = func_impl_details - .arg_typs - .iter() - .map(|typ| self.get_system_type(typ).id().to_string()) - .collect::>(); - - let mut row = Row::default(); - row.packer() - .try_push_array( - &[ArrayDimension { - lower_bound: 1, - length: arg_type_ids.len(), - }], - arg_type_ids.iter().map(|id| Datum::String(id)), - ) - .expect("arg_type_ids is 1 dimensional, and its length is used for the array length"); - let arg_type_ids = row.unpack_first(); - - BuiltinTableUpdate::row( - &*MZ_OPERATORS, - Row::pack_slice(&[ - Datum::UInt32(func_impl_details.oid), - Datum::String(operator), - arg_type_ids, - Datum::from( - func_impl_details - .return_typ - .map(|typ| self.get_system_type(typ).id().to_string()) - .as_deref(), - ), - ]), - diff, - ) - } - pub fn pack_storage_usage_update( &self, VersionedStorageUsage::V1(event): VersionedStorageUsage, diff --git a/src/adapter/src/catalog/open.rs b/src/adapter/src/catalog/open.rs index 8eb4ec79cfa02..dbb2ad34c9216 100644 --- a/src/adapter/src/catalog/open.rs +++ b/src/adapter/src/catalog/open.rs @@ -55,7 +55,6 @@ use mz_repr::adt::mz_acl_item::PrivilegeMap; use mz_repr::namespaces::is_unstable_schema; use mz_repr::{CatalogItemId, Diff, GlobalId, RelationVersion, Timestamp}; use mz_sql::catalog::{CatalogError as SqlCatalogError, CatalogItemType, RoleMembership, RoleVars}; -use mz_sql::func::OP_IMPLS; use mz_sql::names::CommentObjectId; use mz_sql::rbac; use mz_sql::session::user::{MZ_SYSTEM_ROLE_ID, SYSTEM_USER}; @@ -623,21 +622,6 @@ impl Catalog { storage: Arc::new(tokio::sync::Mutex::new(storage)), }; - // Operators aren't stored in the catalog, but we would like them in - // introspection views. - for (op, func) in OP_IMPLS.iter() { - match func { - mz_sql::func::Func::Scalar(impls) => { - for imp in impls { - builtin_table_updates.push(catalog.state.resolve_builtin_table_update( - catalog.state.pack_op_update(op, imp.details(), Diff::ONE), - )); - } - } - _ => unreachable!("all operators must be scalar functions"), - } - } - for ip in &catalog.state.egress_addresses { builtin_table_updates.push( catalog diff --git a/src/catalog/src/builtin.rs b/src/catalog/src/builtin.rs index 7ce58fb813ac3..884031e19762e 100644 --- a/src/catalog/src/builtin.rs +++ b/src/catalog/src/builtin.rs @@ -1222,9 +1222,9 @@ pub static BUILTINS_STATIC: LazyLock>> = LazyLock::ne Builtin::MaterializedView(&MZ_ROLE_MEMBERS), Builtin::MaterializedView(&MZ_ROLE_PARAMETERS), Builtin::View(&MZ_PSEUDO_TYPES), - Builtin::Table(&MZ_FUNCTIONS), - Builtin::Table(&MZ_OPERATORS), - Builtin::Table(&MZ_AGGREGATES), + Builtin::View(&MZ_FUNCTIONS), + Builtin::View(&MZ_OPERATORS), + Builtin::View(&MZ_AGGREGATES), Builtin::Table(&MZ_CLUSTER_REPLICA_SIZES), Builtin::Table(&MZ_CLUSTER_REPLICA_SIZE_INTERNAL), Builtin::MaterializedView(&MZ_CLUSTERS), @@ -1572,7 +1572,7 @@ pub static BUILTINS_STATIC: LazyLock>> = LazyLock::ne { let ontology_preview = ontology::generate_views(&builtin_items); let builtin_reporter_preview: Vec<_> = - builtin::builtins(&builtin_types, &builtin_items).collect(); + builtin::builtins(&builtin_types, &builtin_funcs, &builtin_items).collect(); let generator_input: Vec<_> = builtin_types .iter() .chain(builtin_funcs.iter()) @@ -1599,7 +1599,8 @@ pub static BUILTINS_STATIC: LazyLock>> = LazyLock::ne // Generate builtin relations reporting builtin objects last, since they need a complete view // of all other builtins. - let mut builtin_builtins = builtin::builtins(&builtin_types, &builtin_items).collect(); + let mut builtin_builtins = + builtin::builtins(&builtin_types, &builtin_funcs, &builtin_items).collect(); // Construct the full list of builtins, retaining dependency order. let mut builtins = Vec::new(); diff --git a/src/catalog/src/builtin/builtin.rs b/src/catalog/src/builtin/builtin.rs index f53aef0be38bc..5207f6e4eca69 100644 --- a/src/catalog/src/builtin/builtin.rs +++ b/src/catalog/src/builtin/builtin.rs @@ -10,7 +10,7 @@ //! Constant builtin views exposing information about builtin objects. use std::borrow::Cow; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use itertools::Itertools; use mz_catalog_protos::objects::CatalogItemType; @@ -31,9 +31,11 @@ use crate::builtin::{Builtin, BuiltinType, BuiltinView, PUBLIC_SELECT, assert_sa /// Generate builtin views reporting the given builtins. /// /// Used in the [`super::BUILTINS_STATIC`] initializer, which keeps the -/// `Builtin::Type`s in `builtin_types` apart from the other `builtin_items`. +/// `Builtin::Type`s in `builtin_types` and the `Builtin::Func`s in +/// `builtin_funcs` apart from the other `builtin_items`. pub(super) fn builtins( builtin_types: &[Builtin], + builtin_funcs: &[Builtin], builtin_items: &[Builtin], ) -> impl Iterator> { let sources: &'static BuiltinView = Box::leak(Box::new(make_builtin_sources(builtin_items))); @@ -46,6 +48,12 @@ pub(super) fn builtins( let index_columns: &'static BuiltinView = Box::leak(Box::new(make_builtin_index_columns(builtin_items))); let types: &'static BuiltinView = Box::leak(Box::new(make_builtin_types(builtin_types))); + let functions: &'static BuiltinView = Box::leak(Box::new(make_builtin_functions( + builtin_types, + builtin_funcs, + ))); + let operators: &'static BuiltinView = + Box::leak(Box::new(make_builtin_operators(builtin_types))); // The generated views above, and `mz_builtin_views` itself, are listed in // `mz_builtin_views` with placeholder SQL rather than their real @@ -67,6 +75,8 @@ pub(super) fn builtins( index_columns, &columns, types, + functions, + operators, ], ))); make_builtin_columns_sql( @@ -79,6 +89,8 @@ pub(super) fn builtins( indexes, index_columns, types, + functions, + operators, views, ], &mut columns, @@ -96,6 +108,8 @@ pub(super) fn builtins( index_columns, columns, types, + functions, + operators, views, ] .into_iter() @@ -565,6 +579,169 @@ FROM (VALUES {values}) AS v(oid, schema_name, name, category, type_kind, privile } } +/// Generates `mz_internal.mz_builtin_functions`, one row per implementation of +/// each builtin function. +fn make_builtin_functions( + builtin_types: &[Builtin], + builtin_funcs: &[Builtin], +) -> BuiltinView { + let type_names = builtin_type_names(builtin_types); + let type_names = &type_names; + let values = builtin_funcs + .iter() + .filter_map(|b| match b { + Builtin::Func(f) => Some(f), + _ => None, + }) + .flat_map(|func| { + assert_safe_builtin_name(func.name, "function"); + let kind = func.inner.class(); + func.inner.func_impls().into_iter().map(move |imp| { + format!( + "({}::oid, {}, {}, '{kind}', {}, {}, {}, {})", + imp.oid, + escaped_string_literal(func.schema), + escaped_string_literal(func.name), + type_names_sql(&imp.arg_typs, type_names), + type_name_sql(imp.variadic_typ, type_names), + type_name_sql(imp.return_typ, type_names), + imp.return_is_set, + ) + }) + }) + .join(","); + let sql = format!( + " +SELECT oid, schema_name, name, kind, argument_type_names, variadic_argument_type_name, return_type_name, returns_set +FROM (VALUES {values}) AS v(oid, schema_name, name, kind, argument_type_names, variadic_argument_type_name, return_type_name, returns_set)" + ); + + BuiltinView { + name: "mz_builtin_functions", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::VIEW_MZ_BUILTIN_FUNCTIONS_OID, + desc: RelationDesc::builder() + .with_column("oid", SqlScalarType::Oid.nullable(false)) + .with_column("schema_name", SqlScalarType::String.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column("kind", SqlScalarType::String.nullable(false)) + .with_column( + "argument_type_names", + SqlScalarType::Array(Box::new(SqlScalarType::String)).nullable(false), + ) + .with_column( + "variadic_argument_type_name", + SqlScalarType::String.nullable(true), + ) + .with_column("return_type_name", SqlScalarType::String.nullable(true)) + .with_column("returns_set", SqlScalarType::Bool.nullable(false)) + // NOTE: The declared keys must exactly match the keys the + // optimizer derives from the generated VALUES list + // (`verify_builtin_descs` enforces this). Every implementation has + // its own oid, which `test_compare_builtins_postgres` asserts, so + // `oid` is a key. + .with_key(vec![0]) + .finish(), + column_comments: Default::default(), + sql: Box::leak(sql.into_boxed_str()), + access: vec![PUBLIC_SELECT], + ontology: None, + } +} + +/// Generates `mz_internal.mz_builtin_operators`, one row per implementation of +/// each operator in [`mz_sql::func::OP_IMPLS`]. +fn make_builtin_operators(builtin_types: &[Builtin]) -> BuiltinView { + let type_names = builtin_type_names(builtin_types); + let type_names = &type_names; + let values = mz_sql::func::OP_IMPLS + .iter() + .flat_map(|(op, func)| { + assert!( + matches!(func, mz_sql::func::Func::Scalar(_)), + "operator {op} is not a scalar function" + ); + func.func_impls().into_iter().map(move |imp| { + format!( + "({}::oid, {}, {}, {})", + imp.oid, + escaped_string_literal(op), + type_names_sql(&imp.arg_typs, type_names), + type_name_sql(imp.return_typ, type_names), + ) + }) + }) + .join(","); + let sql = format!( + " +SELECT oid, name, argument_type_names, return_type_name +FROM (VALUES {values}) AS v(oid, name, argument_type_names, return_type_name)" + ); + + BuiltinView { + name: "mz_builtin_operators", + schema: MZ_INTERNAL_SCHEMA, + oid: oid::VIEW_MZ_BUILTIN_OPERATORS_OID, + desc: RelationDesc::builder() + .with_column("oid", SqlScalarType::Oid.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column( + "argument_type_names", + SqlScalarType::Array(Box::new(SqlScalarType::String)).nullable(false), + ) + .with_column("return_type_name", SqlScalarType::String.nullable(false)) + // NOTE: The declared keys must exactly match the keys the + // optimizer derives from the generated VALUES list + // (`verify_builtin_descs` enforces this). Every implementation has + // its own oid, which `test_compare_builtins_postgres` asserts, so + // `oid` is a key. + .with_key(vec![0]) + .finish(), + column_comments: Default::default(), + sql: Box::leak(sql.into_boxed_str()), + access: vec![PUBLIC_SELECT], + ontology: None, + } +} + +/// The names of the builtin types +fn builtin_type_names(builtin_types: &[Builtin]) -> BTreeSet<&str> { + builtin_types + .iter() + .filter_map(|b| match b { + Builtin::Type(t) => Some(t.name), + _ => None, + }) + .collect() +} + +/// `name` as a SQL string literal, or NULL for no type. +fn type_name_sql(name: Option<&str>, type_names: &BTreeSet<&str>) -> String { + match name { + Some(name) => { + // Panic if + assert!( + type_names.contains(name), + "function signature references unknown builtin type {name}" + ); + escaped_string_literal(name).to_string() + } + None => "NULL::text".to_string(), + } +} + +/// `names` as a SQL `text[]` literal. +fn type_names_sql(names: &[&str], type_names: &BTreeSet<&str>) -> String { + if names.is_empty() { + return "ARRAY[]::text[]".to_string(); + } + let names = names + .iter() + .map(|name| type_name_sql(Some(name), type_names)) + .join(", "); + format!("ARRAY[{names}]") +} + /// Generates `mz_internal.mz_builtin_views`, listing every builtin view, /// including itself and the `generated` views. /// @@ -585,7 +762,7 @@ FROM (VALUES {values}) AS v(oid, schema_name, name, category, type_kind, privile /// declared keys rely on. fn make_builtin_views( builtin_items: &[Builtin], - generated: [&BuiltinView; 8], + generated: [&BuiltinView; 10], ) -> BuiltinView { let iter = builtin_items.iter().filter_map(|b| match b { Builtin::View(x) => Some(*x), @@ -697,7 +874,7 @@ fn builtin_columns_view() -> BuiltinView { /// itself. fn make_builtin_columns_sql( builtin_items: &[Builtin], - generated: [&BuiltinView; 8], + generated: [&BuiltinView; 10], columns: &mut BuiltinView, ) { // Map to (schema, relation, desc) diff --git a/src/catalog/src/builtin/mz_catalog.rs b/src/catalog/src/builtin/mz_catalog.rs index 9a2405357dcf4..2650208b361f5 100644 --- a/src/catalog/src/builtin/mz_catalog.rs +++ b/src/catalog/src/builtin/mz_catalog.rs @@ -2721,145 +2721,213 @@ WHERE t.type_kind = 'pseudo'", column_semantic_types: &[("id", SemanticType::CatalogItemId)], }), }); -pub static MZ_FUNCTIONS: LazyLock = LazyLock::new(|| { - BuiltinTable { - name: "mz_functions", +pub static MZ_FUNCTIONS: LazyLock = LazyLock::new(|| BuiltinView { + name: "mz_functions", + schema: MZ_CATALOG_SCHEMA, + oid: oid::VIEW_MZ_FUNCTIONS_OID, + desc: RelationDesc::builder() + .with_column("id", SqlScalarType::String.nullable(false)) // not a key! + .with_column("oid", SqlScalarType::Oid.nullable(false)) + .with_column("schema_id", SqlScalarType::String.nullable(false)) + .with_column("name", SqlScalarType::String.nullable(false)) + .with_column( + "argument_type_ids", + SqlScalarType::Array(Box::new(SqlScalarType::String)).nullable(false), + ) + .with_column( + "variadic_argument_type_id", + SqlScalarType::String.nullable(true), + ) + .with_column("return_type_id", SqlScalarType::String.nullable(true)) + .with_column("returns_set", SqlScalarType::Bool.nullable(false)) + .with_column("owner_id", SqlScalarType::String.nullable(false)) + .finish(), + column_comments: BTreeMap::from_iter([ + ("id", "Materialize's unique ID for the function."), + ("oid", "A PostgreSQL-compatible OID for the function."), + ( + "schema_id", + "The ID of the schema to which the function belongs. Corresponds to `mz_schemas.id`.", + ), + ("name", "The name of the function."), + ( + "argument_type_ids", + "The ID of each argument's type. Each entry refers to `mz_types.id`.", + ), + ( + "variadic_argument_type_id", + "The ID of the variadic argument's type, or `NULL` if the function does not have a variadic argument. Refers to `mz_types.id`.", + ), + ( + "return_type_id", + "The returned value's type, or `NULL` if the function does not return a value. Refers to `mz_types.id`. Note that for table functions with > 1 column, this type corresponds to [`record`].", + ), + ( + "returns_set", + "Whether the function returns a set, i.e. the function is a table function.", + ), + ( + "owner_id", + "The role ID of the owner of the function. Corresponds to `mz_roles.id`.", + ), + ]), + sql: Box::leak( + format!( + " +WITH + argument_type_ids AS ( + SELECT func.oid, array_agg(type_mapping.id ORDER BY arg.ordinality) AS argument_type_ids + FROM + mz_internal.mz_builtin_functions func, + unnest(func.argument_type_names) WITH ORDINALITY AS arg (name, ordinality), + mz_internal.mz_builtin_object_mappings type_mapping + WHERE type_mapping.object_type = {ty} AND type_mapping.name = arg.name + GROUP BY func.oid + ) +SELECT + func_mapping.id, + func.oid, + func_schema.id AS schema_id, + func.name, + COALESCE(args.argument_type_ids, ARRAY[]::text[]) AS argument_type_ids, + variadic_type_mapping.id AS variadic_argument_type_id, + return_type_mapping.id AS return_type_id, + func.returns_set, + '{MZ_SYSTEM_ROLE_ID}' AS owner_id +FROM mz_internal.mz_builtin_functions func +JOIN mz_internal.mz_builtin_object_mappings func_mapping + ON func_mapping.schema_name = func.schema_name + AND func_mapping.name = func.name + AND func_mapping.object_type = {func} +JOIN mz_catalog.mz_schemas func_schema + ON func_schema.name = func.schema_name AND func_schema.database_id IS NULL +LEFT JOIN argument_type_ids args ON args.oid = func.oid +LEFT JOIN mz_internal.mz_builtin_object_mappings variadic_type_mapping + ON variadic_type_mapping.object_type = {ty} + AND variadic_type_mapping.name = func.variadic_argument_type_name +LEFT JOIN mz_internal.mz_builtin_object_mappings return_type_mapping + ON return_type_mapping.object_type = {ty} + AND return_type_mapping.name = func.return_type_name", + ty = gid_mapping_object_type(CatalogItemType::Type), + func = gid_mapping_object_type(CatalogItemType::Func), + ) + .into_boxed_str(), + ), + access: vec![PUBLIC_SELECT], + ontology: Some(Ontology { + entity_name: "function", + description: "A built-in or user-defined function", + links: &const { + [ + OntologyLink { + name: "in_schema", + target: "schema", + properties: LinkProperties::fk("schema_id", "id", Cardinality::ManyToOne), + }, + OntologyLink { + name: "owned_by", + target: "role", + properties: LinkProperties::fk("owner_id", "id", Cardinality::ManyToOne), + }, + OntologyLink { + name: "returns_type", + target: "type", + properties: LinkProperties::fk_nullable( + "return_type_id", + "id", + Cardinality::ManyToOne, + ), + }, + OntologyLink { + name: "has_variadic_arg_type", + target: "type", + properties: LinkProperties::fk_nullable( + "variadic_argument_type_id", + "id", + Cardinality::ManyToOne, + ), + }, + ] + }, + column_semantic_types: &const { + [ + ("id", SemanticType::CatalogItemId), + ("oid", SemanticType::OID), + ("schema_id", SemanticType::SchemaId), + ("variadic_argument_type_id", SemanticType::CatalogItemId), + ("return_type_id", SemanticType::CatalogItemId), + ("owner_id", SemanticType::RoleId), + ] + }, + }), +}); +pub static MZ_OPERATORS: LazyLock = LazyLock::new(|| { + BuiltinView { + name: "mz_operators", schema: MZ_CATALOG_SCHEMA, - oid: oid::TABLE_MZ_FUNCTIONS_OID, + oid: oid::VIEW_MZ_OPERATORS_OID, desc: RelationDesc::builder() - .with_column("id", SqlScalarType::String.nullable(false)) // not a key! .with_column("oid", SqlScalarType::Oid.nullable(false)) - .with_column("schema_id", SqlScalarType::String.nullable(false)) .with_column("name", SqlScalarType::String.nullable(false)) .with_column( "argument_type_ids", SqlScalarType::Array(Box::new(SqlScalarType::String)).nullable(false), ) - .with_column( - "variadic_argument_type_id", - SqlScalarType::String.nullable(true), - ) .with_column("return_type_id", SqlScalarType::String.nullable(true)) - .with_column("returns_set", SqlScalarType::Bool.nullable(false)) - .with_column("owner_id", SqlScalarType::String.nullable(false)) .finish(), - column_comments: BTreeMap::from_iter([ - ("id", "Materialize's unique ID for the function."), - ("oid", "A PostgreSQL-compatible OID for the function."), - ( - "schema_id", - "The ID of the schema to which the function belongs. Corresponds to `mz_schemas.id`.", - ), - ("name", "The name of the function."), - ( - "argument_type_ids", - "The ID of each argument's type. Each entry refers to `mz_types.id`.", - ), - ( - "variadic_argument_type_id", - "The ID of the variadic argument's type, or `NULL` if the function does not have a variadic argument. Refers to `mz_types.id`.", - ), - ( - "return_type_id", - "The returned value's type, or `NULL` if the function does not return a value. Refers to `mz_types.id`. Note that for table functions with > 1 column, this type corresponds to [`record`].", - ), - ( - "returns_set", - "Whether the function returns a set, i.e. the function is a table function.", - ), - ( - "owner_id", - "The role ID of the owner of the function. Corresponds to `mz_roles.id`.", - ), - ]), - is_retained_metrics_object: false, + column_comments: BTreeMap::new(), + // See `make_builtin_operators`; type ids resolve as for `mz_functions`. + sql: Box::leak( + format!( + " +WITH + argument_type_ids AS ( + SELECT op.oid, array_agg(type_mapping.id ORDER BY arg.ordinality) AS argument_type_ids + FROM + mz_internal.mz_builtin_operators op, + unnest(op.argument_type_names) WITH ORDINALITY AS arg (name, ordinality), + mz_internal.mz_builtin_object_mappings type_mapping + WHERE type_mapping.object_type = {ty} AND type_mapping.name = arg.name + GROUP BY op.oid + ) +SELECT + op.oid, + op.name, + COALESCE(args.argument_type_ids, ARRAY[]::text[]) AS argument_type_ids, + return_type_mapping.id AS return_type_id +FROM mz_internal.mz_builtin_operators op +JOIN argument_type_ids args ON args.oid = op.oid +LEFT JOIN mz_internal.mz_builtin_object_mappings return_type_mapping + ON return_type_mapping.object_type = {ty} + AND return_type_mapping.name = op.return_type_name", + ty = gid_mapping_object_type(CatalogItemType::Type), + ) + .into_boxed_str(), + ), access: vec![PUBLIC_SELECT], ontology: Some(Ontology { - entity_name: "function", - description: "A built-in or user-defined function", + entity_name: "operator", + description: "A built-in SQL operator", links: &const { - [ - OntologyLink { - name: "in_schema", - target: "schema", - properties: LinkProperties::fk("schema_id", "id", Cardinality::ManyToOne), - }, - OntologyLink { - name: "owned_by", - target: "role", - properties: LinkProperties::fk("owner_id", "id", Cardinality::ManyToOne), - }, - OntologyLink { - name: "returns_type", - target: "type", - properties: LinkProperties::fk_nullable( - "return_type_id", - "id", - Cardinality::ManyToOne, - ), - }, - OntologyLink { - name: "has_variadic_arg_type", - target: "type", - properties: LinkProperties::fk_nullable( - "variadic_argument_type_id", - "id", - Cardinality::ManyToOne, - ), - }, - ] + [OntologyLink { + name: "returns_type", + target: "type", + properties: LinkProperties::fk_nullable( + "return_type_id", + "id", + Cardinality::ManyToOne, + ), + }] }, column_semantic_types: &const { [ - ("id", SemanticType::CatalogItemId), ("oid", SemanticType::OID), - ("schema_id", SemanticType::SchemaId), - ("variadic_argument_type_id", SemanticType::CatalogItemId), ("return_type_id", SemanticType::CatalogItemId), - ("owner_id", SemanticType::RoleId), ] }, }), } }); -pub static MZ_OPERATORS: LazyLock = LazyLock::new(|| BuiltinTable { - name: "mz_operators", - schema: MZ_CATALOG_SCHEMA, - oid: oid::TABLE_MZ_OPERATORS_OID, - desc: RelationDesc::builder() - .with_column("oid", SqlScalarType::Oid.nullable(false)) - .with_column("name", SqlScalarType::String.nullable(false)) - .with_column( - "argument_type_ids", - SqlScalarType::Array(Box::new(SqlScalarType::String)).nullable(false), - ) - .with_column("return_type_id", SqlScalarType::String.nullable(true)) - .finish(), - column_comments: BTreeMap::new(), - is_retained_metrics_object: false, - access: vec![PUBLIC_SELECT], - ontology: Some(Ontology { - entity_name: "operator", - description: "A built-in SQL operator", - links: &const { - [OntologyLink { - name: "returns_type", - target: "type", - properties: LinkProperties::fk_nullable( - "return_type_id", - "id", - Cardinality::ManyToOne, - ), - }] - }, - column_semantic_types: &const { - [ - ("oid", SemanticType::OID), - ("return_type_id", SemanticType::CatalogItemId), - ] - }, - }), -}); pub static MZ_CLUSTERS: LazyLock = LazyLock::new(|| { BuiltinMaterializedView { diff --git a/src/catalog/src/builtin/mz_internal.rs b/src/catalog/src/builtin/mz_internal.rs index 8706894a7884a..e2776168c97ef 100644 --- a/src/catalog/src/builtin/mz_internal.rs +++ b/src/catalog/src/builtin/mz_internal.rs @@ -1088,17 +1088,23 @@ WHERE t.typinput IS NOT NULL AND t.typreceive IS NOT NULL AND t.typsend IS NOT N access: vec![PUBLIC_SELECT], ontology: None, }); -pub static MZ_AGGREGATES: LazyLock = LazyLock::new(|| BuiltinTable { +pub static MZ_AGGREGATES: LazyLock = LazyLock::new(|| BuiltinView { name: "mz_aggregates", schema: MZ_INTERNAL_SCHEMA, - oid: oid::TABLE_MZ_AGGREGATES_OID, + oid: oid::VIEW_MZ_AGGREGATES_OID, desc: RelationDesc::builder() .with_column("oid", SqlScalarType::Oid.nullable(false)) .with_column("agg_kind", SqlScalarType::String.nullable(false)) .with_column("agg_num_direct_args", SqlScalarType::Int16.nullable(false)) + .with_key(vec![0]) .finish(), column_comments: BTreeMap::new(), - is_retained_metrics_object: false, + // TODO(database-issues#1064): Support ordered-set aggregate functions, + // which have an agg_kind of 'o' and direct arguments. + sql: " +SELECT oid, 'n' AS agg_kind, 0::int2 AS agg_num_direct_args +FROM mz_internal.mz_builtin_functions +WHERE kind = 'aggregate'", access: vec![PUBLIC_SELECT], ontology: Some(Ontology { entity_name: "aggregate", diff --git a/src/catalog/src/builtin/pg_catalog.rs b/src/catalog/src/builtin/pg_catalog.rs index 72f2a52511484..2fd0d495940b4 100644 --- a/src/catalog/src/builtin/pg_catalog.rs +++ b/src/catalog/src/builtin/pg_catalog.rs @@ -2493,6 +2493,7 @@ pub static PG_AGGREGATE: LazyLock = LazyLock::new(|| BuiltinView { .with_column("aggmtransspace", SqlScalarType::Int32.nullable(true)) .with_column("agginitval", SqlScalarType::String.nullable(true)) .with_column("aggminitval", SqlScalarType::String.nullable(true)) + .with_key(vec![0]) .finish(), column_comments: BTreeMap::new(), sql: "SELECT diff --git a/src/pgrepr-consts/src/oid.rs b/src/pgrepr-consts/src/oid.rs index b43f6ff03af0c..d188333928c86 100644 --- a/src/pgrepr-consts/src/oid.rs +++ b/src/pgrepr-consts/src/oid.rs @@ -445,9 +445,9 @@ pub const VIEW_MZ_MAP_TYPES_OID: u32 = 16719; pub const MV_MZ_ROLES_OID: u32 = 16720; pub const MV_MZ_ROLE_MEMBERS_OID: u32 = 16721; pub const VIEW_MZ_PSEUDO_TYPES_OID: u32 = 16722; -pub const TABLE_MZ_FUNCTIONS_OID: u32 = 16723; -pub const TABLE_MZ_OPERATORS_OID: u32 = 16724; -pub const TABLE_MZ_AGGREGATES_OID: u32 = 16725; +pub const VIEW_MZ_FUNCTIONS_OID: u32 = 16723; +pub const VIEW_MZ_OPERATORS_OID: u32 = 16724; +pub const VIEW_MZ_AGGREGATES_OID: u32 = 16725; pub const MV_MZ_CLUSTERS_OID: u32 = 16726; pub const MV_MZ_SECRETS_OID: u32 = 16727; pub const MV_MZ_CLUSTER_REPLICAS_OID: u32 = 16728; @@ -858,3 +858,5 @@ 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; pub const VIEW_MZ_BUILTIN_TYPES_OID: u32 = 17152; +pub const VIEW_MZ_BUILTIN_FUNCTIONS_OID: u32 = 17153; +pub const VIEW_MZ_BUILTIN_OPERATORS_OID: u32 = 17154; diff --git a/test/sqllogictest/function_relations.slt b/test/sqllogictest/function_relations.slt new file mode 100644 index 0000000000000..121177db4cec2 --- /dev/null +++ b/test/sqllogictest/function_relations.slt @@ -0,0 +1,158 @@ +# 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 + +# mz_builtin_functions should match our static function registry +query TTTTTTT +SELECT schema_name, name, kind, argument_type_names::text, variadic_argument_type_name, return_type_name, returns_set +FROM mz_internal.mz_builtin_functions WHERE name = 'concat' +---- +pg_catalog concat scalar {any} any text false + +# --- mz_functions ------------------------------------------------------------ + +# Every implementation of an overloaded function shares the same function id. +query I +SELECT count(DISTINCT id) FROM mz_functions WHERE name = 'abs' +---- +1 + +query T +SELECT count(*) > 1 FROM mz_functions WHERE name = 'abs' +---- +true + +# The compiled-in PostgreSQL oid must match the oid resolved through the +# in-memory catalog. +query IT +SELECT oid, oid = 'now'::regproc::oid FROM mz_functions WHERE name = 'now' +---- +1299 true + +# Argument types resolve to mz_types ids in argument order. +query TT rowsort +SELECT a1.name, a2.name +FROM mz_functions f +JOIN mz_types a1 ON a1.id = f.argument_type_ids[1] +JOIN mz_types a2 ON a2.id = f.argument_type_ids[2] +WHERE f.name = 'date_trunc' AND array_length(f.argument_type_ids, 1) = 2 +---- +text interval +text timestamp +text timestamptz + +# A nullary function has an empty argument array. +query T +SELECT argument_type_ids::text FROM mz_functions WHERE name = 'now' +---- +{} + +# A variadic function reports its variadic argument as the last argument +query TTT +SELECT a.name, v.name, r.name +FROM mz_functions f +JOIN mz_types a ON a.id = f.argument_type_ids[1] +JOIN mz_types v ON v.id = f.variadic_argument_type_id +JOIN mz_types r ON r.id = f.return_type_id +WHERE f.name = 'concat' +---- +any any text + +# Non variadic functions report its variadic argument as NULL +query I +SELECT count(*) FROM mz_functions WHERE name = 'now' AND variadic_argument_type_id IS NOT NULL +---- +0 + +# Table functions return a set. +query TT +SELECT returns_set, r.name +FROM mz_functions f JOIN mz_types r ON r.id = f.return_type_id +WHERE f.name = 'jsonb_array_elements' +---- +true jsonb + +# Only a function that returns no value has no return type. +query TT +SELECT name, returns_set FROM mz_functions WHERE return_type_id IS NULL ORDER BY name +---- +repeat_row true +repeat_row_non_negative true + +# Functions live in the system schemas. +query T +SELECT s.name +FROM mz_functions f JOIN mz_schemas s ON s.id = f.schema_id +GROUP BY s.name ORDER BY s.name +---- +information_schema +mz_catalog +mz_internal +mz_unsafe +pg_catalog + +# --- mz_operators ------------------------------------------------------------ + +# Binary operators list their arguments in order, and the oid is PostgreSQL's. +query ITTT +SELECT o.oid, l.name, r.name, ret.name +FROM mz_operators o +JOIN mz_types l ON l.id = o.argument_type_ids[1] +JOIN mz_types r ON r.id = o.argument_type_ids[2] +JOIN mz_types ret ON ret.id = o.return_type_id +WHERE o.name = '->' AND l.name = 'jsonb' AND r.name = 'text' +---- +3211 jsonb text jsonb + +# Unary operators have one argument. +query T +SELECT ret.name +FROM mz_operators o +JOIN mz_types l ON l.id = o.argument_type_ids[1] +JOIN mz_types ret ON ret.id = o.return_type_id +WHERE o.name = '-' AND array_length(o.argument_type_ids, 1) = 1 AND l.name = 'int4' +---- +int4 + +# --- mz_aggregates ----------------------------------------------------------- + +# Every implementation of an aggregate function has a row +query TI rowsort +SELECT a.agg_kind, a.agg_num_direct_args +FROM mz_internal.mz_aggregates a JOIN mz_functions f USING (oid) +WHERE f.name = 'count' +---- +n 0 +n 0 + +# --- pg_catalog --------------------------------------------------------------- + +query TI +SELECT proname, prorettype FROM pg_proc WHERE oid = 1299 +---- +now 1184 + +query T +SELECT pg_function_is_visible(1299) +---- +true + +query TII +SELECT oprname, oprleft, oprright FROM pg_operator WHERE oid = 3211 +---- +-> 3802 25 + +query TI rowsort +SELECT aggkind, aggnumdirectargs +FROM pg_aggregate +WHERE aggfnoid IN (SELECT oid FROM mz_functions WHERE name = 'count') +---- +n 0 +n 0 diff --git a/test/sqllogictest/mz_views.slt b/test/sqllogictest/mz_views.slt index cd6839245a35c..16fd67609c09e 100644 --- a/test/sqllogictest/mz_views.slt +++ b/test/sqllogictest/mz_views.slt @@ -190,10 +190,12 @@ query T SELECT name FROM mz_views WHERE definition LIKE '%definition elided%' AND id LIKE 's%' ORDER BY name ---- mz_builtin_columns +mz_builtin_functions mz_builtin_index_columns mz_builtin_indexes mz_builtin_log_indexes mz_builtin_materialized_views +mz_builtin_operators mz_builtin_sources mz_builtin_tables mz_builtin_types diff --git a/test/testdrive/catalog.td b/test/testdrive/catalog.td index fc424ca5acf82..65df879026a10 100644 --- a/test/testdrive/catalog.td +++ b/test/testdrive/catalog.td @@ -512,8 +512,6 @@ name comment -------------------------------------- mz_cluster_replica_sizes "" mz_egress_ips "" -mz_functions "" -mz_operators "" mz_role_auth "" > SHOW VIEWS FROM mz_catalog @@ -521,9 +519,11 @@ name comment ----------------------------------- mz_array_types "" mz_base_types "" +mz_functions "" mz_list_types "" mz_map_types "" mz_objects "" +mz_operators "" mz_pseudo_types "" mz_relations "" mz_recent_storage_usage "" @@ -602,7 +602,6 @@ mz_wallclock_lag_history source "" > SHOW TABLES FROM mz_internal name comment ------------------------------------------------ -mz_aggregates "" mz_cluster_replica_size_internal "" mz_license_keys "" mz_object_arrangement_size_history "" @@ -618,12 +617,15 @@ mz_webhook_sources "" name comment ------------------------------------------------ mz_activity_log_thinned "" +mz_aggregates "" mz_builtin_columns "" +mz_builtin_functions "" mz_builtin_index_columns "" mz_builtin_indexes "" mz_builtin_log_indexes "" mz_builtin_materialized_views "" mz_builtin_object_mappings "" +mz_builtin_operators "" mz_builtin_sources "" mz_builtin_tables "" mz_builtin_types "" @@ -851,7 +853,7 @@ test_table "" # `SHOW TABLES` and `mz_tables` should agree. > SELECT COUNT(*) FROM mz_tables WHERE id LIKE 's%' -16 +13 # 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%' From c36ba1a90585aa04c750d115008124bb62d2dda5 Mon Sep 17 00:00:00 2001 From: SangJunBak Date: Wed, 18 Nov 2026 02:09:52 -0500 Subject: [PATCH 2/3] test: record the conversion version of mz_functions and mz_operators `mz_functions` and `mz_operators` became views, so the builtin version pin check gets v26.54.0 as their conversion version. The function relations get no migration step. `migrate_builtin_item_types` drops the shard of a builtin that became a view. Co-Authored-By: Claude Fable 5.2 --- .../materialize/checks/all_checks/builtin_version_pin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/python/materialize/checks/all_checks/builtin_version_pin.py b/misc/python/materialize/checks/all_checks/builtin_version_pin.py index d61f518c85ba8..fdb88eb32f31b 100644 --- a/misc/python/materialize/checks/all_checks/builtin_version_pin.py +++ b/misc/python/materialize/checks/all_checks/builtin_version_pin.py @@ -44,7 +44,7 @@ "mz_columns": MzVersion.parse_mz("v26.49.0"), "mz_default_privileges": MzVersion.parse_mz("v26.30.0"), "mz_egress_ips": None, - "mz_functions": None, + "mz_functions": MzVersion.parse_mz("v26.54.0"), "mz_iceberg_sinks": MzVersion.parse_mz("v26.38.0"), "mz_index_columns": MzVersion.parse_mz("v26.49.0"), "mz_kafka_connections": MzVersion.parse_mz("v26.37.0"), @@ -52,7 +52,7 @@ "mz_kafka_sources": MzVersion.parse_mz("v26.34.0"), "mz_list_types": MzVersion.parse_mz("v26.54.0"), "mz_map_types": MzVersion.parse_mz("v26.54.0"), - "mz_operators": None, + "mz_operators": MzVersion.parse_mz("v26.54.0"), "mz_pseudo_types": MzVersion.parse_mz("v26.54.0"), "mz_sinks": MzVersion.parse_mz("v26.38.0"), "mz_ssh_tunnel_connections": MzVersion.parse_mz("v26.37.0"), From fb7d43f75dd4f3463ac0e1b44490f56c77f965d5 Mon Sep 17 00:00:00 2001 From: SangJunBak Date: Mon, 16 Nov 2026 15:26:21 -0500 Subject: [PATCH 3/3] test: regenerate the catalog SLTs and documentation --- .../content/sql/system-catalog/mz_internal.md | 2 + .../autogenerated/mz_internal.slt | 2 + test/sqllogictest/catalog_server_explain.slt | 567 ++++++++++++++---- test/sqllogictest/github-2514.slt | 3 - .../information_schema_tables.slt | 14 +- .../mz_catalog_server_index_accounting.slt | 176 +++--- test/sqllogictest/oid.slt | 2 + test/sqllogictest/transactions.slt | 3 - 8 files changed, 574 insertions(+), 195 deletions(-) diff --git a/doc/user/content/sql/system-catalog/mz_internal.md b/doc/user/content/sql/system-catalog/mz_internal.md index e4f88e0514e44..caa0c4bee4d8f 100644 --- a/doc/user/content/sql/system-catalog/mz_internal.md +++ b/doc/user/content/sql/system-catalog/mz_internal.md @@ -1685,11 +1685,13 @@ The `mz_webhook_sources` table contains a row for each webhook source in the sys + + diff --git a/test/sqllogictest/autogenerated/mz_internal.slt b/test/sqllogictest/autogenerated/mz_internal.slt index 5750ff92fc2cc..4d4ab3b3148eb 100644 --- a/test/sqllogictest/autogenerated/mz_internal.slt +++ b/test/sqllogictest/autogenerated/mz_internal.slt @@ -839,11 +839,13 @@ mz_aws_connections mz_aws_privatelink_connection_status_history mz_aws_privatelink_connection_statuses mz_builtin_columns +mz_builtin_functions mz_builtin_index_columns mz_builtin_indexes mz_builtin_log_indexes mz_builtin_materialized_views mz_builtin_object_mappings +mz_builtin_operators mz_builtin_sources mz_builtin_tables mz_builtin_types diff --git a/test/sqllogictest/catalog_server_explain.slt b/test/sqllogictest/catalog_server_explain.slt index b456a3e81da0c..564a46879be09 100644 --- a/test/sqllogictest/catalog_server_explain.slt +++ b/test/sqllogictest/catalog_server_explain.slt @@ -219,6 +219,62 @@ mz_catalog.mz_objects_ind: mz_catalog.mz_objects: →With cte l0 = + →Delta Join [%0[#1{schema_name}, #2{name}] » %1:mz_builtin_object_mappings[#0{schema_name}, #1{name}] » %2:mz_schemas[#1{name}]] [%1:mz_builtin_object_mappings[#0{schema_name}] » %0[#1{schema_name}, #2{name}] » %2:mz_schemas[#1{name}]] [%2:mz_schemas[#1{name}] » %1:mz_builtin_object_mappings[#0{schema_name}] » %0[#1{schema_name}, #2{name}]] + →Arrange (#1{schema_name}, #2{name}) + →Constant (639 rows) + →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) + →Fused with Child Map/Filter/Project + Project: #0, #1, #3 + Filter: (#2{object_type} = "8") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + →Arrange (#1{name}) + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#0{database_id}) IS NULL + →Arranged mz_catalog.mz_schemas + Key: (#2{database_id}) + cte l1 = + →Arrange (#2{variadic_argument_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{variadic_argument_type_name}) IS NOT NULL + →Read l0 + cte l2 = + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #1 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l3 = + →Differential Join %1:l2[#0{name}] » %0:l1[#2{variadic_argument_type_name}] + →Arranged l1 + →Arranged l2 + cte l4 = + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l1[#2{variadic_argument_type_name}] + →Arranged l1 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l3 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#5 + →Read l0 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#5 + →Read l3 + cte l5 = + →Arrange (#2{return_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{return_type_name}) IS NOT NULL + →Read l4 + cte l6 = + →Differential Join %1:l2[#0{name}] » %0:l5[#2{return_type_name}] + →Arranged l5 + →Arranged l2 + cte l7 = →Union →Fused with Child Map/Filter/Project Project: #1, #2, #0, #3, #9, #4, #10, #5 @@ -242,7 +298,7 @@ mz_catalog.mz_objects: Key: (#0{id}) →Return →Union - →Stream l0 + →Stream l7 →Fused with Child Map/Filter/Project Project: #0..=#3, #15, #12, #11, #16 Map: "sink", null @@ -253,7 +309,7 @@ mz_catalog.mz_objects: Map: "metric-sink", null →Arranged mz_internal.mz_metric_sinks Key: (#0{id}) - →Differential Join %0:mz_indexes[#3{on_id}] » %1:l0[#0{id}] + →Differential Join %0:mz_indexes[#3{on_id}] » %1:l7[#0{id}] Final closure: Project: #0, #1, #5, #2, #6, #4, #3, #7 Map: "index", null @@ -265,7 +321,7 @@ mz_catalog.mz_objects: →Arrange (#0{id}) →Fused with Child Map/Filter/Project Project: #0, #2 - →Read l0 + →Read l7 →Fused with Child Map/Filter/Project Project: #1, #2, #0, #3, #9, #5, #10, #6 Map: "connection", null @@ -276,23 +332,37 @@ mz_catalog.mz_objects: Map: "type", null →Arranged mz_catalog.mz_types Key: (#2{schema_id}) - →Read mz_catalog.mz_functions + →Map/Filter/Project + Project: #2, #0, #3, #1, #5, #4, #6, #7 + Map: "s1", "function", null, null + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l5[#2{return_type_name}] + →Arranged l5 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l6 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3, #4 + →Read l4 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3, #4 + →Read l6 →Fused with Child Map/Filter/Project Project: #1..=#3, #0, #6, #4, #7, #5 Map: "secret", null →Arranged mz_catalog.mz_secrets Key: (#3{name}) -Source mz_catalog.mz_functions - project=(#0..=#3, #9, #8, #10, #11) - map=("function", null, null) - Used Indexes: + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) - mz_catalog.mz_indexes_ind (*** full scan ***) - mz_catalog.mz_sources_ind (*** full scan ***) - mz_catalog.mz_sinks_ind (*** full scan ***) - mz_internal.mz_metric_sinks_ind (*** full scan ***) - mz_catalog.mz_materialized_views_ind (*** full scan ***) + - mz_catalog.mz_schemas_ind (*** full scan ***) - mz_catalog.mz_connections_ind (*** full scan ***) - mz_catalog.mz_tables_ind (*** full scan ***) - mz_catalog.mz_types_ind (*** full scan ***) @@ -545,19 +615,6 @@ Target cluster: mz_catalog_server EOF -query T multiline -EXPLAIN INDEX "mz_internal"."mz_cluster_auto_scaling_strategies_ind"; ----- -mz_internal.mz_cluster_auto_scaling_strategies_ind: - →Arrange (#0{cluster_id}) - →Stream mz_internal.mz_cluster_auto_scaling_strategies - -Source mz_internal.mz_cluster_auto_scaling_strategies - -Target cluster: mz_catalog_server - -EOF - query T multiline EXPLAIN INDEX "mz_internal"."mz_catalog_item_metadata_ind"; ---- @@ -576,6 +633,19 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN INDEX "mz_internal"."mz_cluster_auto_scaling_strategies_ind"; +---- +mz_internal.mz_cluster_auto_scaling_strategies_ind: + →Arrange (#0{cluster_id}) + →Stream mz_internal.mz_cluster_auto_scaling_strategies + +Source mz_internal.mz_cluster_auto_scaling_strategies + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN INDEX "mz_internal"."mz_cluster_deployment_lineage_ind"; ---- @@ -5077,7 +5147,7 @@ mz_catalog.mz_columns: Project: #6, #0..=#3, #7, #4, #5 Map: null →Arrange (#0{schema_name}, #1{relation_name}) - →Constant (1997 rows) + →Constant (2009 rows) →Arrange (#1{schema_name}, #2{name}) →Fused with Child Map/Filter/Project Project: #6, #4, #3 @@ -5835,7 +5905,7 @@ mz_catalog.mz_tables: Project: #3, #0, #4, #1, #5, #2, #6, #6, #6 Map: "s1", null →Arrange (#1{schema_name}, #2{name}) - →Constant (16 rows) + →Constant (13 rows) →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project Project: #5, #4, #6 @@ -5890,7 +5960,7 @@ mz_catalog.mz_views: Project: #5, #0, #6, #1, #2, #8, #3, #4, #7 Map: "s1" →Arrange (#1{schema_name}, #2{name}) - →Constant (209 rows) + →Constant (214 rows) →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project Project: #5, #4, #6 @@ -6061,7 +6131,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 (180 rows) + →Constant (177 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 @@ -6407,7 +6477,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 (1140 rows) + →Constant (1157 rows) →Arrange (#1{schema_name}..=#3{object_type}) →Fused with Child Map/Filter/Project Project: #5, #4, #2, #3 @@ -7941,39 +8011,82 @@ EXPLAIN SELECT * FROM "information_schema"."routines"; Explained Query: →With cte l0 = - →Differential Join %1:mz_schemas[#0{id}] » %0:mz_functions[#0{schema_id}] - →Arrange (#0{schema_id}) - →Read mz_catalog.mz_functions - →Arrange (#0{id}) + →One-Shot Delta Join [%0 » %1:mz_builtin_object_mappings[#0{schema_name}, #1{name}] » %2:mz_schemas[#0{name}]] + →Unarranged Raw Stream + →Constant (458 rows) + →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project - Project: #1, #0, #3 + Project: #0, #1 + Filter: (#2{object_type} = "8") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #3 + Filter: (#0{database_id}) IS NULL →Arranged mz_catalog.mz_schemas Key: (#2{database_id}) + cte l1 = + →Arrange (#1{variadic_argument_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#1{variadic_argument_type_name}) IS NOT NULL + →Read l0 + cte l2 = + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #1 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l3 = + →Differential Join %1:l2[#0{name}] » %0:l1[#1{variadic_argument_type_name}] + →Arranged l1 + →Arranged l2 + cte l4 = + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l1[#1{variadic_argument_type_name}] + →Arranged l1 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #1 + →Read l3 + →Fused with Child Map/Filter/Project + Project: #0, #2, #3 + →Read l0 + →Fused with Child Map/Filter/Project + Project: #0, #2, #3 + →Read l3 + cte l5 = + →Arrange (#1{return_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#1{return_type_name}) IS NOT NULL + →Read l4 + cte l6 = + →Differential Join %1:l2[#0{name}] » %0:l5[#1{return_type_name}] + →Arranged l5 + →Arranged l2 →Return →Map/Filter/Project Project: #2, #1, #0, #3, #4 Map: "materialize", "FUNCTION", null - →Union + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l5[#1{return_type_name}] + →Arranged l5 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #1 + →Read l6 →Fused with Child Map/Filter/Project Project: #0, #2 - Filter: (null OR (#1{database_id}) IS NULL) - →Read l0 - →Differential Join %1[#0{id}] » %0:l0[#1{database_id}] - →Arrange (#1{database_id}) - →Fused with Child Map/Filter/Project - Filter: (#1{database_id}) IS NOT NULL - →Read l0 - →Arrange (#0{id}) - →Differential Join %1[#0] » %0:mz_databases[#2{name}] - →Arranged mz_catalog.mz_databases - →Arrange (#0) - →Constant (1 row) - -Source mz_catalog.mz_functions - project=(#2, #3) + →Read l4 + →Fused with Child Map/Filter/Project + Project: #0, #2 + →Read l6 Used Indexes: - - mz_catalog.mz_databases_ind (lookup) + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) - mz_catalog.mz_schemas_ind (*** full scan ***) Target cluster: mz_catalog_server @@ -8904,6 +9017,126 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN SELECT * FROM "mz_catalog"."mz_functions"; +---- +Explained Query: + →With + cte l0 = + →One-Shot Delta Join [%0 » %1:mz_builtin_object_mappings[#0{schema_name}, #1{name}] » %2:mz_schemas[#1{name}]] + →Unarranged Raw Stream + →Constant (639 rows) + →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) + →Fused with Child Map/Filter/Project + Project: #0, #1, #3 + Filter: (#2{object_type} = "8") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + →Arrange (#1{name}) + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#0{database_id}) IS NULL + →Arranged mz_catalog.mz_schemas + Key: (#2{database_id}) + cte l1 = + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l2 = + →Differential Join %1[#0] » %0:l0[#0{oid}] + →Arrange (#0{oid}) + →Stream l0 + →Non-incremental GroupAggregate + Aggregation: array_agg[order_by=[#0 asc nulls_last]](row(array[#2{id}], #1{ordinality})) + Key: + Project: #0 + →Differential Join %1:l1[#0{name}] » %0[#1{name}] + →Arrange (#1{name}) + →Constant (937 rows) + →Arranged l1 + cte l3 = + →Union + →Map/Filter/Project + Project: #0..=#7 + Map: null + →Consolidating Union + →Negate Diffs + →Fused with Child Map/Filter/Project + Project: #0..=#6 + →Read l2 + →Stream l0 + →Stream l2 + cte l4 = + →Arrange (#2{variadic_argument_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{variadic_argument_type_name}) IS NOT NULL + →Read l3 + cte l5 = + →Differential Join %1:l1[#0{name}] » %0:l4[#2{variadic_argument_type_name}] + →Arranged l4 + →Arranged l1 + cte l6 = + →Union + →Map/Filter/Project + Project: #0..=#7 + Map: null + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l4[#2{variadic_argument_type_name}] + →Arranged l4 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l5 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#7 + →Read l3 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#8 + →Read l5 + cte l7 = + →Arrange (#2{return_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{return_type_name}) IS NOT NULL + →Read l6 + cte l8 = + →Differential Join %1:l1[#0{name}] » %0:l7[#2{return_type_name}] + →Arranged l7 + →Arranged l1 + →Return + →Map/Filter/Project + Project: #3, #0, #4, #1, #8, #6, #7, #2, #9 + Map: coalesce(#5{argument_type_ids}, {}), "s1" + →Union + →Map/Filter/Project + Project: #0..=#7 + Map: null + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l7[#2{return_type_name}] + →Arranged l7 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l8 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#7 + →Read l6 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3..=#8 + →Read l8 + +Used Indexes: + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) + - mz_catalog.mz_schemas_ind (*** full scan ***) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN SELECT * FROM "mz_catalog"."mz_list_types"; ---- @@ -8953,6 +9186,64 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN SELECT * FROM "mz_catalog"."mz_operators"; +---- +Explained Query: + →With + cte l0 = + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l1 = + →Differential Join %1[#0] » %0[#0{oid}] + →Arrange (#0{oid}) + →Constant (344 rows) + →Non-incremental GroupAggregate + Aggregation: array_agg[order_by=[#0 asc nulls_last]](row(array[#2{id}], #1{ordinality})) + Key: + Project: #0 + →Differential Join %1:l0[#0{name}] » %0[#1{name}] + →Arrange (#1{name}) + →Constant (674 rows) + →Arranged l0 + cte l2 = + →Arrange (#2{return_type_name}) + →Stream l1 + cte l3 = + →Differential Join %1:l0[#0{name}] » %0:l2[#2{return_type_name}] + →Arranged l2 + →Arranged l0 + →Return + →Union + →Map/Filter/Project + Project: #0..=#3 + Map: null + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l2[#2{return_type_name}] + →Arranged l2 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l3 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3 + →Read l1 + →Fused with Child Map/Filter/Project + Project: #0, #1, #3, #4 + →Read l3 + +Used Indexes: + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN SELECT * FROM "mz_catalog"."mz_pseudo_types"; ---- @@ -9103,6 +9394,16 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN SELECT * FROM "mz_internal"."mz_aggregates"; +---- +Explained Query (fast path): + →Constant (65 rows) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_aws_privatelink_connection_statuses"; ---- @@ -9142,7 +9443,17 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_columns"; ---- Explained Query (fast path): - →Constant (1997 rows) + →Constant (2009 rows) + +Target cluster: mz_catalog_server + +EOF + +query T multiline +EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_functions"; +---- +Explained Query (fast path): + →Constant (639 rows) Target cluster: mz_catalog_server @@ -9202,6 +9513,16 @@ Target cluster: mz_catalog_server EOF +query T multiline +EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_operators"; +---- +Explained Query (fast path): + →Constant (344 rows) + +Target cluster: mz_catalog_server + +EOF + query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_sources"; ---- @@ -9216,7 +9537,7 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_tables"; ---- Explained Query (fast path): - →Constant (16 rows) + →Constant (13 rows) Target cluster: mz_catalog_server @@ -9236,7 +9557,7 @@ query T multiline EXPLAIN SELECT * FROM "mz_internal"."mz_builtin_views"; ---- Explained Query (fast path): - →Constant (209 rows) + →Constant (214 rows) Target cluster: mz_catalog_server @@ -11201,7 +11522,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 (1140 rows) + →Constant (1157 rows) →Arrange (#1{schema_name}..=#3{object_type}) →Fused with Child Map/Filter/Project Project: #5, #4, #2, #3 @@ -18359,12 +18680,8 @@ EOF query T multiline EXPLAIN SELECT * FROM "pg_catalog"."pg_aggregate"; ---- -Explained Query: - →Read mz_internal.mz_aggregates - -Source mz_internal.mz_aggregates - project=(#0..=#2, #4, #3, #3, #3, #3, #3, #3, #3, #5..=#7, #7..=#10, #8, #10, #11, #11) - map=(0, null, false, false, null, 0, null, null, null) +Explained Query (fast path): + →Constant (65 rows) Target cluster: mz_catalog_server @@ -20124,6 +20441,29 @@ EXPLAIN SELECT * FROM "pg_catalog"."pg_operator"; Explained Query: →With cte l0 = + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l1 = + →One-Shot Delta Join [%0 » %1[#0] » %2:l0[#0{name}]] + path %0: + after %1: + Filter: (array_index(#3{argument_type_ids}, 1)) IS NOT NULL + →Unarranged Raw Stream + →Constant (344 rows) + →Non-incremental GroupAggregate + Aggregation: array_agg[order_by=[#0 asc nulls_last]](row(array[#2{id}], #1{ordinality})) + Key: + Project: #0 + →Differential Join %1:l0[#0{name}] » %0[#1{name}] + →Arrange (#1{name}) + →Constant (674 rows) + →Arranged l0 + →Arranged l0 + cte l2 = →Arrange (#0{id}) →Fused with Child Map/Filter/Project Project: #1, #2 @@ -20132,34 +20472,28 @@ Explained Query: →Return →Distinct GroupAggregate →Union - →One-Shot Delta Join [%0:mz_operators » %1:l0[#0{id}] » %2:l0[#0{id}] » %3:l0[#0{id}]] + →One-Shot Delta Join [%0:l1 » %1:l2[#0{id}] » %2:l2[#0{id}] » %3:l2[#0{id}]] →Unarranged Raw Stream →Fused with Child Map/Filter/Project - Project: #0..=#3 - Filter: (array_index(#2{argument_type_ids}, 2)) IS NOT NULL AND (2 = #4) - →Read mz_catalog.mz_operators - →Arranged l0 - →Arranged l0 - →Arranged l0 - →One-Shot Delta Join [%0:mz_operators » %1:l0[#0{id}] » %2:l0[#0{id}]] + Filter: (2 = array_length(#2{argument_type_ids}, 1)) AND (array_index(#2{argument_type_ids}, 2)) IS NOT NULL + →Read l1 + →Arranged l2 + →Arranged l2 + →Arranged l2 + →One-Shot Delta Join [%0:l1 » %1:l2[#0{id}] » %2:l2[#0{id}]] path %0: Final closure: Project: #0..=#2, #4, #3 Map: 0 →Unarranged Raw Stream →Fused with Child Map/Filter/Project - Project: #0..=#3 - Filter: (1 = #4) - →Read mz_catalog.mz_operators - →Arranged l0 - →Arranged l0 - -Source mz_catalog.mz_operators - project=(#0..=#4) - filter=((array_index(#2{argument_type_ids}, 1)) IS NOT NULL AND (#3{return_type_id}) IS NOT NULL) - map=(array_length(#2{argument_type_ids}, 1)) + Filter: (1 = array_length(#2{argument_type_ids}, 1)) + →Read l1 + →Arranged l2 + →Arranged l2 Used Indexes: + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) - mz_catalog.mz_types_ind (*** full scan ***) Target cluster: mz_catalog_server @@ -20182,50 +20516,79 @@ EXPLAIN SELECT * FROM "pg_catalog"."pg_proc"; Explained Query: →With cte l0 = - →Differential Join %1:mz_schemas[#0{id}] » %0:mz_functions[#1{schema_id}] - →Arrange (#1{schema_id}) - →Read mz_catalog.mz_functions - →Arrange (#0{id}) + →One-Shot Delta Join [%0 » %1:mz_builtin_object_mappings[#0{schema_name}, #1{name}] » %2:mz_schemas[#1{name}]] + →Unarranged Raw Stream + →Constant (639 rows) + →Arrange (#0{schema_name}) (#0{schema_name}, #1{name}) →Fused with Child Map/Filter/Project - Project: #1, #2, #0 + Project: #0, #1 + Filter: (#2{object_type} = "8") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + →Arrange (#1{name}) + →Fused with Child Map/Filter/Project + Project: #2, #3 + Filter: (#0{database_id}) IS NULL →Arranged mz_catalog.mz_schemas Key: (#2{database_id}) + cte l1 = + →Fused with Child Map/Filter/Project + Project: #1, #3 + Filter: (#2{object_type} = "7") + →Arranged mz_internal.mz_builtin_object_mappings + Key: (#0{schema_name}, #1{name}) + cte l2 = + →Differential Join %1:l1[#0{name}] » %0:l0[#2{variadic_argument_type_name}] + →Arrange (#2{variadic_argument_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{variadic_argument_type_name}) IS NOT NULL + →Read l0 + →Arrange (#0{name}) + →Fused with Child Map/Filter/Project + Project: #0 + →Read l1 →Return - →One-Shot Delta Join [%0 » %2:mz_roles[#0{id}] » %1:mz_types[#0{id}]] + →One-Shot Delta Cross Join [%0 » %1:l1[#0{name}] » %2:mz_types[#0{id}] » %3[×]] path %0: Final closure: Project: #0..=#2, #4, #5, #3 Map: null →Unarranged Raw Stream - →Union + →Consolidating Union + →Negate Diffs + →Differential Join %1[#0] » %0:l0[#2{variadic_argument_type_name}] + →Arrange (#2{variadic_argument_type_name}) + →Fused with Child Map/Filter/Project + Filter: (#2{variadic_argument_type_name}) IS NOT NULL AND (#3{return_type_name}) IS NOT NULL + →Read l0 + →Distinct GroupAggregate + →Fused with Child Map/Filter/Project + Project: #2 + →Read l2 →Fused with Child Map/Filter/Project - Project: #0..=#4 - Filter: (null OR (#5{database_id}) IS NULL) + Project: #0, #1, #3, #4 + Filter: (#3{return_type_name}) IS NOT NULL →Read l0 - →Differential Join %1[#0{id}] » %0:l0[#5{database_id}] - →Arrange (#5{database_id}) - →Fused with Child Map/Filter/Project - Filter: (#5{database_id}) IS NOT NULL - →Read l0 - →Arrange (#0{id}) - →Differential Join %1[#0] » %0:mz_databases[#2{name}] - →Arranged mz_catalog.mz_databases - →Arrange (#0) - →Constant (1 row) + →Fused with Child Map/Filter/Project + Project: #0, #1, #3, #4 + Filter: (#3{return_type_name}) IS NOT NULL + →Read l2 + →Arrange (empty key) (#0{name}) (#1{return_type_id}) + →Stream l1 →Arrange (#0{id}) →Fused with Child Map/Filter/Project Project: #1, #2 →Arranged mz_catalog.mz_types Key: (#2{schema_id}) - →Arranged mz_catalog.mz_roles - -Source mz_catalog.mz_functions - project=(#1..=#3, #6, #8) - filter=((#6{return_type_id}) IS NOT NULL) + →Arrange (empty key) + →Differential Join %1[#0] » %0:mz_roles[#0{id}] + →Arranged mz_catalog.mz_roles + →Arrange (#0) + →Constant (1 row) Used Indexes: - - mz_catalog.mz_roles_ind (delta join lookup) - - mz_catalog.mz_databases_ind (lookup) + - mz_internal.mz_builtin_object_mappings_ind (*** full scan ***) + - mz_catalog.mz_roles_ind (lookup) - mz_catalog.mz_schemas_ind (*** full scan ***) - mz_catalog.mz_types_ind (*** full scan ***) diff --git a/test/sqllogictest/github-2514.slt b/test/sqllogictest/github-2514.slt index 5bb42618a3412..3fa3938b32de0 100644 --- a/test/sqllogictest/github-2514.slt +++ b/test/sqllogictest/github-2514.slt @@ -42,11 +42,9 @@ Only the following relations are available: "mz_catalog.mz_columns" "mz_catalog.mz_connections" "mz_catalog.mz_databases" -"mz_catalog.mz_functions" "mz_catalog.mz_index_columns" "mz_catalog.mz_indexes" "mz_catalog.mz_materialized_views" -"mz_catalog.mz_operators" "mz_catalog.mz_role_auth" "mz_catalog.mz_role_members" "mz_catalog.mz_role_parameters" @@ -58,7 +56,6 @@ Only the following relations are available: "mz_catalog.mz_system_privileges" "mz_catalog.mz_tables" "mz_catalog.mz_views" -"mz_internal.mz_aggregates" "mz_internal.mz_catalog_items" "mz_internal.mz_catalog_state" "mz_internal.mz_comments" diff --git a/test/sqllogictest/information_schema_tables.slt b/test/sqllogictest/information_schema_tables.slt index 948a1805b4a1a..8b14e1deb2fe6 100644 --- a/test/sqllogictest/information_schema_tables.slt +++ b/test/sqllogictest/information_schema_tables.slt @@ -146,7 +146,7 @@ BASE TABLE materialize mz_catalog mz_functions -BASE TABLE +VIEW materialize mz_catalog mz_iceberg_sinks @@ -190,7 +190,7 @@ VIEW materialize mz_catalog mz_operators -BASE TABLE +VIEW materialize mz_catalog mz_pseudo_types @@ -274,7 +274,7 @@ VIEW materialize mz_internal mz_aggregates -BASE TABLE +VIEW materialize mz_internal mz_aws_connections @@ -293,6 +293,10 @@ mz_builtin_columns VIEW materialize mz_internal +mz_builtin_functions +VIEW +materialize +mz_internal mz_builtin_index_columns VIEW materialize @@ -313,6 +317,10 @@ mz_builtin_object_mappings VIEW materialize mz_internal +mz_builtin_operators +VIEW +materialize +mz_internal mz_builtin_sources VIEW materialize diff --git a/test/sqllogictest/mz_catalog_server_index_accounting.slt b/test/sqllogictest/mz_catalog_server_index_accounting.slt index 02f57d5a75b87..c301b75e35e87 100644 --- a/test/sqllogictest/mz_catalog_server_index_accounting.slt +++ b/test/sqllogictest/mz_catalog_server_index_accounting.slt @@ -37,112 +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_builtin_object_mappings_ind CREATE␠INDEX␠"mz_builtin_object_mappings_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s460␠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␠[s458␠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␠[s535␠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␠[s788␠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␠[s462␠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␠[s460␠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␠[s537␠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␠[s790␠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␠[s534␠AS␠"mz_internal"."mz_cluster_reconfigurations"]␠("cluster_id") -mz_cluster_replica_frontiers_ind CREATE␠INDEX␠"mz_cluster_replica_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s781␠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␠[s636␠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␠[s540␠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␠[s541␠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␠[s637␠AS␠"mz_internal"."mz_cluster_replica_name_history"]␠("id") +mz_cluster_reconfigurations_ind CREATE␠INDEX␠"mz_cluster_reconfigurations_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s536␠AS␠"mz_internal"."mz_cluster_reconfigurations"]␠("cluster_id") +mz_cluster_replica_frontiers_ind CREATE␠INDEX␠"mz_cluster_replica_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s783␠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␠[s638␠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␠[s542␠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␠[s543␠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␠[s639␠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␠[s530␠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␠[s529␠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␠[s542␠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␠[s543␠AS␠"mz_internal"."mz_cluster_replica_statuses"]␠("replica_id") -mz_cluster_replicas_ind CREATE␠INDEX␠"mz_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s539␠AS␠"mz_catalog"."mz_cluster_replicas"]␠("id") -mz_clusters_ind CREATE␠INDEX␠"mz_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s531␠AS␠"mz_catalog"."mz_clusters"]␠("id") -mz_columns_ind CREATE␠INDEX␠"mz_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s502␠AS␠"mz_catalog"."mz_columns"]␠("name") -mz_comments_ind CREATE␠INDEX␠"mz_comments_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s558␠AS␠"mz_internal"."mz_comments"]␠("id") +mz_cluster_replica_size_internal_ind CREATE␠INDEX␠"mz_cluster_replica_size_internal_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s532␠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␠[s531␠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␠[s544␠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␠[s545␠AS␠"mz_internal"."mz_cluster_replica_statuses"]␠("replica_id") +mz_cluster_replicas_ind CREATE␠INDEX␠"mz_cluster_replicas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s541␠AS␠"mz_catalog"."mz_cluster_replicas"]␠("id") +mz_clusters_ind CREATE␠INDEX␠"mz_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s533␠AS␠"mz_catalog"."mz_clusters"]␠("id") +mz_columns_ind CREATE␠INDEX␠"mz_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s504␠AS␠"mz_catalog"."mz_columns"]␠("name") +mz_comments_ind CREATE␠INDEX␠"mz_comments_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s560␠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␠[s762␠AS␠"mz_internal"."mz_compute_dependencies"]␠("dependency_id") +mz_compute_dependencies_ind CREATE␠INDEX␠"mz_compute_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s764␠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␠[s772␠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␠[s774␠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␠[s537␠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␠[s768␠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␠[s767␠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␠[s766␠AS␠"mz_internal"."mz_console_cluster_utilization_overview"]␠("cluster_id") -mz_databases_ind CREATE␠INDEX␠"mz_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s500␠AS␠"mz_catalog"."mz_databases"]␠("name") +mz_connections_ind CREATE␠INDEX␠"mz_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s539␠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␠[s770␠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␠[s769␠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␠[s768␠AS␠"mz_internal"."mz_console_cluster_utilization_overview"]␠("cluster_id") +mz_databases_ind CREATE␠INDEX␠"mz_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s502␠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␠[s753␠AS␠"mz_internal"."mz_frontiers"]␠("object_id") -mz_hydration_statuses_ind CREATE␠INDEX␠"mz_hydration_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s783␠AS␠"mz_internal"."mz_hydration_statuses"]␠("object_id",␠"replica_id") -mz_indexes_ind CREATE␠INDEX␠"mz_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s503␠AS␠"mz_catalog"."mz_indexes"]␠("id") -mz_kafka_sources_ind CREATE␠INDEX␠"mz_kafka_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s496␠AS␠"mz_catalog"."mz_kafka_sources"]␠("id") -mz_materialized_views_ind CREATE␠INDEX␠"mz_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s562␠AS␠"mz_catalog"."mz_materialized_views"]␠("id") +mz_frontiers_ind CREATE␠INDEX␠"mz_frontiers_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s755␠AS␠"mz_internal"."mz_frontiers"]␠("object_id") +mz_hydration_statuses_ind CREATE␠INDEX␠"mz_hydration_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s785␠AS␠"mz_internal"."mz_hydration_statuses"]␠("object_id",␠"replica_id") +mz_indexes_ind CREATE␠INDEX␠"mz_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s505␠AS␠"mz_catalog"."mz_indexes"]␠("id") +mz_kafka_sources_ind CREATE␠INDEX␠"mz_kafka_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s498␠AS␠"mz_catalog"."mz_kafka_sources"]␠("id") +mz_materialized_views_ind CREATE␠INDEX␠"mz_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s564␠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␠[s560␠AS␠"mz_internal"."mz_metric_sinks"]␠("id") -mz_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s862␠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␠[s775␠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␠[s775␠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␠[s773␠AS␠"mz_internal"."mz_object_arrangement_sizes"]␠("replica_id") -mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s498␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") -mz_object_graph_edges_ind CREATE␠INDEX␠"mz_object_graph_edges_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s764␠AS␠"mz_internal"."mz_object_graph_edges"]␠("object_id") -mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s576␠AS␠"mz_internal"."mz_object_history"]␠("id") -mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s577␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") -mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s593␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") -mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s573␠AS␠"mz_catalog"."mz_objects"]␠("schema_id") +mz_metric_sinks_ind CREATE␠INDEX␠"mz_metric_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s562␠AS␠"mz_internal"."mz_metric_sinks"]␠("id") +mz_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s864␠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␠[s777␠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␠[s777␠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␠[s775␠AS␠"mz_internal"."mz_object_arrangement_sizes"]␠("replica_id") +mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s500␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") +mz_object_graph_edges_ind CREATE␠INDEX␠"mz_object_graph_edges_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s766␠AS␠"mz_internal"."mz_object_graph_edges"]␠("object_id") +mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s578␠AS␠"mz_internal"."mz_object_history"]␠("id") +mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s579␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") +mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s595␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") +mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s575␠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␠[s737␠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␠[s733␠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␠[s853␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") -mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s521␠AS␠"mz_catalog"."mz_roles"]␠("id") +mz_recent_activity_log_thinned_ind CREATE␠INDEX␠"mz_recent_activity_log_thinned_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s739␠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␠[s735␠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␠[s855␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") +mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s523␠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␠[s501␠AS␠"mz_catalog"."mz_schemas"]␠("database_id") -mz_secrets_ind CREATE␠INDEX␠"mz_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s536␠AS␠"mz_catalog"."mz_secrets"]␠("name") -mz_show_all_objects_ind CREATE␠INDEX␠"mz_show_all_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s621␠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␠[s785␠AS␠"mz_internal"."mz_show_cluster_replicas"]␠("cluster") -mz_show_clusters_ind CREATE␠INDEX␠"mz_show_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s623␠AS␠"mz_internal"."mz_show_clusters"]␠("name") -mz_show_columns_ind CREATE␠INDEX␠"mz_show_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s622␠AS␠"mz_internal"."mz_show_columns"]␠("id") -mz_show_connections_ind CREATE␠INDEX␠"mz_show_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s631␠AS␠"mz_internal"."mz_show_connections"]␠("schema_id") -mz_show_databases_ind CREATE␠INDEX␠"mz_show_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s625␠AS␠"mz_internal"."mz_show_databases"]␠("name") -mz_show_indexes_ind CREATE␠INDEX␠"mz_show_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s635␠AS␠"mz_internal"."mz_show_indexes"]␠("schema_id") -mz_show_materialized_views_ind CREATE␠INDEX␠"mz_show_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s634␠AS␠"mz_internal"."mz_show_materialized_views"]␠("schema_id") -mz_show_roles_ind CREATE␠INDEX␠"mz_show_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s630␠AS␠"mz_internal"."mz_show_roles"]␠("name") -mz_show_schemas_ind CREATE␠INDEX␠"mz_show_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s626␠AS␠"mz_internal"."mz_show_schemas"]␠("database_id") -mz_show_secrets_ind CREATE␠INDEX␠"mz_show_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s624␠AS␠"mz_internal"."mz_show_secrets"]␠("schema_id") -mz_show_sinks_ind CREATE␠INDEX␠"mz_show_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s633␠AS␠"mz_internal"."mz_show_sinks"]␠("schema_id") -mz_show_sources_ind CREATE␠INDEX␠"mz_show_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s632␠AS␠"mz_internal"."mz_show_sources"]␠("schema_id") -mz_show_tables_ind CREATE␠INDEX␠"mz_show_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s627␠AS␠"mz_internal"."mz_show_tables"]␠("schema_id") -mz_show_types_ind CREATE␠INDEX␠"mz_show_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s629␠AS␠"mz_internal"."mz_show_types"]␠("schema_id") -mz_show_views_ind CREATE␠INDEX␠"mz_show_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s628␠AS␠"mz_internal"."mz_show_views"]␠("schema_id") -mz_sink_statistics_ind CREATE␠INDEX␠"mz_sink_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s750␠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␠[s722␠AS␠"mz_internal"."mz_sink_status_history"]␠("sink_id") -mz_sink_statuses_ind CREATE␠INDEX␠"mz_sink_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s723␠AS␠"mz_internal"."mz_sink_statuses"]␠("id") -mz_sinks_ind CREATE␠INDEX␠"mz_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s513␠AS␠"mz_catalog"."mz_sinks"]␠("id") -mz_source_statistics_ind CREATE␠INDEX␠"mz_source_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s748␠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␠[s746␠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␠[s724␠AS␠"mz_internal"."mz_source_status_history"]␠("source_id") -mz_source_statuses_ind CREATE␠INDEX␠"mz_source_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s741␠AS␠"mz_internal"."mz_source_statuses"]␠("id") -mz_sources_ind CREATE␠INDEX␠"mz_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s506␠AS␠"mz_catalog"."mz_sources"]␠("id") -mz_tables_ind CREATE␠INDEX␠"mz_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s505␠AS␠"mz_catalog"."mz_tables"]␠("schema_id") -mz_types_ind CREATE␠INDEX␠"mz_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s515␠AS␠"mz_catalog"."mz_types"]␠("schema_id") -mz_views_ind CREATE␠INDEX␠"mz_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s514␠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␠[s757␠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␠[s559␠AS␠"mz_internal"."mz_webhook_sources"]␠("id") -pg_attrdef_all_databases_ind CREATE␠INDEX␠"pg_attrdef_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s662␠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␠[s655␠AS␠"mz_internal"."pg_attribute_all_databases"]␠("attrelid") -pg_authid_core_ind CREATE␠INDEX␠"pg_authid_core_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s672␠AS␠"mz_internal"."pg_authid_core"]␠("rolname") -pg_class_all_databases_ind CREATE␠INDEX␠"pg_class_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s643␠AS␠"mz_internal"."pg_class_all_databases"]␠("relname") -pg_description_all_databases_ind CREATE␠INDEX␠"pg_description_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s652␠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␠[s640␠AS␠"mz_internal"."pg_namespace_all_databases"]␠("nspname") -pg_type_all_databases_ind CREATE␠INDEX␠"pg_type_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s649␠AS␠"mz_internal"."pg_type_all_databases"]␠("oid") +mz_schemas_ind CREATE␠INDEX␠"mz_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s503␠AS␠"mz_catalog"."mz_schemas"]␠("database_id") +mz_secrets_ind CREATE␠INDEX␠"mz_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s538␠AS␠"mz_catalog"."mz_secrets"]␠("name") +mz_show_all_objects_ind CREATE␠INDEX␠"mz_show_all_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s623␠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␠[s787␠AS␠"mz_internal"."mz_show_cluster_replicas"]␠("cluster") +mz_show_clusters_ind CREATE␠INDEX␠"mz_show_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s625␠AS␠"mz_internal"."mz_show_clusters"]␠("name") +mz_show_columns_ind CREATE␠INDEX␠"mz_show_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s624␠AS␠"mz_internal"."mz_show_columns"]␠("id") +mz_show_connections_ind CREATE␠INDEX␠"mz_show_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s633␠AS␠"mz_internal"."mz_show_connections"]␠("schema_id") +mz_show_databases_ind CREATE␠INDEX␠"mz_show_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s627␠AS␠"mz_internal"."mz_show_databases"]␠("name") +mz_show_indexes_ind CREATE␠INDEX␠"mz_show_indexes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s637␠AS␠"mz_internal"."mz_show_indexes"]␠("schema_id") +mz_show_materialized_views_ind CREATE␠INDEX␠"mz_show_materialized_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s636␠AS␠"mz_internal"."mz_show_materialized_views"]␠("schema_id") +mz_show_roles_ind CREATE␠INDEX␠"mz_show_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s632␠AS␠"mz_internal"."mz_show_roles"]␠("name") +mz_show_schemas_ind CREATE␠INDEX␠"mz_show_schemas_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s628␠AS␠"mz_internal"."mz_show_schemas"]␠("database_id") +mz_show_secrets_ind CREATE␠INDEX␠"mz_show_secrets_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s626␠AS␠"mz_internal"."mz_show_secrets"]␠("schema_id") +mz_show_sinks_ind CREATE␠INDEX␠"mz_show_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s635␠AS␠"mz_internal"."mz_show_sinks"]␠("schema_id") +mz_show_sources_ind CREATE␠INDEX␠"mz_show_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s634␠AS␠"mz_internal"."mz_show_sources"]␠("schema_id") +mz_show_tables_ind CREATE␠INDEX␠"mz_show_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s629␠AS␠"mz_internal"."mz_show_tables"]␠("schema_id") +mz_show_types_ind CREATE␠INDEX␠"mz_show_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s631␠AS␠"mz_internal"."mz_show_types"]␠("schema_id") +mz_show_views_ind CREATE␠INDEX␠"mz_show_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s630␠AS␠"mz_internal"."mz_show_views"]␠("schema_id") +mz_sink_statistics_ind CREATE␠INDEX␠"mz_sink_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s752␠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␠[s724␠AS␠"mz_internal"."mz_sink_status_history"]␠("sink_id") +mz_sink_statuses_ind CREATE␠INDEX␠"mz_sink_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s725␠AS␠"mz_internal"."mz_sink_statuses"]␠("id") +mz_sinks_ind CREATE␠INDEX␠"mz_sinks_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s515␠AS␠"mz_catalog"."mz_sinks"]␠("id") +mz_source_statistics_ind CREATE␠INDEX␠"mz_source_statistics_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s750␠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␠[s748␠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␠[s726␠AS␠"mz_internal"."mz_source_status_history"]␠("source_id") +mz_source_statuses_ind CREATE␠INDEX␠"mz_source_statuses_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s743␠AS␠"mz_internal"."mz_source_statuses"]␠("id") +mz_sources_ind CREATE␠INDEX␠"mz_sources_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s508␠AS␠"mz_catalog"."mz_sources"]␠("id") +mz_tables_ind CREATE␠INDEX␠"mz_tables_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s507␠AS␠"mz_catalog"."mz_tables"]␠("schema_id") +mz_types_ind CREATE␠INDEX␠"mz_types_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s517␠AS␠"mz_catalog"."mz_types"]␠("schema_id") +mz_views_ind CREATE␠INDEX␠"mz_views_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s516␠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␠[s759␠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␠[s561␠AS␠"mz_internal"."mz_webhook_sources"]␠("id") +pg_attrdef_all_databases_ind CREATE␠INDEX␠"pg_attrdef_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s664␠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␠[s657␠AS␠"mz_internal"."pg_attribute_all_databases"]␠("attrelid") +pg_authid_core_ind CREATE␠INDEX␠"pg_authid_core_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s674␠AS␠"mz_internal"."pg_authid_core"]␠("rolname") +pg_class_all_databases_ind CREATE␠INDEX␠"pg_class_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s645␠AS␠"mz_internal"."pg_class_all_databases"]␠("relname") +pg_description_all_databases_ind CREATE␠INDEX␠"pg_description_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s654␠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␠[s642␠AS␠"mz_internal"."pg_namespace_all_databases"]␠("nspname") +pg_type_all_databases_ind CREATE␠INDEX␠"pg_type_all_databases_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s651␠AS␠"mz_internal"."pg_type_all_databases"]␠("oid") # Record all transitive dependencies (tables, sources, views, mvs) of indexes on # the mz_catalog_server cluster. @@ -231,6 +231,14 @@ mz_builtin_columns schema_name mz_builtin_columns type mz_builtin_columns type_mod mz_builtin_columns type_oid +mz_builtin_functions argument_type_names +mz_builtin_functions kind +mz_builtin_functions name +mz_builtin_functions oid +mz_builtin_functions return_type_name +mz_builtin_functions returns_set +mz_builtin_functions schema_name +mz_builtin_functions variadic_argument_type_name mz_builtin_index_columns index_position mz_builtin_index_columns name mz_builtin_index_columns nullable diff --git a/test/sqllogictest/oid.slt b/test/sqllogictest/oid.slt index cf5a64237feac..2d4f3e381d74f 100644 --- a/test/sqllogictest/oid.slt +++ b/test/sqllogictest/oid.slt @@ -1278,3 +1278,5 @@ SELECT oid, name FROM mz_objects WHERE id LIKE 's%' AND oid < 20000 ORDER BY oid 17150 mz_builtin_object_mappings 17151 mz_builtin_object_mappings_ind 17152 mz_builtin_types +17153 mz_builtin_functions +17154 mz_builtin_operators diff --git a/test/sqllogictest/transactions.slt b/test/sqllogictest/transactions.slt index 9be9affcc02c4..8ec44df7cac85 100644 --- a/test/sqllogictest/transactions.slt +++ b/test/sqllogictest/transactions.slt @@ -299,11 +299,9 @@ Only the following relations are available: "mz_catalog.mz_columns" "mz_catalog.mz_connections" "mz_catalog.mz_databases" -"mz_catalog.mz_functions" "mz_catalog.mz_index_columns" "mz_catalog.mz_indexes" "mz_catalog.mz_materialized_views" -"mz_catalog.mz_operators" "mz_catalog.mz_role_auth" "mz_catalog.mz_role_members" "mz_catalog.mz_role_parameters" @@ -315,7 +313,6 @@ Only the following relations are available: "mz_catalog.mz_system_privileges" "mz_catalog.mz_tables" "mz_catalog.mz_views" -"mz_internal.mz_aggregates" "mz_internal.mz_catalog_items" "mz_internal.mz_catalog_state" "mz_internal.mz_comments"