diff --git a/doc/user/content/sql/system-catalog/mz_introspection.md b/doc/user/content/sql/system-catalog/mz_introspection.md index 2c25dc71b068b..46836ff521e16 100644 --- a/doc/user/content/sql/system-catalog/mz_introspection.md +++ b/doc/user/content/sql/system-catalog/mz_introspection.md @@ -222,6 +222,19 @@ The `mz_dataflow_channel_operators` view associates [dataflow] channels with the +## `mz_dataflow_global_ids` + +The `mz_dataflow_global_ids` view associates [dataflow] ids with global ids (ids of the form `u8` or `t5`). + + + +| Field | Type | Meaning | +|------------- | ------- | -------- | +| `id` | [`uint8`] | The dataflow ID. | +| `global_id` | [`text`] | A global ID associated with that dataflow. | + + + ## `mz_dataflow_operators` The `mz_dataflow_operators` view describes the [dataflow] operators in the system. @@ -292,6 +305,29 @@ through a hierarchical scheme for either aggregation or Top K computations. | `savings` | [`numeric`] | A conservative estimate of the amount of memory in bytes to be saved by applying the hint. | | `hint` | [`double precision`] | The hint value that will eliminate `to_cut` levels from the region's hierarchy. | +## `mz_lir_mapping` + +The `mz_lir_mapping` view describes the low-level internal representation (LIR) plan that corresponds to global ids. +LIR is a higher-level representation than dataflows; this view is used for profiling and debugging indices and materialized views. +Note that LIR is not a stable interface and may change at any time. +In particular, you should not attempt to parse `operator` descriptions. +LIR nodes are implemented by zero or more dataflow operators with sequential ids. +We use the range `[operator_id_start, operator_id_end)` to record this information. +If an LIR node was implemented without any dataflow operators, `operator_id_start` will be equal to `operator_id_end`. + + +| Field | Type | Meaning +| --------- | -------- | ----------- +| global_id | [`text`] | The global ID. +| lir_id | [`uint8`] | The LIR node ID. +| operator | [`text`] | The LIR operator, in the format `OperatorName INPUTS [OPTIONS]`. +| parent_lir_id | [`uint8`] | The parent of this LIR node. May be `NULL`. +| nesting | [`uint2`] | The nesting level of this LIR node. +| operator_id_start | [`uint8`] | The first dataflow operator ID implementing this LIR operator (inclusive). +| operator_id_end | [`uint8`] | The first dataflow operator ID _after_ this LIR operator (exclusive). + + + ## `mz_message_counts` The `mz_message_counts` view describes the messages and message batches sent and received over the [dataflow] channels in the system. @@ -395,6 +431,7 @@ The `mz_scheduling_parks_histogram` view describes a histogram of [dataflow] wor [`numeric`]: /sql/types/numeric [`text`]: /sql/types/text [`uuid`]: /sql/types/uuid +[`uint2`]: /sql/types/uint2 [`uint8`]: /sql/types/uint8 [`uint8 list`]: /sql/types/list [arrangement]: /get-started/arrangements/#arrangements @@ -408,7 +445,3 @@ The `mz_scheduling_parks_histogram` view describes a histogram of [dataflow] wor - - - - diff --git a/src/catalog/src/builtin.rs b/src/catalog/src/builtin.rs index bbe414eae330d..a273a486724ac 100644 --- a/src/catalog/src/builtin.rs +++ b/src/catalog/src/builtin.rs @@ -1911,11 +1911,11 @@ pub static MZ_COMPUTE_EXPORTS_PER_WORKER: LazyLock = LazyLock::new(| access: vec![PUBLIC_SELECT], }); -pub static MZ_COMPUTE_DATAFLOW_GLOBALIDS_PER_WORKER: LazyLock = +pub static MZ_COMPUTE_DATAFLOW_GLOBAL_IDS_PER_WORKER: LazyLock = LazyLock::new(|| BuiltinLog { - name: "mz_compute_dataflow_globalids_per_worker", + name: "mz_compute_dataflow_global_ids_per_worker", schema: MZ_INTROSPECTION_SCHEMA, - oid: oid::LOG_MZ_COMPUTE_DATAFLOW_GLOBALIDS_PER_WORKER_OID, + oid: oid::LOG_MZ_COMPUTE_DATAFLOW_GLOBAL_IDS_PER_WORKER_OID, variant: LogVariant::Compute(ComputeLog::DataflowGlobal), access: vec![PUBLIC_SELECT], }); @@ -4072,13 +4072,13 @@ WHERE worker_id = 0", }); pub static MZ_DATAFLOW_GLOBAL_IDS: LazyLock = LazyLock::new(|| BuiltinView { - name: "mz_dataflow_globalids", + name: "mz_dataflow_global_ids", schema: MZ_INTROSPECTION_SCHEMA, - oid: oid::VIEW_MZ_DATAFLOW_GLOBALIDS_OID, + oid: oid::VIEW_MZ_DATAFLOW_GLOBAL_IDS_OID, column_defs: None, sql: " SELECT id, global_id -FROM mz_introspection.mz_compute_dataflow_globalids_per_worker +FROM mz_introspection.mz_compute_dataflow_global_ids_per_worker WHERE worker_id = 0", access: vec![PUBLIC_SELECT], }); @@ -9136,7 +9136,7 @@ pub static BUILTINS_STATIC: LazyLock>> = LazyLock::ne Builtin::Log(&MZ_DATAFLOW_ADDRESSES_PER_WORKER), Builtin::Log(&MZ_DATAFLOW_OPERATOR_REACHABILITY_RAW), Builtin::Log(&MZ_COMPUTE_EXPORTS_PER_WORKER), - Builtin::Log(&MZ_COMPUTE_DATAFLOW_GLOBALIDS_PER_WORKER), + Builtin::Log(&MZ_COMPUTE_DATAFLOW_GLOBAL_IDS_PER_WORKER), Builtin::Log(&MZ_MESSAGE_COUNTS_RECEIVED_RAW), Builtin::Log(&MZ_MESSAGE_COUNTS_SENT_RAW), Builtin::Log(&MZ_MESSAGE_BATCH_COUNTS_RECEIVED_RAW), diff --git a/src/compute-client/src/logging.rs b/src/compute-client/src/logging.rs index cc95a516f97ab..c2c8399f646f9 100644 --- a/src/compute-client/src/logging.rs +++ b/src/compute-client/src/logging.rs @@ -543,14 +543,14 @@ impl LogVariant { .with_column("nesting", ScalarType::UInt16.nullable(false)) .with_column("operator_id_start", ScalarType::UInt64.nullable(true)) .with_column("operator_id_end", ScalarType::UInt64.nullable(true)) - .with_key(vec![0, 1]) + .with_key(vec![0, 1, 2]) .finish(), LogVariant::Compute(ComputeLog::DataflowGlobal) => RelationDesc::builder() .with_column("id", ScalarType::UInt64.nullable(false)) .with_column("worker_id", ScalarType::UInt64.nullable(false)) .with_column("global_id", ScalarType::String.nullable(false)) - .with_key(vec![0]) + .with_key(vec![0, 1]) .finish(), } } diff --git a/src/compute-types/src/plan.rs b/src/compute-types/src/plan.rs index 4ac1582fab568..27232346ce5bd 100644 --- a/src/compute-types/src/plan.rs +++ b/src/compute-types/src/plan.rs @@ -188,6 +188,8 @@ impl AvailableCollections { } /// An identifier for an LIR node. +/// +/// LirIds start at 1, not 0, which let's us get a better struct packing in `ComputeEvent::LirMapping`. #[derive(Clone, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)] pub struct LirId(NonZeroU64); @@ -1147,6 +1149,16 @@ mod tests { use super::*; + #[mz_ore::test] + fn test_option_lirid_fits_in_usize() { + let option_lirid_size = std::mem::size_of::>(); + let usize_size = std::mem::size_of::(); + assert!( + option_lirid_size <= usize_size, + "Option (size {option_lirid_size}) should fit in usize (size {usize_size})" + ); + } + proptest! { #![proptest_config(ProptestConfig::with_cases(10))] #[mz_ore::test] diff --git a/src/compute-types/src/plan/flat_plan.rs b/src/compute-types/src/plan/flat_plan.rs index ff6fd4241d21a..5aff4f52a7cf1 100644 --- a/src/compute-types/src/plan/flat_plan.rs +++ b/src/compute-types/src/plan/flat_plan.rs @@ -808,57 +808,87 @@ impl FlatPlanNode { /// Renders a single `FlatPlanNode` as a string. /// /// Typically of the format "{NodeName}::{Detail} {input LirID} ({options})" + /// + /// See `FlatPlanNodeHumanizer` and its `std::fmt::Display` instance for implementation details. pub fn humanize(&self, humanizer: &dyn ExprHumanizer) -> String { - let explainer = HumanizedExplain::new(false); + FlatPlanNodeHumanizer::new(self, humanizer).to_string() + } +} - match self { +/// Packages a `FlatPlanNode` with an `ExprHumanizer` to render human readable strings. +/// +/// Invariant: the `std::fmt::Display` instance should produce a single line for a given node. +#[derive(Debug)] +pub struct FlatPlanNodeHumanizer<'a, T> { + node: &'a FlatPlanNode, + humanizer: &'a dyn ExprHumanizer, +} + +impl<'a, T> FlatPlanNodeHumanizer<'a, T> { + /// Creates a `FlatPlanNodeHumanizer` (which simply holds the references). + /// + /// Use the `std::fmt::Display` instance. + pub fn new(node: &'a FlatPlanNode, humanizer: &'a dyn ExprHumanizer) -> Self { + Self { node, humanizer } + } +} + +impl<'a, T> std::fmt::Display for FlatPlanNodeHumanizer<'a, T> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self.node { FlatPlanNode::Constant { rows } => { - let summary = match rows { - Ok(rows) => format!("{} rows", rows.len()), - Err(err) => format!("error ({err})"), - }; - format!("Constant {summary}") + write!(f, "Constant ")?; + + match rows { + Ok(rows) => write!(f, "{} rows", rows.len()), + Err(err) => write!(f, "error ({err})"), + } } FlatPlanNode::Get { id, keys: _, plan } => { - let id = match id { - Id::Local(id) => id.to_string(), - Id::Global(id) => humanizer.humanize_id(*id).unwrap_or_else(|| id.to_string()), - }; - let plan = match plan { - GetPlan::PassArrangements => "PassArrangements".to_string(), - GetPlan::Arrangement(_key, Some(val), _mfp) => { - format!("Arrangement (val={})", explainer.expr(val, None)) - } - GetPlan::Arrangement(_key, None, _mfp) => "Arrangement".to_string(), - GetPlan::Collection(_mfp) => "Collection".to_string(), + write!(f, "Get::")?; + + match plan { + GetPlan::PassArrangements => write!(f, "PassArrangements")?, + GetPlan::Arrangement(_key, Some(val), _mfp) => write!( + f, + "Arrangement (val={})", + HumanizedExplain::new(false).expr(val, None) + )?, + GetPlan::Arrangement(_key, None, _mfp) => write!(f, "Arrangement")?, + GetPlan::Collection(_mfp) => write!(f, "Collection")?, }; - format!("Get::{plan} {id}") + write!(f, " ")?; + + match id { + Id::Local(id) => write!(f, "{id}"), + Id::Global(id) => { + if let Some(id) = self.humanizer.humanize_id(*id) { + write!(f, "{id}") + } else { + write!(f, "{id}") + } + } + } } - FlatPlanNode::Let { id, value, body } => format!("Let {id}={value} in {body}"), + FlatPlanNode::Let { id, value, body } => write!(f, "Let {id}={value} Returning {body}"), FlatPlanNode::LetRec { ids, values, limits, body, } => { - let bindings = mz_ore::str::separated( - "; ", - ids.iter() - .zip_eq(values) - .zip_eq(limits) - .map(|((id, value), limit)| { - let mut binding = format!("{id} = {value}"); - - if let Some(limit) = limit { - binding.push_str(&format!(" ({limit})")); - } - - binding - }), - ); + write!(f, "LetRec ")?; + + for ((id, value), limit) in ids.iter().zip_eq(values).zip_eq(limits) { + write!(f, "{id} = {value} ")?; + + if let Some(limit) = limit { + write!(f, "({limit}) ")?; + } + } - format!("LetRec {bindings} Returning {body}") + write!(f, "Returning {body}") } FlatPlanNode::Mfp { input, @@ -866,7 +896,7 @@ impl FlatPlanNode { input_key_val: _, } => { // TODO(mgree) show MFP detail - format!("MapFilterProject {input}") + write!(f, "MapFilterProject {input}") } FlatPlanNode::FlatMap { input, @@ -876,7 +906,7 @@ impl FlatPlanNode { input_key: _, } => { // TODO(mgree) show FlatMap detail - format!("FlatMap {input} ({func})") + write!(f, "FlatMap {input} ({func})") } FlatPlanNode::Join { inputs, plan } => match plan { JoinPlan::Linear(LinearJoinPlan { @@ -884,30 +914,28 @@ impl FlatPlanNode { stage_plans, .. }) => { - let stages = mz_ore::str::separated( - " » ", - std::iter::once(inputs[*source_relation]) - .chain(stage_plans.iter().map(|dsp| inputs[dsp.lookup_relation])), - ); + write!(f, "Join::Differential ")?; - format!("Join::Differential {stages}") + write!(f, "{}", inputs[*source_relation])?; + for dsp in stage_plans { + write!(f, "» {}", inputs[dsp.lookup_relation])?; + } + + Ok(()) } JoinPlan::Delta(DeltaJoinPlan { path_plans }) => { - let stages = mz_ore::str::separated( - "; ", - path_plans.iter().map(|dpp| { - mz_ore::str::separated( - " » ", - std::iter::once(inputs[dpp.source_relation]).chain( - dpp.stage_plans - .iter() - .map(|dsp| inputs[dsp.lookup_relation]), - ), - ) - }), - ); + write!(f, "Join::Delta")?; - format!("Join::Delta {stages}") + for dpp in path_plans { + write!(f, "[{}", inputs[dpp.source_relation])?; + + for dsp in &dpp.stage_plans { + write!(f, "» {}", inputs[dsp.lookup_relation])?; + } + write!(f, "] ")?; + } + + Ok(()) } }, FlatPlanNode::Reduce { @@ -917,67 +945,74 @@ impl FlatPlanNode { input_key: _input_key, mfp_after: _mfp_after, } => { - let mut options = String::new(); - let plan = match plan { - ReducePlan::Distinct => "Distinct", - ReducePlan::Accumulable(..) => "Accumulable", + write!(f, "Reduce::")?; + + match plan { + ReducePlan::Distinct => write!(f, "Distinct {input}"), + ReducePlan::Accumulable(..) => write!(f, "Accumulable {input}"), ReducePlan::Hierarchical(HierarchicalPlan::Monotonic(..)) => { - options.push_str(" (monotonic)"); - "Hierarchical" + write!(f, "Hierarchical {input} (monotonic)") } ReducePlan::Hierarchical(HierarchicalPlan::Bucketed(BucketedPlan { buckets, .. })) => { - options.push_str(&format!( - " (buckets: {})", - mz_ore::str::separated(", ", buckets) - )); - "Hierarchical" - } - ReducePlan::Basic(..) => "Basic", - ReducePlan::Collation(..) => "Collation", - }; + write!(f, "Hierarchical {input} (buckets:")?; - format!("Reduce::{plan} {input}{options}") + for bucket in buckets { + write!(f, " {bucket}")?; + } + write!(f, ")") + } + ReducePlan::Basic(..) => write!(f, "Basic"), + ReducePlan::Collation(..) => write!(f, "Collation"), + } } FlatPlanNode::TopK { input, top_k_plan } => { - let plan = match top_k_plan { - TopKPlan::MonotonicTop1(..) => "MonotonicTop1", + write!(f, "TopK::")?; + match top_k_plan { + TopKPlan::MonotonicTop1(..) => write!(f, "MonotonicTop1")?, TopKPlan::MonotonicTopK(MonotonicTopKPlan { limit: Some(limit), .. - }) => &format!("MonotonicTopK({})", explainer.expr(limit, None)), - TopKPlan::MonotonicTopK(MonotonicTopKPlan { .. }) => "MonotonicTopK", - TopKPlan::Basic(..) => "Basic", + }) => write!( + f, + "MonotonicTopK({})", + HumanizedExplain::new(false).expr(limit, None) + )?, + TopKPlan::MonotonicTopK(MonotonicTopKPlan { .. }) => { + write!(f, "MonotonicTopK")? + } + TopKPlan::Basic(..) => write!(f, "Basic")?, }; - format!("TopK::{plan} {input}") + write!(f, " {input}") } - FlatPlanNode::Negate { input } => format!("Negate {input}"), + FlatPlanNode::Negate { input } => write!(f, "Negate {input}"), FlatPlanNode::Threshold { input, threshold_plan: _, - } => format!("Threshold {input}"), + } => write!(f, "Threshold {input}"), FlatPlanNode::Union { inputs, consolidate_output, } => { - let consolidate = if *consolidate_output { - " (consolidates output)" - } else { - "" - }; + write!(f, "Union")?; + + for input in inputs { + write!(f, " {input}")?; + } + + if *consolidate_output { + write!(f, " (consolidates output)")?; + } - format!( - "Union {}{consolidate}", - mz_ore::str::separated(", ", inputs) - ) + Ok(()) } FlatPlanNode::ArrangeBy { input, forms: _, input_key: _, input_mfp: _, - } => format!("Arrange {input}"), + } => write!(f, "Arrange {input}"), } } } diff --git a/src/compute-types/src/plan/lowering.rs b/src/compute-types/src/plan/lowering.rs index 032ef2ef9ac20..a862d4b7540d4 100644 --- a/src/compute-types/src/plan/lowering.rs +++ b/src/compute-types/src/plan/lowering.rs @@ -45,7 +45,7 @@ impl Context { pub fn new(debug_name: String, features: &OptimizerFeatures) -> Self { Self { arrangements: Default::default(), - next_lir_id: LirId(std::num::NonZero::new(1).unwrap()), + next_lir_id: LirId(std::num::NonZero::::MIN), debug_info: LirDebugInfo { debug_name, id: GlobalId::Transient(0), @@ -57,11 +57,12 @@ impl Context { fn allocate_lir_id(&mut self) -> LirId { let id = self.next_lir_id; - if let Some(next_lir_id) = self.next_lir_id.0.checked_add(1) { - self.next_lir_id = LirId(next_lir_id); - } else { - panic!("ran out of LirIds") - } + self.next_lir_id = LirId( + self.next_lir_id + .0 + .checked_add(1) + .expect("No LirId overflow"), + ); id } diff --git a/src/compute/src/render.rs b/src/compute/src/render.rs index 779d7107c5a7a..965f7ebe3580d 100644 --- a/src/compute/src/render.rs +++ b/src/compute/src/render.rs @@ -885,7 +885,8 @@ where let step = steps.remove(&lir_id).unwrap(); // TODO(mgree) need ExprHumanizer in DataflowDescription to get nice column names - // (ActiveComputeState doesn't have a catalog reference) + // ActiveComputeState can't have a catalog reference, so we'll need to capture the names + // in some other structure and have that structure impl ExprHumanizer let operator = step.node.humanize(&DummyHumanizer); let operator_id_start = self.scope.peek_identifier(); diff --git a/src/environmentd/tests/testdata/http/ws b/src/environmentd/tests/testdata/http/ws index bee3e9252cb92..e5bb48cc4df95 100644 --- a/src/environmentd/tests/testdata/http/ws +++ b/src/environmentd/tests/testdata/http/ws @@ -402,7 +402,7 @@ ws-text ws-text {"query": "SELECT 1 FROM mz_sources LIMIT 1"} ---- -{"type":"Notice","payload":{"message":"{\n \"plans\": {\n \"raw\": {\n \"text\": \"Finish limit=1 output=[#0]\\n Project (#15)\\n Map (1)\\n Get mz_catalog.mz_sources\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 460\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"Literal\": [\n {\n \"data\": [\n 45,\n 1\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n },\n \"optimized\": {\n \"global\": {\n \"text\": \"t72:\\n Finish limit=1 output=[#0]\\n ArrangeBy keys=[[#0]]\\n ReadGlobalFromSameDataflow t71\\n\\nt71:\\n Project (#15)\\n Map (1)\\n ReadIndex on=mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"t72\",\n \"plan\": {\n \"ArrangeBy\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"Transient\": 71\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ],\n \"keys\": []\n },\n \"access_strategy\": \"SameDataflow\"\n }\n },\n \"keys\": [\n [\n {\n \"Column\": 0\n }\n ]\n ]\n }\n }\n },\n {\n \"id\": \"t71\",\n \"plan\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 460\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n },\n \"access_strategy\": {\n \"Index\": [\n [\n {\n \"System\": 732\n },\n \"FullScan\"\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"Literal\": [\n {\n \"Ok\": {\n \"data\": [\n 45,\n 1\n ]\n }\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n }\n ],\n \"sources\": []\n }\n },\n \"fast_path\": {\n \"text\": \"Explained Query (fast path):\\n Finish limit=1 output=[#0]\\n Project (#15)\\n Map (1)\\n ReadIndex on=mz_catalog.mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"Explained Query (fast path)\",\n \"plan\": {\n \"PeekExisting\": [\n {\n \"System\": 460\n },\n {\n \"System\": 732\n },\n null,\n {\n \"mfp\": {\n \"expressions\": [\n {\n \"Literal\": [\n {\n \"Ok\": {\n \"data\": [\n 45,\n 1\n ]\n }\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ],\n \"predicates\": [],\n \"projection\": [\n 15\n ],\n \"input_arity\": 15\n }\n }\n ]\n }\n }\n ],\n \"sources\": []\n }\n }\n }\n },\n \"insights\": {\n \"imports\": {\n \"s732\": {\n \"name\": {\n \"schema\": \"mz_catalog\",\n \"item\": \"mz_sources_ind\"\n },\n \"type\": \"compute\"\n }\n },\n \"fast_path_clusters\": {},\n \"fast_path_limit\": null,\n \"persist_count\": []\n },\n \"cluster\": {\n \"name\": \"mz_catalog_server\",\n \"id\": {\n \"System\": 2\n }\n },\n \"redacted_sql\": \"SELECT '' FROM [s460 AS mz_catalog.mz_sources] LIMIT ''\"\n}","code":"MZ001","severity":"notice"}} +{"type":"Notice","payload":{"message":"{\n \"plans\": {\n \"raw\": {\n \"text\": \"Finish limit=1 output=[#0]\\n Project (#15)\\n Map (1)\\n Get mz_catalog.mz_sources\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 461\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"Literal\": [\n {\n \"data\": [\n 45,\n 1\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n },\n \"optimized\": {\n \"global\": {\n \"text\": \"t72:\\n Finish limit=1 output=[#0]\\n ArrangeBy keys=[[#0]]\\n ReadGlobalFromSameDataflow t71\\n\\nt71:\\n Project (#15)\\n Map (1)\\n ReadIndex on=mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"t72\",\n \"plan\": {\n \"ArrangeBy\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"Transient\": 71\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ],\n \"keys\": []\n },\n \"access_strategy\": \"SameDataflow\"\n }\n },\n \"keys\": [\n [\n {\n \"Column\": 0\n }\n ]\n ]\n }\n }\n },\n {\n \"id\": \"t71\",\n \"plan\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 461\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n },\n \"access_strategy\": {\n \"Index\": [\n [\n {\n \"System\": 736m {"type":"CommandStarting","payload":{"has_rows":true,"is_streaming":false}} {"type":"Rows","payload":{"columns":[{"name":"?column?","type_oid":23,"type_len":4,"type_mod":-1}]}} {"type":"Row","payload":["1"]} @@ -412,7 +412,7 @@ ws-text ws-text {"query": "SELECT 1 / 0 FROM mz_sources LIMIT 1"} ---- -{"type":"Notice","payload":{"message":"{\n \"plans\": {\n \"raw\": {\n \"text\": \"Finish limit=1 output=[#0]\\n Project (#15)\\n Map ((1 / 0))\\n Get mz_catalog.mz_sources\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 460\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"CallBinary\": {\n \"func\": \"DivInt32\",\n \"expr1\": {\n \"Literal\": [\n {\n \"data\": [\n 45,\n 1\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n },\n \"expr2\": {\n \"Literal\": [\n {\n \"data\": [\n 44\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n }\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n },\n \"optimized\": {\n \"global\": {\n \"text\": \"t75:\\n Finish limit=1 output=[#0]\\n ArrangeBy keys=[[#0]]\\n ReadGlobalFromSameDataflow t74\\n\\nt74:\\n Project (#15)\\n Map (error(\\\"division by zero\\\"))\\n ReadIndex on=mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"t75\",\n \"plan\": {\n \"ArrangeBy\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"Transient\": 74\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ],\n \"keys\": []\n },\n \"access_strategy\": \"SameDataflow\"\n }\n },\n \"keys\": [\n [\n {\n \"Column\": 0\n }\n ]\n ]\n }\n }\n },\n {\n \"id\": \"t74\",\n \"plan\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 460\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n },\n \"access_strategy\": {\n \"Index\": [\n [\n {\n \"System\": 732\n },\n \"FullScan\"\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"Literal\": [\n {\n \"Err\": \"DivisionByZero\"\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n }\n ],\n \"sources\": []\n }\n },\n \"fast_path\": {\n \"text\": \"Explained Query (fast path):\\n Finish limit=1 output=[#0]\\n Project (#15)\\n Map (error(\\\"division by zero\\\"))\\n ReadIndex on=mz_catalog.mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"Explained Query (fast path)\",\n \"plan\": {\n \"PeekExisting\": [\n {\n \"System\": 460\n },\n {\n \"System\": 732\n },\n null,\n {\n \"mfp\": {\n \"expressions\": [\n {\n \"Literal\": [\n {\n \"Err\": \"DivisionByZero\"\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ],\n \"predicates\": [],\n \"projection\": [\n 15\n ],\n \"input_arity\": 15\n }\n }\n ]\n }\n }\n ],\n \"sources\": []\n }\n }\n }\n },\n \"insights\": {\n \"imports\": {\n \"s732\": {\n \"name\": {\n \"schema\": \"mz_catalog\",\n \"item\": \"mz_sources_ind\"\n },\n \"type\": \"compute\"\n }\n },\n \"fast_path_clusters\": {},\n \"fast_path_limit\": null,\n \"persist_count\": []\n },\n \"cluster\": {\n \"name\": \"mz_catalog_server\",\n \"id\": {\n \"System\": 2\n }\n },\n \"redacted_sql\": \"SELECT '' / '' FROM [s460 AS mz_catalog.mz_sources] LIMIT ''\"\n}","code":"MZ001","severity":"notice"}} +{"type":"Notice","payload":{"message":"{\n \"plans\": {\n \"raw\": {\n \"text\": \"Finish limit=1 output=[#0]\\n Project (#15)\\n Map ((1 / 0))\\n Get mz_catalog.mz_sources\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 461\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"CallBinary\": {\n \"func\": \"DivInt32\",\n \"expr1\": {\n \"Literal\": [\n {\n \"data\": [\n 45,\n 1\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n },\n \"expr2\": {\n \"Literal\": [\n {\n \"data\": [\n 44\n ]\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n }\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n },\n \"optimized\": {\n \"global\": {\n \"text\": \"t75:\\n Finish limit=1 output=[#0]\\n ArrangeBy keys=[[#0]]\\n ReadGlobalFromSameDataflow t74\\n\\nt74:\\n Project (#15)\\n Map (error(\\\"division by zero\\\"))\\n ReadIndex on=mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"t75\",\n \"plan\": {\n \"ArrangeBy\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"Transient\": 74\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ],\n \"keys\": []\n },\n \"access_strategy\": \"SameDataflow\"\n }\n },\n \"keys\": [\n [\n {\n \"Column\": 0\n }\n ]\n ]\n }\n }\n },\n {\n \"id\": \"t74\",\n \"plan\": {\n \"Project\": {\n \"input\": {\n \"Map\": {\n \"input\": {\n \"Get\": {\n \"id\": {\n \"Global\": {\n \"System\": 461\n }\n },\n \"typ\": {\n \"column_types\": [\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"Oid\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": false\n },\n {\n \"scalar_type\": {\n \"Array\": \"MzAclItem\"\n },\n \"nullable\": false\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n },\n {\n \"scalar_type\": \"String\",\n \"nullable\": true\n }\n ],\n \"keys\": [\n [\n 0\n ],\n [\n 1\n ]\n ]\n },\n \"access_strategy\": {\n \"Index\": [\n [\n {\n \"System\": 736\n },\n \"FullScan\"\n ]\n ]\n }\n }\n },\n \"scalars\": [\n {\n \"Literal\": [\n {\n \"Err\": \"DivisionByZero\"\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ]\n }\n },\n \"outputs\": [\n 15\n ]\n }\n }\n }\n ],\n \"sources\": []\n }\n },\n \"fast_path\": {\n \"text\": \"Explained Query (fast path):\\n Finish limit=1 output=[#0]\\n Project (#15)\\n Map (error(\\\"division by zero\\\"))\\n ReadIndex on=mz_catalog.mz_sources mz_sources_ind=[*** full scan ***]\\n\\nTarget cluster: mz_catalog_server\\n\",\n \"json\": {\n \"plans\": [\n {\n \"id\": \"Explained Query (fast path)\",\n \"plan\": {\n \"PeekExisting\": [\n {\n \"System\": 461\n },\n {\n \"System\": 736\n },\n null,\n {\n \"mfp\": {\n \"expressions\": [\n {\n \"Literal\": [\n {\n \"Err\": \"DivisionByZero\"\n },\n {\n \"scalar_type\": \"Int32\",\n \"nullable\": false\n }\n ]\n }\n ],\n \"predicates\": [],\n \"projection\": [\n 15\n ],\n \"input_arity\": 15\n }\n }\n ]\n }\n }\n ],\n \"sources\": []\n }\n }\n }\n },\n \"insights\": {\n \"imports\": {\n \"s736\": {\n \"name\": {\n \"schema\": \"mz_catalog\",\n \"item\": \"mz_sources_ind\"\n },\n \"type\": \"compute\"\n }\n },\n \"fast_path_clusters\": {},\n \"fast_path_limit\": null,\n \"persist_count\": []\n },\n \"cluster\": {\n \"name\": \"mz_catalog_server\",\n \"id\": {\n \"System\": 2\n }\n },\n \"redacted_sql\": \"SELECT '' / '' FROM [s461 AS mz_catalog.mz_sources] LIMIT ''\"\n}","code":"MZ001","severity":"notice"}} {"type":"CommandStarting","payload":{"has_rows":false,"is_streaming":false}} {"type":"Error","payload":{"message":"division by zero","code":"XX000"}} {"type":"ReadyForQuery","payload":"I"} diff --git a/src/pgrepr-consts/src/oid.rs b/src/pgrepr-consts/src/oid.rs index 3ba047149bbc5..04733ce3d16bc 100644 --- a/src/pgrepr-consts/src/oid.rs +++ b/src/pgrepr-consts/src/oid.rs @@ -764,6 +764,6 @@ pub const TABLE_MZ_NETWORK_POLICY_RULES_OID: u32 = 17041; pub const VIEW_MZ_INDEX_ADVICE_OID: u32 = 17042; pub const VIEW_MZ_SHOW_NETWORK_POLICIES_OID: u32 = 17043; pub const LOG_MZ_COMPUTE_LIR_MAPPING_PER_WORKER_OID: u32 = 17044; -pub const LOG_MZ_COMPUTE_DATAFLOW_GLOBALIDS_PER_WORKER_OID: u32 = 17045; +pub const LOG_MZ_COMPUTE_DATAFLOW_GLOBAL_IDS_PER_WORKER_OID: u32 = 17045; pub const VIEW_MZ_LIR_MAPPING_OID: u32 = 17046; -pub const VIEW_MZ_DATAFLOW_GLOBALIDS_OID: u32 = 17047; +pub const VIEW_MZ_DATAFLOW_GLOBAL_IDS_OID: u32 = 17047; diff --git a/test/sqllogictest/autogenerated/mz_introspection.slt b/test/sqllogictest/autogenerated/mz_introspection.slt index 43524f01bc9c8..b90f36fc63a42 100644 --- a/test/sqllogictest/autogenerated/mz_introspection.slt +++ b/test/sqllogictest/autogenerated/mz_introspection.slt @@ -126,6 +126,12 @@ SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND o 4 to_operator_id uint8 5 to_operator_address list +query ITT +SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND object = 'mz_dataflow_global_ids' ORDER BY position +---- +1 id uint8 +2 global_id text + query ITT SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND object = 'mz_dataflow_operators' ORDER BY position ---- @@ -164,6 +170,17 @@ SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND o 7 savings numeric 8 hint double␠precision +query ITT +SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND object = 'mz_lir_mapping' ORDER BY position +---- +1 global_id text +2 lir_id uint8 +3 operator text +4 parent_lir_id uint8 +5 nesting uint2 +6 operator_id_start uint8 +7 operator_id_end uint8 + query ITT SELECT position, name, type FROM objects WHERE schema = 'mz_introspection' AND object = 'mz_message_counts' ORDER BY position ---- @@ -235,7 +252,7 @@ mz_arrangement_sharing_per_worker mz_arrangement_sharing_raw mz_arrangement_sizes mz_arrangement_sizes_per_worker -mz_compute_dataflow_globalids_per_worker +mz_compute_dataflow_global_ids_per_worker mz_compute_error_counts mz_compute_error_counts_per_worker mz_compute_error_counts_raw @@ -257,7 +274,7 @@ mz_dataflow_channel_operators mz_dataflow_channel_operators_per_worker mz_dataflow_channels mz_dataflow_channels_per_worker -mz_dataflow_globalids +mz_dataflow_global_ids mz_dataflow_operator_dataflows mz_dataflow_operator_dataflows_per_worker mz_dataflow_operator_parents diff --git a/test/sqllogictest/cluster.slt b/test/sqllogictest/cluster.slt index 8fd67e89330d0..9e8ca980ca70b 100644 --- a/test/sqllogictest/cluster.slt +++ b/test/sqllogictest/cluster.slt @@ -210,7 +210,8 @@ bar mz_arrangement_records_raw mz_arrangement_records_raw_u7_primary_idx 1 o bar mz_arrangement_records_raw mz_arrangement_records_raw_u7_primary_idx 2 worker_id NULL false bar mz_arrangement_sharing_raw mz_arrangement_sharing_raw_u7_primary_idx 1 operator_id NULL false bar mz_arrangement_sharing_raw mz_arrangement_sharing_raw_u7_primary_idx 2 worker_id NULL false -bar mz_compute_dataflow_globalids_per_worker mz_compute_dataflow_globalids_per_worker_u7_primary_idx 1 id NULL false +bar mz_compute_dataflow_global_ids_per_worker mz_compute_dataflow_global_ids_per_worker_u7_primary_idx 1 id NULL false +bar mz_compute_dataflow_global_ids_per_worker mz_compute_dataflow_global_ids_per_worker_u7_primary_idx 2 worker_id NULL false bar mz_compute_error_counts_raw mz_compute_error_counts_raw_u7_primary_idx 1 export_id NULL false bar mz_compute_error_counts_raw mz_compute_error_counts_raw_u7_primary_idx 2 worker_id NULL false bar mz_compute_exports_per_worker mz_compute_exports_per_worker_u7_primary_idx 1 export_id NULL false @@ -224,6 +225,7 @@ bar mz_compute_import_frontiers_per_worker mz_compute_import_frontiers_per_wor bar mz_compute_import_frontiers_per_worker mz_compute_import_frontiers_per_worker_u7_primary_idx 3 worker_id NULL false bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 1 global_id NULL false bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 2 lir_id NULL false +bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 3 worker_id NULL false bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 1 id NULL false bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 2 worker_id NULL false bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 3 duration_ns NULL false diff --git a/test/sqllogictest/information_schema_tables.slt b/test/sqllogictest/information_schema_tables.slt index 3fb39412fcfdb..4d439cf53f0e6 100644 --- a/test/sqllogictest/information_schema_tables.slt +++ b/test/sqllogictest/information_schema_tables.slt @@ -825,7 +825,7 @@ mz_arrangement_sizes_per_worker VIEW materialize mz_introspection -mz_compute_dataflow_globalids_per_worker +mz_compute_dataflow_global_ids_per_worker SOURCE materialize mz_introspection @@ -913,7 +913,7 @@ mz_dataflow_channels_per_worker SOURCE materialize mz_introspection -mz_dataflow_globalids +mz_dataflow_global_ids VIEW materialize mz_introspection diff --git a/test/sqllogictest/introspection/attribution_sources.slt b/test/sqllogictest/introspection/attribution_sources.slt index 1ee6ee3487c9f..cf7b0e5023776 100644 --- a/test/sqllogictest/introspection/attribution_sources.slt +++ b/test/sqllogictest/introspection/attribution_sources.slt @@ -30,21 +30,21 @@ statement ok SELECT mz_unsafe.mz_sleep(2) query IT -SELECT id, global_id FROM mz_internal.mz_dataflow_globalids ORDER BY id, global_id; +SELECT id, global_id FROM mz_internal.mz_dataflow_global_ids ORDER BY id, global_id; ---- -8 u2 -8 u3 +9 u8 +9 u9 query TI SELECT global_id, lir_id FROM mz_internal.mz_lir_mapping ORDER BY global_id, lir_id DESC; ---- -u2 4 -u2 3 -u2 2 -u2 1 -u2 0 -u3 6 -u3 5 +u8 5 +u8 4 +u8 3 +u8 2 +u8 1 +u9 7 +u9 6 statement ok DROP TABLE t CASCADE; @@ -54,7 +54,7 @@ statement ok SELECT mz_unsafe.mz_sleep(2) query I -SELECT COUNT(*) FROM mz_internal.mz_dataflow_globalids; +SELECT COUNT(*) FROM mz_internal.mz_dataflow_global_ids; ---- 0 @@ -79,19 +79,19 @@ statement ok SELECT mz_unsafe.mz_sleep(2) query IT -SELECT id, global_id FROM mz_internal.mz_dataflow_globalids ORDER BY id, global_id; +SELECT id, global_id FROM mz_internal.mz_dataflow_global_ids ORDER BY id, global_id; ---- -11 t53 +12 t57 query TI SELECT global_id, lir_id FROM mz_internal.mz_lir_mapping ORDER BY global_id, lir_id DESC; ---- -t53 4 -t53 3 -t53 2 -t53 1 -t53 0 +t57 5 +t57 4 +t57 3 +t57 2 +t57 1 statement ok @@ -102,7 +102,7 @@ statement ok SELECT mz_unsafe.mz_sleep(2) query I -SELECT COUNT(*) FROM mz_internal.mz_dataflow_globalids; +SELECT COUNT(*) FROM mz_internal.mz_dataflow_global_ids; ---- 0 diff --git a/test/sqllogictest/mz_catalog_server_index_accounting.slt b/test/sqllogictest/mz_catalog_server_index_accounting.slt index d584ff2e04a78..ea5e1ff16c220 100644 --- a/test/sqllogictest/mz_catalog_server_index_accounting.slt +++ b/test/sqllogictest/mz_catalog_server_index_accounting.slt @@ -48,14 +48,14 @@ mz_cluster_replicas_ind CREATE␠INDEX␠"mz_cluster_replicas_ind"␠IN␠CLUST mz_clusters_ind CREATE␠INDEX␠"mz_clusters_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s484␠AS␠"mz_catalog"."mz_clusters"]␠("id") mz_columns_ind CREATE␠INDEX␠"mz_columns_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s457␠AS␠"mz_catalog"."mz_columns"]␠("name") mz_comments_ind CREATE␠INDEX␠"mz_comments_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s507␠AS␠"mz_internal"."mz_comments"]␠("id") -mz_compute_dataflow_globalids_per_worker_s2_primary_idx CREATE␠INDEX␠"mz_compute_dataflow_globalids_per_worker_s2_primary_idx"␠IN␠CLUSTER␠[s2]␠ON␠"mz_introspection"."mz_compute_dataflow_globalids_per_worker"␠("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") mz_compute_dependencies_ind CREATE␠INDEX␠"mz_compute_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s700␠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_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") +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_connections_ind CREATE␠INDEX␠"mz_connections_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s488␠AS␠"mz_catalog"."mz_connections"]␠("schema_id") mz_console_cluster_utilization_overview_ind CREATE␠INDEX␠"mz_console_cluster_utilization_overview_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s704␠AS␠"mz_internal"."mz_console_cluster_utilization_overview"]␠("cluster_id") @@ -74,17 +74,17 @@ mz_message_batch_counts_received_raw_s2_primary_idx CREATE␠INDEX␠"mz_messag 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_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s776␠AS␠"mz_internal"."mz_notices"]␠("id") -mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s453␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") -mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s517␠AS␠"mz_internal"."mz_object_history"]␠("id") -mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s518␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") -mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s530␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") -mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s514␠AS␠"mz_catalog"."mz_objects"]␠("schema_id") +mz_notices_ind CREATE␠INDEX␠"mz_notices_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s780␠AS␠"mz_internal"."mz_notices"]␠("id") +mz_object_dependencies_ind CREATE␠INDEX␠"mz_object_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s454␠AS␠"mz_internal"."mz_object_dependencies"]␠("object_id") +mz_object_history_ind CREATE␠INDEX␠"mz_object_history_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s518␠AS␠"mz_internal"."mz_object_history"]␠("id") +mz_object_lifetimes_ind CREATE␠INDEX␠"mz_object_lifetimes_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s519␠AS␠"mz_internal"."mz_object_lifetimes"]␠("id") +mz_object_transitive_dependencies_ind CREATE␠INDEX␠"mz_object_transitive_dependencies_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s532␠AS␠"mz_internal"."mz_object_transitive_dependencies"]␠("object_id") +mz_objects_ind CREATE␠INDEX␠"mz_objects_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s515␠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␠[s676␠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␠[s672␠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␠[s768␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") -mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s476␠AS␠"mz_catalog"."mz_roles"]␠("id") +mz_recent_activity_log_thinned_ind CREATE␠INDEX␠"mz_recent_activity_log_thinned_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s678␠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␠[s674␠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␠[s772␠AS␠"mz_catalog"."mz_recent_storage_usage"]␠("object_id") +mz_roles_ind CREATE␠INDEX␠"mz_roles_ind"␠IN␠CLUSTER␠[s2]␠ON␠[s477␠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␠[s456␠AS␠"mz_catalog"."mz_schemas"]␠("database_id") @@ -275,9 +275,9 @@ mz_comments comment mz_comments id mz_comments object_sub_id mz_comments object_type -mz_compute_dataflow_globalids_per_worker global_id -mz_compute_dataflow_globalids_per_worker id -mz_compute_dataflow_globalids_per_worker worker_id +mz_compute_dataflow_global_ids_per_worker global_id +mz_compute_dataflow_global_ids_per_worker id +mz_compute_dataflow_global_ids_per_worker worker_id mz_compute_dependencies dependency_id mz_compute_dependencies object_id mz_compute_error_counts_raw count diff --git a/test/sqllogictest/oid.slt b/test/sqllogictest/oid.slt index 49921b855db17..79ab0a04aec60 100644 --- a/test/sqllogictest/oid.slt +++ b/test/sqllogictest/oid.slt @@ -1150,6 +1150,6 @@ SELECT oid, name FROM mz_objects WHERE id LIKE 's%' AND oid < 20000 ORDER BY oid 17042 mz_index_advice 17043 mz_show_network_policies 17044 mz_compute_lir_mapping_per_worker -17045 mz_compute_dataflow_globalids_per_worker +17045 mz_compute_dataflow_global_ids_per_worker 17046 mz_lir_mapping -17047 mz_dataflow_globalids +17047 mz_dataflow_global_ids diff --git a/test/testdrive/catalog.td b/test/testdrive/catalog.td index 11a000bcd28f5..044f37c5aa0bb 100644 --- a/test/testdrive/catalog.td +++ b/test/testdrive/catalog.td @@ -715,7 +715,7 @@ mz_arrangement_heap_capacity_raw log "" mz_arrangement_heap_size_raw log "" mz_arrangement_records_raw log "" mz_arrangement_sharing_raw log "" -mz_compute_dataflow_globalids_per_worker log "" +mz_compute_dataflow_global_ids_per_worker log "" mz_compute_error_counts_raw log "" mz_compute_exports_per_worker log "" mz_compute_frontiers_per_worker log "" @@ -756,7 +756,7 @@ mz_dataflow_arrangement_sizes "" mz_dataflow_channel_operators "" mz_dataflow_channel_operators_per_worker "" mz_dataflow_channels "" -mz_dataflow_globalids "" +mz_dataflow_global_ids "" mz_dataflow_operator_dataflows "" mz_dataflow_operator_dataflows_per_worker "" mz_dataflow_operator_parents "" diff --git a/test/testdrive/indexes.td b/test/testdrive/indexes.td index a5c688dc6a331..620c8a3de8d61 100644 --- a/test/testdrive/indexes.td +++ b/test/testdrive/indexes.td @@ -320,13 +320,13 @@ mz_clusters_ind mz_clusters mz_columns_ind mz_columns mz_catalog_server {name} "" mz_comments_ind mz_comments mz_catalog_server {id} "" mz_compute_dependencies_ind mz_compute_dependencies mz_catalog_server {dependency_id} "" -mz_compute_dataflow_globalids_per_worker_s2_primary_idx mz_compute_dataflow_globalids_per_worker mz_catalog_server {id} "" +mz_compute_dataflow_global_ids_per_worker_s2_primary_idx mz_compute_dataflow_global_ids_per_worker mz_catalog_server {id,worker_id} "" mz_compute_error_counts_raw_s2_primary_idx mz_compute_error_counts_raw mz_catalog_server {export_id,worker_id} "" mz_compute_exports_per_worker_s2_primary_idx mz_compute_exports_per_worker mz_catalog_server {export_id,worker_id} "" mz_compute_frontiers_per_worker_s2_primary_idx mz_compute_frontiers_per_worker mz_catalog_server {export_id,worker_id} "" mz_compute_hydration_times_per_worker_s2_primary_idx mz_compute_hydration_times_per_worker mz_catalog_server {export_id,worker_id} "" mz_compute_import_frontiers_per_worker_s2_primary_idx mz_compute_import_frontiers_per_worker mz_catalog_server {export_id,import_id,worker_id} "" -mz_compute_lir_mapping_per_worker_s2_primary_idx mz_compute_lir_mapping_per_worker mz_catalog_server {global_id,lir_id} "" +mz_compute_lir_mapping_per_worker_s2_primary_idx mz_compute_lir_mapping_per_worker mz_catalog_server {global_id,lir_id,worker_id} "" mz_compute_operator_durations_histogram_raw_s2_primary_idx mz_compute_operator_durations_histogram_raw mz_catalog_server {id,worker_id,duration_ns} "" mz_connections_ind mz_connections mz_catalog_server {schema_id} "" mz_console_cluster_utilization_overview_ind mz_console_cluster_utilization_overview mz_catalog_server {cluster_id} ""