diff --git a/scripts/duckdb-r2-prepare.sh b/scripts/duckdb-r2-prepare.sh index 35f4655c481..2d20558e4a0 100755 --- a/scripts/duckdb-r2-prepare.sh +++ b/scripts/duckdb-r2-prepare.sh @@ -32,7 +32,15 @@ else src_dir="duckdb-${REF_DIR}" extra="" if [ "$PLATFORM_OS" = "osx" ]; then + # httpfs is out-of-tree with vcpkg dependencies, and vcpkg can't build + # universal binaries. The S3 tests that need it only run on Linux. extra="OSX_BUILD_UNIVERSAL=1" + extensions="parquet;tpch;tpcds;icu" + else + make -C "$src_dir" setup-vcpkg + VCPKG_TOOLCHAIN_PATH="$PWD/${src_dir}/vcpkg/scripts/buildsystems/vcpkg.cmake" + export VCPKG_TOOLCHAIN_PATH + extensions="parquet;tpch;tpcds;icu;httpfs" fi make -C "$src_dir" \ @@ -42,7 +50,8 @@ else BUILD_SHELL=false \ BUILD_UNITTESTS=false \ ENABLE_UNITTEST_CPP_TESTS=false \ - BUILD_EXTENSIONS="parquet;tpch;tpcds" \ + BUILD_EXTENSIONS="$extensions" \ + LINK_CORE_EXTENSIONS=1 \ $extra lib_dir="${src_dir}/build/release/src" diff --git a/vortex-duckdb/build.rs b/vortex-duckdb/build.rs index 5630312e2ed..da3ebd0f9e1 100644 --- a/vortex-duckdb/build.rs +++ b/vortex-duckdb/build.rs @@ -23,21 +23,18 @@ const DUCKDB_RELEASES_URL: &str = "https://ci-builds.vortex.dev"; const DUCKDB_SOURCE_RELEASE_URL: &str = "https://github.com/duckdb/duckdb/archive/refs/tags"; const DUCKDB_SOURCE_COMMIT_URL: &str = "https://github.com/duckdb/duckdb/archive"; -const DEFAULT_DUCKDB_VERSION: &str = "1.5.5"; +const DEFAULT_DUCKDB_VERSION: &str = "8588363bf15e090fcbbfe2a68ec98b10c6866cb1"; const BUILD_ARTIFACTS: [&str; 3] = ["libduckdb.dylib", "libduckdb.so", "libduckdb_static.a"]; const BUILD_MARKER: &str = ".vx-build-complete"; const DUCKDB_CACHE_DIR: &str = "vortex-duckdb-cache"; const EXTRACT_MARKER: &str = ".vx-extract-complete"; -const SOURCE_FILES: [&str; 12] = [ +const SOURCE_FILES: [&str; 9] = [ "cpp/vortex_duckdb.cpp", "cpp/copy_function.cpp", "cpp/expr.cpp", - "cpp/optimizer.cpp", - "cpp/scalar_fn_pushdown.cpp", "cpp/spatial_overrides.cpp", - "cpp/cast_pushdown.cpp", "cpp/aggregate_fn_pushdown.cpp", "cpp/table_filter.cpp", "cpp/multi_file_reader.cpp", @@ -354,48 +351,6 @@ fn extract(archive: &Path, dest: &Path) { zip::ZipArchive::new(file).unwrap().extract(dest).unwrap(); } -fn git_apply(repo_dir: &Path, patch: &Path, args: &[&str]) -> bool { - let output = Command::new("git") - .current_dir(repo_dir) - .args(["apply", "-p1"]) - .args(args) - .arg(patch) - .output(); - match output { - Ok(out) => out.status.success(), - Err(e) => { - println!("cargo:error=git is required to patch DuckDB sources: {e}"); - exit(1); - } - } -} - -fn apply_source_patches(crate_dir: &Path, repo_dir: &Path) { - let mut patches: Vec = fs::read_dir(crate_dir.join("patches")) - .unwrap() - .map(|entry| entry.unwrap().path()) - .filter(|path| path.extension().is_some_and(|ext| ext == "diff")) - .collect(); - patches.sort(); - - for patch in patches { - // A successful reverse dry-run means the patch is already applied. - if git_apply(repo_dir, &patch, &["--check", "--reverse"]) { - continue; - } - if !git_apply(repo_dir, &patch, &[]) { - println!( - "cargo:error=Failed to apply {} to {}; delete that directory to re-extract \ - DuckDB sources", - patch.display(), - repo_dir.display() - ); - exit(1); - } - println!("cargo:info=Applied {}", patch.display()); - } -} - /// Download DuckDB library archive from R2 and extract it. /// Return false if archive is not available or download failed fn download_prebuilt(version: &DuckDBVersion, library_dir: &Path, target: &str) -> bool { @@ -447,12 +402,23 @@ fn build_duckdb(version: &DuckDBVersion, duckdb_repo_dir: &Path) { ("1", "0") }; - // If we're building from a commit we need to build benchmark - // extensions statically, otherwise DuckDB tries to load them from an http - // endpoint with version 0.0.1 (all non-tagged builds) which doesn't exist. - let static_extensions = match version { - DuckDBVersion::Release(_) => "parquet", - DuckDBVersion::Commit(_) => "parquet;tpch;tpcds", + // If we're building from a commit we need to build some extensions + // statically, otherwise DuckDB tries to load them from an http endpoint + // with version 0.0.1 (all non-tagged builds) which doesn't exist. + let (static_extensions, link_extensions) = match version { + DuckDBVersion::Release(_) => ("parquet", "0"), + // tpch/tpcds/parquet needed for benchmarks + // icu needed for timestamptz tests + // httpfs needed for s3 write test, but it has vcpkg dependencies + DuckDBVersion::Commit(_) if env::var_os("VCPKG_TOOLCHAIN_PATH").is_some() => { + ("parquet;tpch;tpcds;icu;httpfs", "1") + } + DuckDBVersion::Commit(_) => { + println!( + "cargo:warning=VCPKG_TOOLCHAIN_PATH is not set, building DuckDB without httpfs" + ); + ("parquet;tpch;tpcds;icu", "1") + } }; let envs = [ @@ -463,6 +429,7 @@ fn build_duckdb(version: &DuckDBVersion, duckdb_repo_dir: &Path) { ("BUILD_UNITTESTS", "false"), ("ENABLE_UNITTEST_CPP_TESTS", "false"), ("BUILD_EXTENSIONS", static_extensions), + ("LINK_CORE_EXTENSIONS", link_extensions), ]; let output = Command::new("make") @@ -590,7 +557,21 @@ fn compile_cpp(duckdb_include_dir: &Path) { .flag_if_supported("-fno-gnu-unique") // We don't want compiler warnings inside duckdb headers, pass as flags .flag("-isystem") - .flag(duckdb_include_dir) + .flag(duckdb_include_dir); + + if let Some(root) = duckdb_include_dir.parent().and_then(Path::parent) { + let third_party = root.join("third_party"); + if let Ok(entries) = fs::read_dir(&third_party) { + for entry in entries.flatten() { + let include = entry.path().join("include"); + if include.is_dir() { + build.flag("-isystem").flag(include); + } + } + } + } + + build .include("include") .include("cpp/include") .files(SOURCE_FILES) @@ -658,7 +639,6 @@ fn vortex_version(crate_dir: &Path) { fn main() { println!("cargo:rerun-if-changed=cpp/include"); - println!("cargo:rerun-if-changed=patches"); println!("cargo:rerun-if-env-changed=VX_DUCKDB_DEBUG"); println!("cargo:rerun-if-env-changed=VX_DUCKDB_SAN"); println!("cargo:rerun-if-env-changed=DEBUG"); @@ -672,6 +652,7 @@ fn main() { // duckdb if they are present println!("cargo:rerun-if-env-changed=DUCKDB_SOURCE_DIR"); println!("cargo:rerun-if-env-changed=DUCKDB_VERSION"); + println!("cargo:rerun-if-env-changed=VCPKG_TOOLCHAIN_PATH"); // sanity check that either none or both are provided assert_eq!( @@ -690,7 +671,6 @@ fn main() { "cargo:info=Using DuckDB source from DUCKDB_SOURCE_DIR={}", source_dir.display() ); - apply_source_patches(&crate_dir, &source_dir); bindgen_c2rust(&crate_dir, &duckdb_include_dir); cbindgen_rust2c(&crate_dir); compile_cpp(&duckdb_include_dir); @@ -742,8 +722,6 @@ fn main() { fs::write(&extract_marker, version.to_string()).unwrap(); } - apply_source_patches(&crate_dir, &inner_dir); - drop(fs::remove_file(&duckdb_dir)); drop(fs::remove_dir_all(&duckdb_dir)); symlink(&source_dir, &duckdb_dir).unwrap(); diff --git a/vortex-duckdb/cpp/CMakeLists.txt b/vortex-duckdb/cpp/CMakeLists.txt index c9b91fa5893..8643ce9901c 100644 --- a/vortex-duckdb/cpp/CMakeLists.txt +++ b/vortex-duckdb/cpp/CMakeLists.txt @@ -40,6 +40,11 @@ endif() include_directories(include ../include) include_directories(SYSTEM ${DUCKDB_INCLUDE}) +file(GLOB DUCKDB_THIRD_PARTY_INCLUDES "${DUCKDB_DIR}/third_party/*/include") +foreach(THIRD_PARTY_INCLUDE ${DUCKDB_THIRD_PARTY_INCLUDES}) + include_directories(SYSTEM ${THIRD_PARTY_INCLUDE}) +endforeach() + # Auto-discover C++ source files file(GLOB CPP_SOURCES "*.cpp") add_library(vortex ${CPP_SOURCES}) diff --git a/vortex-duckdb/cpp/aggregate_fn_pushdown.cpp b/vortex-duckdb/cpp/aggregate_fn_pushdown.cpp index 4163c4db898..ab39dadb0ea 100644 --- a/vortex-duckdb/cpp/aggregate_fn_pushdown.cpp +++ b/vortex-duckdb/cpp/aggregate_fn_pushdown.cpp @@ -4,7 +4,6 @@ #include "duckdb/planner/expression/bound_aggregate_expression.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" #include "duckdb/planner/operator/logical_aggregate.hpp" -#include "optimizer.hpp" #include "table_function.hpp" using enum LogicalOperatorType; @@ -37,8 +36,6 @@ static bool IsUngrouped(const LogicalAggregate &agg) { !agg.expressions.empty(); } -constexpr inline idx_t COUNT_STAR_PROJ_IDX = std::numeric_limits::max(); - LogicalOperatorPtr TryReplaceAggregate(ClientContext &context, LogicalOperatorPtr op, Analyses &analyses, @@ -53,7 +50,7 @@ LogicalOperatorPtr TryReplaceAggregate(ClientContext &context, return op; } - vector> input; + vector> input; const idx_t aggregates_len = agg.expressions.size(); input.reserve(aggregates_len); @@ -62,21 +59,22 @@ LogicalOperatorPtr TryReplaceAggregate(ClientContext &context, return op; } const auto &bound_aggr = expr->Cast(); - if (bound_aggr.IsDistinct() || bound_aggr.filter != nullptr || bound_aggr.order_bys != nullptr) { + if (bound_aggr.IsDistinct() || bound_aggr.GetFilter() != nullptr || + bound_aggr.GetOrderBys() != nullptr) { return op; } - if (bound_aggr.function.name == "count_star") { + if (bound_aggr.Function().GetName() == "count_star") { input.emplace_back(COUNT_STAR_PROJ_IDX, *expr); continue; } - if (bound_aggr.children.size() != 1 || - bound_aggr.children[0]->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { + if (bound_aggr.GetChildren().size() != 1 || + bound_aggr.GetChildren()[0]->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { return op; } - const auto &bound_col = bound_aggr.children[0]->Cast(); - const auto binding = Resolve(bound_col.binding, analyses, projections); + const auto &bound_col = bound_aggr.GetChildren()[0]->Cast(); + const auto binding = Resolve(bound_col.Binding(), analyses, projections); if (!binding || &binding->analysis.get != get) { return op; } @@ -87,28 +85,24 @@ LogicalOperatorPtr TryReplaceAggregate(ClientContext &context, return op; } - vector names(aggregates_len); // need a copy because we reference original names + // GET now returns one column per aggregate. Expand existing columns + auto &column_ids = get->GetMutableColumnIds(); + get->types.resize(aggregates_len); + get->returned_types.resize(aggregates_len); + column_ids.resize(aggregates_len); + + vector names(aggregates_len); // need a copy because we reference original names - const vector original_column_ids = get->GetColumnIds(); for (idx_t i = 0; i < aggregates_len; i++) { const auto &[column_index, expr] = input[i]; if (column_index == COUNT_STAR_PROJ_IDX) { names[i] = "count_star()"; } else { - const TableColumnStorageIndex storage_index = original_column_ids[column_index].GetPrimaryIndex(); + const idx_t storage_index = get->GetColumnIds()[column_index].GetPrimaryIndex(); names[i] = get->names[storage_index]; } - } - - // GET now returns one column per aggregate. - auto &column_ids = get->GetMutableColumnIds(); - get->types.resize(aggregates_len); - get->returned_types.resize(aggregates_len); - column_ids.resize(aggregates_len); - for (idx_t i = 0; i < aggregates_len; i++) { - const auto &[_, expr] = input[i]; - get->types[i] = expr.return_type; - get->returned_types[i] = expr.return_type; + get->types[i] = expr.GetReturnType(); + get->returned_types[i] = expr.GetReturnType(); column_ids[i] = ColumnIndex {i}; } get->names = std::move(names); diff --git a/vortex-duckdb/cpp/cast_pushdown.cpp b/vortex-duckdb/cpp/cast_pushdown.cpp deleted file mode 100644 index d1a3b849c00..00000000000 --- a/vortex-duckdb/cpp/cast_pushdown.cpp +++ /dev/null @@ -1,178 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#include "cast_pushdown.hpp" -#include "table_function.hpp" - -#include "duckdb/planner/operator/logical_get.hpp" -#include "duckdb/planner/operator/logical_projection.hpp" -#include "duckdb/planner/expression/bound_cast_expression.hpp" -#include "duckdb/planner/expression/bound_columnref_expression.hpp" - -/** - * A GET reachable through a single-child chain of projections. A join or any - * other multi-child operator breaks the chain. - * - * LOGICAL_FILTER also breaks the chain. In SELECT CAST/TRY_CAST(x) WHERE g(x) - * we can't push down cast if g(x) isn't pushed. If g(x) filters some rows - * on which cast would fail, the query passed by default but fails if cast is pushed - * and runs before g(x). - * - * See test/sql/copy/csv/test_insert_into_types.test in duckdb (cast not pushed past a join) - */ -static bool ReachesPushdownGet(const LogicalOperator &op) { - const LogicalOperator *cur = &op; - while (cur->children.size() == 1) { - cur = cur->children[0].get(); - switch (cur->type) { - case LogicalOperatorType::LOGICAL_GET: - return is_vortex_scan(cur->Cast().function); - case LogicalOperatorType::LOGICAL_PROJECTION: - continue; - default: - return false; - } - } - return false; -} - -void CastCollect::VisitOperator(LogicalOperator &op) { - /* - * Logical projection expressions are columns which reference underlying - * GETs. Don't process them, as they would add conflicts for every column - * used in projection. Example: PROJECTION(col) -> GET(col). We don't want - * to visit BoundColumnRefExpression in PROJECTION to avoid registering a - * non-existent conflict. - * - * However, CastReplace will visit them because we need to update their - * types if pushdown succeeded. - */ - if (op.type != LogicalOperatorType::LOGICAL_PROJECTION) { - return LogicalOperatorVisitor::VisitOperator(op); - } - auto &projection = op.Cast(); - - // Only push casts from a projection that forwards just column refs and - // casts and reaches a GET without a join in between. A constant or other - // expression makes the projection ineligible. - // See test/sql/copy/csv/test_csv_error_message_type.test (top-level cast - // to VARCHAR must still push) and test_large_integer_detection.test (a - // nested cast to VARCHAR must not) in duckdb. - bool clean = ReachesPushdownGet(projection); - for (const auto &e : projection.expressions) { - switch (e->GetExpressionClass()) { - case ExpressionClass::BOUND_COLUMN_REF: - case ExpressionClass::BOUND_CAST: - continue; - default: - clean = false; - break; - } - } - if (clean) { - for (const auto &e : projection.expressions) { - if (e->GetExpressionClass() == ExpressionClass::BOUND_CAST) { - top_level_casts.insert(e.get()); - } - } - } - if (projections.count(projection.table_index)) { - VisitOperatorChildren(op); - return; - } - - LogicalOperatorVisitor::VisitOperator(op); -} - -ExpressionPtr CastCollect::VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) { - if (const auto binding = Resolve(expr.binding, analyses, projections)) { - // Column is used without cast applied to it, register a conflict. - // Not emplace() as we need to update the value if it was present - binding->analysis.col_to_expr[binding->column_index] = nullptr; - } - return std::move(*ptr); -} - -ExpressionPtr CastCollect::VisitReplace(BoundCastExpression &expr, ExpressionPtr *ptr) { - if (expr.child->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - // Descend into children so e.g. fn(col, other) still sees "col" and - // registers a conflict - return nullptr; - } - const auto &bound_col = expr.child->Cast(); - const auto binding = Resolve(bound_col.binding, analyses, projections); - if (!binding) { - return nullptr; - } - auto &col_to_expr = binding->analysis.col_to_expr; - - if (auto it = col_to_expr.find(binding->column_index); it == col_to_expr.end()) { - // Only a top-level projection cast starts a candidate. - if (top_level_casts.count(&expr)) { - col_to_expr.emplace(binding->column_index, &expr); - } - } else if (it->second == nullptr || - it->second->Cast().return_type != expr.return_type || - // TODO(myrrc) this line needs upstreaming - it->second->Cast().try_cast != expr.try_cast) { - // Different target type, or already a conflict. - it->second = nullptr; - } - - return std::move(*ptr); -} - -ExpressionPtr CastReplace::VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) { - const auto binding = Resolve(expr.binding, analyses, projections); - if (!binding) { - return std::move(*ptr); - } - - const auto &[analysis, column_index, projection] = *binding; - if (CanPushdownColumn(analysis, column_index)) { - const idx_t storage_index = analysis.get.GetColumnIds()[column_index].GetPrimaryIndex(); - const LogicalType return_type = analysis.get.returned_types[storage_index]; - expr.return_type = return_type; - // LogicalProjection types are resolved by calling - // LogicalProjection::ResolveTypes, so we need to check whether types in - // projection have been resolved, and updated them only if needed. - if (projection != nullptr && !projection->types.empty()) { - projection->types[column_index] = return_type; - } - } - - return std::move(*ptr); -} - -ExpressionPtr CastReplace::VisitReplace(BoundCastExpression &expr, ExpressionPtr *ptr) { - if (expr.child->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - return nullptr; // Same as in ScalarFnCollect::VisitReplace - } - auto &bound_col_base = expr.child; - const auto &bound_col = bound_col_base->Cast(); - const auto binding = Resolve(bound_col.binding, analyses, projections); - if (!binding) { - return nullptr; - } - - const auto &[analysis, column_index, projection] = *binding; - if (!CanPushdownColumn(analysis, column_index)) { - return std::move(*ptr); - } - - const idx_t storage_index = analysis.get.GetColumnIds()[column_index].GetPrimaryIndex(); - const LogicalType return_type = analysis.get.returned_types[storage_index]; - bound_col_base->return_type = return_type; - // Same as in CastReplace::VisitReplace(BoundColumnRefExpression) - if (projection != nullptr && !projection->types.empty()) { - projection->types[column_index] = return_type; - } - return std::move(bound_col_base); -} - -CastCollect::CastCollect(Analyses &analyses, const Projections &projections) - : analyses(analyses), projections(projections) { -} - -CastReplace::CastReplace(Analyses &analyses, const Projections &projections) - : analyses(analyses), projections(projections) { -} diff --git a/vortex-duckdb/cpp/copy_function.cpp b/vortex-duckdb/cpp/copy_function.cpp index 840d159f266..90e17192377 100644 --- a/vortex-duckdb/cpp/copy_function.cpp +++ b/vortex-duckdb/cpp/copy_function.cpp @@ -7,7 +7,9 @@ #include "vortex_duckdb.h" #include "table_function.h" #include "vortex.h" +#include "duckdb/catalog/catalog.hpp" #include "duckdb/common/types/column/column_data_collection.hpp" +#include "duckdb/logging/logger.hpp" #include "duckdb/main/capi/capi_internal.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/connection.hpp" @@ -16,7 +18,7 @@ unique_ptr copy_to_bind(ClientContext &, CopyFunctionBindInput &, - const vector &names, + const vector &names, const vector &types) { vector ffi_names(names.size()); for (size_t i = 0; i < names.size(); ++i) { @@ -89,6 +91,7 @@ void copy_to_get_written_statistics(ClientContext &, void copy_to_finalize(ClientContext &, FunctionData &bind_data, GlobalFunctionData &gstate) { auto &global = gstate.Cast(); void *const ffi_global = global.ffi_global->DataPtr(); + duckdb_vx_error error_out = nullptr; duckdb_copy_function_copy_to_finalize(ffi_global, &error_out); if (error_out) { @@ -98,11 +101,9 @@ void copy_to_finalize(ClientContext &, FunctionData &bind_data, GlobalFunctionDa if (!global.written_stats) { return; } - auto &names = bind_data.Cast().column_names; + const auto &names = bind_data.Cast().column_names; duckdb_vx_written_file_statistics file_stats; if (!duckdb_copy_function_get_written_file_statistics(ffi_global, &file_stats)) { - // Statistics were requested (written_stats is set) but the finished write produced none; - // that is an internal inconsistency, not a silently empty result. throw InternalException("vortex COPY: written statistics were requested but not produced"); } if (file_stats.num_columns != names.size()) { @@ -145,10 +146,9 @@ void copy_to_finalize(ClientContext &, FunctionData &bind_data, GlobalFunctionDa if (col_stats.has_nan_stat) { column["has_nan"] = Value::BOOLEAN(col_stats.contains_nan); } - // DuckLake keys column statistics by a quoted, dot-separated path (see - // DuckLakeUtil::ParseQuotedList); match the parquet writer, which quotes each name. - global.written_stats->column_statistics.emplace(KeywordHelper::WriteQuoted(names[i], '"'), - std::move(column)); + + string quoted = SQLQuotedIdentifier::ToString(names[i]); + global.written_stats->column_statistics.emplace(std::move(quoted), std::move(column)); } } diff --git a/vortex-duckdb/cpp/expr.cpp b/vortex-duckdb/cpp/expr.cpp index 54ef37cd959..b4e2660fe97 100644 --- a/vortex-duckdb/cpp/expr.cpp +++ b/vortex-duckdb/cpp/expr.cpp @@ -4,15 +4,16 @@ #include "expr.h" #include "duckdb/function/scalar_function.hpp" #include "duckdb/function/aggregate_function.hpp" +#include "duckdb/planner/filter/table_filter_functions.hpp" +#include "duckdb/planner/expression/bound_aggregate_expression.hpp" #include "duckdb/planner/expression/bound_between_expression.hpp" #include "duckdb/planner/expression/bound_cast_expression.hpp" #include "duckdb/planner/expression/bound_columnref_expression.hpp" #include "duckdb/planner/expression/bound_comparison_expression.hpp" +#include "duckdb/planner/expression/bound_conjunction_expression.hpp" #include "duckdb/planner/expression/bound_constant_expression.hpp" -#include "duckdb/planner/expression/bound_aggregate_expression.hpp" #include "duckdb/planner/expression/bound_function_expression.hpp" #include "duckdb/planner/expression/bound_operator_expression.hpp" -#include "duckdb/planner/expression/bound_conjunction_expression.hpp" using namespace duckdb; @@ -20,13 +21,13 @@ extern "C" const char *duckdb_vx_sfunc_name(duckdb_vx_sfunc ffi_func) { if (!ffi_func) { return nullptr; } - auto func = reinterpret_cast(ffi_func); - return func->name.c_str(); + auto func = reinterpret_cast(ffi_func); + return func->GetName().GetIdentifierName().c_str(); } extern "C" const char *duckdb_vx_agg_func_name(duckdb_vx_agg_func ffi) { D_ASSERT(ffi); - return reinterpret_cast(ffi)->name.c_str(); + return reinterpret_cast(ffi)->GetName().GetIdentifierName().c_str(); } extern "C" const char *duckdb_vx_expr_to_string(duckdb_vx_expr ffi_expr) { @@ -57,7 +58,7 @@ extern "C" duckdb_vx_expr_class duckdb_vx_expr_get_class(duckdb_vx_expr ffi_expr extern "C" duckdb_logical_type duckdb_vx_expr_get_return_type(duckdb_vx_expr ffi_expr) { D_ASSERT(ffi_expr); auto expr = reinterpret_cast(ffi_expr); - return reinterpret_cast(&expr->return_type); + return reinterpret_cast(const_cast(&expr->GetReturnType())); } extern "C" const char *duckdb_vx_expr_get_bound_column_ref_get_name(duckdb_vx_expr ffi_expr) { @@ -76,7 +77,7 @@ extern "C" duckdb_value duckdb_vx_expr_bound_constant_get_value(duckdb_vx_expr f return nullptr; } auto &expr = reinterpret_cast(ffi_expr)->Cast(); - return reinterpret_cast(&expr.value); + return reinterpret_cast(const_cast(&expr.GetValue())); } extern "C" void duckdb_vx_expr_get_bound_comparison(duckdb_vx_expr ffi_expr, @@ -84,10 +85,47 @@ extern "C" void duckdb_vx_expr_get_bound_comparison(duckdb_vx_expr ffi_expr, if (!ffi_expr || !out) { return; } - auto &expr = reinterpret_cast(ffi_expr)->Cast(); - out->left = reinterpret_cast(expr.left.get()); - out->right = reinterpret_cast(expr.right.get()); - out->type = static_cast(expr.type); + auto &expr = reinterpret_cast(ffi_expr)->Cast(); + out->left = reinterpret_cast(BoundComparisonExpression::LeftMutable(expr).get()); + out->right = reinterpret_cast(BoundComparisonExpression::RightMutable(expr).get()); + out->type = static_cast(expr.GetExpressionType()); +} + +extern "C" duckdb_vx_expr duckdb_vx_expr_get_bound_optional(duckdb_vx_expr ffi) { + D_ASSERT(ffi); + auto &expr = reinterpret_cast(ffi)->Cast(); + const Identifier &name = expr.Function().GetName(); + // In DuckDB an optional filter may have no bind info. + // See optimizer/expression_heuristics.cpp as an example. + if (!expr.BindInfo()) { + return nullptr; + } + if (name == OptionalFilterScalarFun::NAME) { + auto &data = expr.BindInfo()->Cast(); + return reinterpret_cast(data.child_filter_expr.get()); + } + if (name == SelectivityOptionalFilterScalarFun::NAME) { + auto &data = expr.BindInfo()->Cast(); + return reinterpret_cast(data.child_filter_expr.get()); + } + return nullptr; +} + +extern "C" bool duckdb_vx_expr_is_comparison(duckdb_vx_expr ffi_expr) { + D_ASSERT(ffi_expr); + return BoundComparisonExpression::IsComparison(*reinterpret_cast(ffi_expr)); +} + +extern "C" bool duckdb_vx_expr_is_between(duckdb_vx_expr ffi_expr) { + D_ASSERT(ffi_expr); + auto expr = reinterpret_cast(ffi_expr); + return expr->GetExpressionClass() == ExpressionClass::BOUND_FUNCTION && + expr->GetExpressionType() == ExpressionType::COMPARE_BETWEEN; +} + +extern "C" bool duckdb_vx_expr_is_cast(duckdb_vx_expr ffi_expr) { + D_ASSERT(ffi_expr); + return BoundCastExpression::IsCast(*reinterpret_cast(ffi_expr)); } extern "C" void duckdb_vx_expr_get_bound_conjunction(duckdb_vx_expr ffi_expr, @@ -97,21 +135,21 @@ extern "C" void duckdb_vx_expr_get_bound_conjunction(duckdb_vx_expr ffi_expr, } auto &expr = reinterpret_cast(ffi_expr)->Cast(); - out->children_count = expr.children.size(); - out->children = reinterpret_cast(expr.children.data()); - out->type = static_cast(expr.type); + out->children_count = expr.GetChildrenMutable().size(); + out->children = reinterpret_cast(expr.GetChildrenMutable().data()); + out->type = static_cast(expr.GetExpressionType()); } extern "C" void duckdb_vx_expr_get_bound_between(duckdb_vx_expr ffi_expr, duckdb_vx_expr_bound_between *out) { if (!ffi_expr || !out) { return; } - auto &expr = reinterpret_cast(ffi_expr)->Cast(); - out->input = reinterpret_cast(expr.input.get()); - out->lower = reinterpret_cast(expr.lower.get()); - out->upper = reinterpret_cast(expr.upper.get()); - out->lower_inclusive = expr.lower_inclusive; - out->upper_inclusive = expr.upper_inclusive; + auto &expr = reinterpret_cast(ffi_expr)->Cast(); + out->input = reinterpret_cast(BoundBetweenExpression::InputMutable(expr).get()); + out->lower = reinterpret_cast(BoundBetweenExpression::LowerBoundMutable(expr).get()); + out->upper = reinterpret_cast(BoundBetweenExpression::UpperBoundMutable(expr).get()); + out->lower_inclusive = BoundBetweenExpression::LowerInclusive(expr); + out->upper_inclusive = BoundBetweenExpression::UpperInclusive(expr); } extern "C" void duckdb_vx_expr_get_bound_operator(duckdb_vx_expr ffi_expr, @@ -120,9 +158,9 @@ extern "C" void duckdb_vx_expr_get_bound_operator(duckdb_vx_expr ffi_expr, return; } auto &expr = reinterpret_cast(ffi_expr)->Cast(); - out->children_count = expr.children.size(); - out->children = reinterpret_cast(expr.children.data()); - out->type = static_cast(expr.type); + out->children_count = expr.GetChildrenMutable().size(); + out->children = reinterpret_cast(expr.GetChildrenMutable().data()); + out->type = static_cast(expr.GetExpressionType()); } extern "C" void duckdb_vx_expr_get_bound_function(duckdb_vx_expr ffi_expr, @@ -131,26 +169,26 @@ extern "C" void duckdb_vx_expr_get_bound_function(duckdb_vx_expr ffi_expr, return; } auto &expr = reinterpret_cast(ffi_expr)->Cast(); - out->children_count = expr.children.size(); - out->children = reinterpret_cast(expr.children.data()); - out->scalar_function = reinterpret_cast(&expr.function); - out->bind_info = expr.bind_info.get(); + out->children_count = expr.GetChildrenMutable().size(); + out->children = reinterpret_cast(expr.GetChildrenMutable().data()); + out->scalar_function = reinterpret_cast(&expr.FunctionMutable()); + out->bind_info = expr.BindInfoMutable().get(); } extern "C" duckdb_vx_expr duckdb_vx_expr_get_bound_cast_child(duckdb_vx_expr ffi_expr) { D_ASSERT(ffi_expr); - auto &expr = reinterpret_cast(ffi_expr)->Cast(); - return reinterpret_cast(expr.child.get()); + auto &expr = reinterpret_cast(ffi_expr)->Cast(); + return reinterpret_cast(BoundCastExpression::ChildMutable(expr).get()); } extern "C" bool duckdb_vx_expr_get_bound_cast_is_try(duckdb_vx_expr ffi_expr) { D_ASSERT(ffi_expr); - auto &expr = reinterpret_cast(ffi_expr)->Cast(); - return expr.try_cast; + auto &expr = reinterpret_cast(ffi_expr)->Cast(); + return BoundCastExpression::IsTryCast(expr); } extern "C" duckdb_vx_agg_func duckdb_vx_expr_get_bound_aggregate_function(duckdb_vx_expr ffi_expr) { D_ASSERT(ffi_expr); auto &expr = reinterpret_cast(ffi_expr)->Cast(); - return reinterpret_cast(&expr.function); + return reinterpret_cast(&expr.FunctionMutable()); } diff --git a/vortex-duckdb/cpp/include/aggregate_fn_pushdown.hpp b/vortex-duckdb/cpp/include/aggregate_fn_pushdown.hpp index 4deb716b7a5..f9c0ae12688 100644 --- a/vortex-duckdb/cpp/include/aggregate_fn_pushdown.hpp +++ b/vortex-duckdb/cpp/include/aggregate_fn_pushdown.hpp @@ -1,11 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors #pragma once -#include "optimizer.hpp" #include "duckdb/optimizer/optimizer_extension.hpp" +#include "duckdb/optimizer/type_pushdown.hpp" using namespace duckdb; +using LogicalOperatorPtr = unique_ptr; + // Push UNGROUPED_AGGREGATE's of form agg(T) and count_star() into GET. LogicalOperatorPtr TryPushdownAggregateFunctions(ClientContext &context, LogicalOperatorPtr plan); diff --git a/vortex-duckdb/cpp/include/cast_pushdown.hpp b/vortex-duckdb/cpp/include/cast_pushdown.hpp deleted file mode 100644 index f64e9da8b00..00000000000 --- a/vortex-duckdb/cpp/include/cast_pushdown.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#pragma once -#include "optimizer.hpp" - -#include "duckdb/common/unordered_set.hpp" -#include "duckdb/main/client_context.hpp" -#include "duckdb/planner/expression.hpp" -#include "duckdb/planner/logical_operator.hpp" - -using namespace duckdb; - -/** - * Collect CAST(col) expressions. If "col" is used without CAST in "plan", - * record in "analyses.col_to_expr" - */ -struct CastCollect final : LogicalOperatorVisitor { - Analyses &analyses; - const Projections &projections; - // Casts that are direct outputs of a clean projection over a GET. Only these - // start a pushdown candidate; a nested cast may push down a different value. - // See test/sql/copy/csv/auto/test_large_integer_detection.test in duckdb - unordered_set top_level_casts; - - CastCollect(Analyses &analyses, const Projections &projections); - void VisitOperator(LogicalOperator &op) override; - ExpressionPtr VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) override; - ExpressionPtr VisitReplace(BoundCastExpression &expr, ExpressionPtr *ptr) override; -}; - -/* - * For "col" in columns collected by CastCollect, replace CAST(col) to "col" - * if "col" doesn't have conflicting usage. Update return types for bound - * columns and logical projections referencing this column. - */ -struct CastReplace final : LogicalOperatorVisitor { - Analyses &analyses; - const Projections &projections; - - CastReplace(Analyses &analyses, const Projections &projections); - ExpressionPtr VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) override; - ExpressionPtr VisitReplace(BoundCastExpression &expr, ExpressionPtr *ptr) override; -}; diff --git a/vortex-duckdb/cpp/include/copy_function.hpp b/vortex-duckdb/cpp/include/copy_function.hpp index ec8cccd7048..0dc432d5ad3 100644 --- a/vortex-duckdb/cpp/include/copy_function.hpp +++ b/vortex-duckdb/cpp/include/copy_function.hpp @@ -8,12 +8,11 @@ using namespace duckdb; struct VortexCopyBindData final : TableFunctionData { - VortexCopyBindData(unique_ptr ffi_bind, vector column_names) + VortexCopyBindData(unique_ptr ffi_bind, vector column_names) : ffi_bind(std::move(ffi_bind)), column_names(std::move(column_names)) { } unique_ptr ffi_bind; - // Column names in write order, used to key WRITTEN_FILE_STATISTICS. - vector column_names; + vector column_names; }; struct VortexCopyGlobalState final : GlobalFunctionData { diff --git a/vortex-duckdb/cpp/include/expr.h b/vortex-duckdb/cpp/include/expr.h index 704c8406c90..aad479ba06c 100644 --- a/vortex-duckdb/cpp/include/expr.h +++ b/vortex-duckdb/cpp/include/expr.h @@ -231,6 +231,11 @@ typedef struct { } duckdb_vx_expr_bound_comparison; void duckdb_vx_expr_get_bound_comparison(duckdb_vx_expr expr, duckdb_vx_expr_bound_comparison *out); +duckdb_vx_expr duckdb_vx_expr_get_bound_optional(duckdb_vx_expr ffi); + +bool duckdb_vx_expr_is_comparison(duckdb_vx_expr expr); +bool duckdb_vx_expr_is_between(duckdb_vx_expr expr); +bool duckdb_vx_expr_is_cast(duckdb_vx_expr expr); typedef struct { duckdb_vx_expr *children; diff --git a/vortex-duckdb/cpp/include/multi_file_reader.hpp b/vortex-duckdb/cpp/include/multi_file_reader.hpp index 6a62bfbf25c..03d5df86b11 100644 --- a/vortex-duckdb/cpp/include/multi_file_reader.hpp +++ b/vortex-duckdb/cpp/include/multi_file_reader.hpp @@ -21,7 +21,7 @@ struct VortexBindData final : TableFunctionData { struct VortexBindResult { vector &return_types; - vector &names; + vector &names; }; struct VortexGlobalState final : GlobalTableFunctionState { @@ -84,16 +84,16 @@ struct VortexReaderInterface final : MultiFileReaderInterface { } inline bool ParseCopyOption(ClientContext &, - const string &, + const Identifier &, const vector &, BaseFileReaderOptions &, - vector &, + vector &, vector &) override { return false; }; inline bool ParseOption(ClientContext &, - const string &, + const Identifier &, const Value &, MultiFileOptions &, BaseFileReaderOptions &) override { @@ -107,14 +107,14 @@ struct VortexReaderInterface final : MultiFileReaderInterface { void BindReader(ClientContext &context, vector &types, - vector &names, + vector &names, MultiFileBindData &bind_data) override; unique_ptr InitializeGlobalState(ClientContext &context, MultiFileBindData &bind_data, MultiFileGlobalState &global_state) override; - unique_ptr InitializeLocalState(ExecutionContext &context, + unique_ptr InitializeLocalState(ClientContext &context, GlobalTableFunctionState &global_state) override; inline shared_ptr CreateReader(ClientContext &, @@ -188,7 +188,7 @@ struct VortexBaseReader final : BaseFileReader { double GetProgressInFile(ClientContext &) override; // Called on first file in scan after BindReader() has been called on it - unique_ptr GetStatistics(ClientContext &context, const string &name) override; + unique_ptr GetStatistics(ClientContext &context, const Identifier &name) override; inline string GetReaderType() const override { return "Vortex"; diff --git a/vortex-duckdb/cpp/include/optimizer.hpp b/vortex-duckdb/cpp/include/optimizer.hpp deleted file mode 100644 index acb797928f6..00000000000 --- a/vortex-duckdb/cpp/include/optimizer.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#pragma once -#include "table_function.hpp" - -#include "duckdb/planner/expression.hpp" -#include "duckdb/planner/operator/logical_get.hpp" - -#include - -// Aliases here are for ease of migration to duckdb 2.0 where these are -// separate types - -using namespace duckdb; - -/** - * Column index in requested scan. Example: - * - * CREATE TABLE t (a1 INTEGER, a2 INTEGER, a3 INTEGER); - * SELECT a2, a3 FROM t; - * - * a2's TableColumnScanIndex is 0, a3's TableColumnScanIndex is 1, - * index is index in SELECT clause. - */ -using TableColumnScanIndex = idx_t; -using ProjectionIndex = TableColumnScanIndex; - -/** - * Column index in table's storage. Example: - * - * CREATE TABLE t (a1 INTEGER, a2 INTEGER, a3 INTEGER); - * SELECT a2, a3 FROM t; - * - * a2's TableColumnStorageIndex is 1, a3's TableColumnStorageIndex is 2, - * index is index of column in table storage. - * - * for i: TableColumnScanIndex, column_ids[i].GetPrimaryIndex() is - * TableColumnStorageIndex - */ -using TableColumnStorageIndex = idx_t; - -using TableIndex = idx_t; - -using ExpressionPtr = unique_ptr; -using LogicalOperatorPtr = unique_ptr; - -struct GetAnalysis { - LogicalGet &get; - /** - * for fn(col), mapping of "col scan index" -> "expression applied to function". - * "expression" is nullptr iff column is used with a different expression - * or without expression application in the query plan (i.e. SELECT col). - */ - unordered_map col_to_expr; - - TableColumnStorageIndex StorageIndex(TableColumnScanIndex idx) const; -}; - -using Analyses = unordered_map; - -/* - * Using scalar function pushdown as a specific example, - * SELECT fn(col) FROM '*.vortex' yields a PROJECTION fn(col) -> GET (vortex) - * plan. PROJECTION's "col" table_index is 1, vortex GET's table_index is 0. - * So we want to track original table_index for GET in case column is found - * in filter we failed to push down (i.e. WHERE prefix(col, 'h')) as well as - * projection's table_index. - * - * So we keep a mapping of - * - * "projection table index" to "projection operator". - * - * to resolve this. - * For simplicity, current implementation is limited to one level i.e. - * PROJECTION -> GET (i.e. read from VIEW) is pushed down but VIEW->VIEW->GET - * or VIEW->CTE->GET is not. - * - * Storing a reference is fine because the plan outlives the optimizer pass. - */ -using Projections = unordered_map; - -void FindGetsAndProjections(LogicalOperator &op, Analyses &analyses, Projections &aliases); - -struct GetBinding { - GetAnalysis &analysis; - TableColumnScanIndex column_index; - // If column binding was part of a projection, this is non-nullptr - LogicalProjection *projection; -}; - -/* - * Given a column binding, resolve it to a GET and a GET's column scan index. - * Returns nullopt for virtual columns and columns which are neither part of - * GET nor part of PROJECTION wrapping a GET. - */ -std::optional Resolve(ColumnBinding binding, Analyses &analyses, const Projections &projections); - -// A passthrough projection only forwards its child columns, e.g. a VIEW's -// "SELECT col". -bool IsPassthrough(const LogicalProjection &projection); - -// There are no conflicting column usages in the plan -bool CanPushdownColumn(const GetAnalysis &analysis, TableColumnScanIndex idx); - -template -LogicalOperatorPtr TryPushdown(ClientContext &context, LogicalOperatorPtr plan) { - Analyses analyses; - Projections projections; - FindGetsAndProjections(*plan, analyses, projections); - if (analyses.empty()) { - return plan; - } - Collect(analyses, projections).VisitOperator(*plan); - - bool any_pushed = false; - for (auto &[_, analysis] : analyses) { - for (auto &[column_index, expr] : analysis.col_to_expr) { - if (expr == nullptr) { // Conflict for column - continue; - } - const TableColumnStorageIndex storage_index = analysis.StorageIndex(column_index); - TableFunctionProjectionExpressionInput input {analysis.get, *expr, storage_index}; - if (projection_expression_pushdown(context, input)) { - // LOGICAL_GET doesn't initialize .types of LogicalOperator - analysis.get.returned_types[storage_index] = expr->return_type; - any_pushed = true; - } else { // failed to push down expression, can't replace it - expr = nullptr; - } - } - } - - if (any_pushed) { - Replace(analyses, projections).VisitOperator(*plan); - } - return plan; -} diff --git a/vortex-duckdb/cpp/include/scalar_fn_pushdown.hpp b/vortex-duckdb/cpp/include/scalar_fn_pushdown.hpp deleted file mode 100644 index 19bad361cb0..00000000000 --- a/vortex-duckdb/cpp/include/scalar_fn_pushdown.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#pragma once -#include "optimizer.hpp" -#include "duckdb/planner/expression/bound_columnref_expression.hpp" -#include "duckdb/planner/expression/bound_function_expression.hpp" - -using namespace duckdb; - -/** - * Collect fn(col) expressions i.e. expressions where a single function (not - * a function chain) wraps a single bound column. If "col" is used without - * function application in "plan", record in "analyses.conflicts" - */ -struct ScalarFnCollect final : LogicalOperatorVisitor { - Analyses &analyses; - const Projections &projections; - - ScalarFnCollect(Analyses &analyses, const Projections &projections); - void VisitOperator(LogicalOperator &op) override; - ExpressionPtr VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) override; - ExpressionPtr VisitReplace(BoundFunctionExpression &expr, ExpressionPtr *ptr) override; -}; - -/* - * For "col" in columns collected by ScalarFnCollect, replace fn(col) to "col" - * if "col" doesn't have conflicting usage. Update return types for bound - * columns and logical projections referencing this column. - */ -struct ScalarFnReplace final : LogicalOperatorVisitor { - Analyses &analyses; - const Projections &projections; - - ScalarFnReplace(Analyses &analyses, const Projections &aliases); - ExpressionPtr VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) override; - ExpressionPtr VisitReplace(BoundFunctionExpression &expr, ExpressionPtr *ptr) override; -}; diff --git a/vortex-duckdb/cpp/include/table_filter.h b/vortex-duckdb/cpp/include/table_filter.h index a559f269796..e241f1795f3 100644 --- a/vortex-duckdb/cpp/include/table_filter.h +++ b/vortex-duckdb/cpp/include/table_filter.h @@ -75,6 +75,7 @@ typedef struct { void duckdb_vx_table_filter_get_dynamic(duckdb_vx_table_filter ffi_filter, duckdb_vx_table_filter_dynamic *out); +void duckdb_vx_expr_get_bound_dynamic(duckdb_vx_expr ffi, duckdb_vx_table_filter_dynamic *out); duckdb_vx_table_filter duckdb_vx_table_filter_get_optional(duckdb_vx_table_filter ffi_filter); diff --git a/vortex-duckdb/cpp/include/table_function.hpp b/vortex-duckdb/cpp/include/table_function.hpp index 9af3a27c2c5..aa844d9c07e 100644 --- a/vortex-duckdb/cpp/include/table_function.hpp +++ b/vortex-duckdb/cpp/include/table_function.hpp @@ -6,23 +6,18 @@ #include "data.hpp" #include "duckdb.h" #include "duckdb/function/function.hpp" +#include "duckdb/function/partition_stats.hpp" #include "duckdb/function/table_function.hpp" +#include + using namespace duckdb; static_assert(sizeof(idx_t) == 8); -bool is_vortex_scan(const TableFunction &function); - -struct TableFunctionProjectionExpressionInput { - const LogicalGet &get; - const Expression &expression; - idx_t projection_idx; -}; +bool is_vortex_scan(const BoundTableFunction &function); -// true if we can push down the expression, false otherwise -bool projection_expression_pushdown(ClientContext &context, - const TableFunctionProjectionExpressionInput &input); +constexpr inline idx_t COUNT_STAR_PROJ_IDX = std::numeric_limits::max(); struct TableFunctionUngroupedAggregateInput { const LogicalGet &get; @@ -50,9 +45,12 @@ struct VortexRowGroup final : PartitionRowGroup { unique_ptr ffi_footer; unique_ptr GetColumnStatistics(const StorageIndex &storage_index) override; - bool MinMaxIsExact(const BaseStatistics &, const StorageIndex &) override { - // TODO(myrrc): in duckdb 2.0 we should report false for strings and - // also add TRUNCATED_STATS type for them + + bool MinMaxIsExact(const StorageIndex &) override { return true; } + + bool HasPendingWrites() override { + return false; + } }; diff --git a/vortex-duckdb/cpp/include/vector.h b/vortex-duckdb/cpp/include/vector.h index 983a7ecc479..87b56f17a95 100644 --- a/vortex-duckdb/cpp/include/vector.h +++ b/vortex-duckdb/cpp/include/vector.h @@ -26,13 +26,10 @@ void duckdb_vx_vector_dictionary(duckdb_vector ffi_vector, // vector must not be a DictionaryVector or a SequenceVector void duckdb_vx_vector_set_all_valid(duckdb_vector ffi_vector); -// Set the data pointer for the vector. This is the start of the values array in the vector. -void duckdb_vx_vector_set_data_ptr(duckdb_vector ffi_vector, void *ptr); - // Converts a duckdb flat vector into a Sequence vector. void duckdb_vx_sequence_vector(duckdb_vector c_vector, int64_t start, int64_t step, idx_t capacity); -void duckdb_vector_flatten(duckdb_vector vector, unsigned long len); +void duckdb_vector_flatten(duckdb_vector vector); duckdb_value duckdb_vx_vector_get_value(duckdb_vector ffi_vector, idx_t index); @@ -47,9 +44,13 @@ void duckdb_vx_vector_buffer_destroy(duckdb_vx_vector_buffer *buffer); void duckdb_vx_string_vector_add_vector_data_buffer(duckdb_vector ffi_vector, duckdb_vx_vector_buffer buffer); // Add the buffer to the data vector (basically, keep it alive as long as the vector) and set the data -// pointer. You must ensure that the ptr is valid for the lifetime of the vector and the ptr addr + size is -// valid. -void duckdb_vx_vector_set_vector_data_buffer(duckdb_vector ffi_vector, duckdb_vx_vector_buffer buffer); +// pointer. You must ensure that the ptr is valid for the lifetime of the vector and ptr + capacity +// elements are valid. +void duckdb_vx_vector_set_vector_data_buffer(duckdb_vector ffi_vector, + duckdb_vx_vector_buffer buffer, + void *data_ptr, + idx_t capacity, + idx_t type_size); // Set the validity pointer for the vector to external data, and store the buffer in auxiliary // to keep it alive. The validity pointer is derived from data_ptr at the given u64 offset. diff --git a/vortex-duckdb/cpp/include/vector.hpp b/vortex-duckdb/cpp/include/vector.hpp index f59d51ef2e5..1bddd75f584 100644 --- a/vortex-duckdb/cpp/include/vector.hpp +++ b/vortex-duckdb/cpp/include/vector.hpp @@ -4,14 +4,24 @@ #pragma once #include "data.hpp" -#include "duckdb/common/types/vector_buffer.hpp" +#include "duckdb/common/vector/flat_vector.hpp" -// A DuckDB vector buffer that keeps externally-owned data alive for the -// lifetime of the vector. -class ExternalVectorBuffer final : public duckdb::VectorBuffer { - duckdb::unique_ptr data; +using namespace duckdb; + +// A DuckDB vector buffer over externally-owned data. +class ExternalVectorBuffer final : public StandardVectorBuffer { + shared_ptr parent; + unique_ptr data; public: - explicit inline ExternalVectorBuffer(duckdb::unique_ptr data) : data(std::move(data)) { + explicit inline ExternalVectorBuffer(unique_ptr data) + : StandardVectorBuffer(nullptr, count_t(0), 0), data(std::move(data)) { + } + + inline ExternalVectorBuffer(shared_ptr parent, + data_ptr_t ptr, + idx_t capacity, + idx_t type_size) + : StandardVectorBuffer(ptr, count_t(capacity), type_size), parent(std::move(parent)) { } }; diff --git a/vortex-duckdb/cpp/include/vortex_duckdb.h b/vortex-duckdb/cpp/include/vortex_duckdb.h index ae33804cabc..45836c92e10 100644 --- a/vortex-duckdb/cpp/include/vortex_duckdb.h +++ b/vortex-duckdb/cpp/include/vortex_duckdb.h @@ -60,7 +60,8 @@ void duckdb_vx_reusable_dict_set_vector(duckdb_vx_reusable_dict reusable, duckdb /// Creates a dictionary vector using a reusable dictionary and a selection vector. void duckdb_vx_vector_dictionary_reusable(duckdb_vector vector, duckdb_vx_reusable_dict reusable, - duckdb_selection_vector sel_vec); + duckdb_selection_vector sel_vec, + idx_t sel_count); // Create a null value with a reference to a logical type. duckdb_value duckdb_vx_value_create_null(duckdb_logical_type ty); diff --git a/vortex-duckdb/cpp/multi_file_reader.cpp b/vortex-duckdb/cpp/multi_file_reader.cpp index 7de57ff907d..f36947a462c 100644 --- a/vortex-duckdb/cpp/multi_file_reader.cpp +++ b/vortex-duckdb/cpp/multi_file_reader.cpp @@ -99,7 +99,7 @@ VortexMultiFileReader::InitializeReader(MultiFileReaderData &reader_data, void VortexReaderInterface::BindReader(ClientContext &context, vector &types, - vector &names, + vector &names, MultiFileBindData &bind_data) { BaseFileReaderOptions options; @@ -188,7 +188,7 @@ VortexReaderInterface::InitializeGlobalState(ClientContext &context, } unique_ptr -VortexReaderInterface::InitializeLocalState(ExecutionContext &, GlobalTableFunctionState &global_state) { +VortexReaderInterface::InitializeLocalState(ClientContext &, GlobalTableFunctionState &global_state) { auto &global = global_state.Cast(); const void *const ffi_global = global.ffi_global_state->DataPtr(); duckdb_vx_data ffi_local_state = duckdb_table_function_init_local(global.ffi_bind_data, ffi_global); @@ -329,11 +329,11 @@ static unique_ptr numeric_stats(duckdb_column_statistics &stats, static unique_ptr string_stats(duckdb_column_statistics &stats, LogicalType type) { BaseStatistics out = StringStats::CreateUnknown(type); if (stats.min) { - StringStats::SetMin(out, StringValue::Get(UnwrapValue(stats.min))); + StringStats::SetMin(out, StringValue::Get(UnwrapValue(stats.min)), StringStatsType::TRUNCATED_STATS); duckdb_destroy_value(&stats.min); } if (stats.max) { - StringStats::SetMax(out, StringValue::Get(UnwrapValue(stats.max))); + StringStats::SetMax(out, StringValue::Get(UnwrapValue(stats.max)), StringStatsType::TRUNCATED_STATS); duckdb_destroy_value(&stats.max); } if (stats.max_string_length >> 63) { @@ -409,7 +409,7 @@ unique_ptr to_duckdb_statistics(duckdb_column_statistics &statis } } -unique_ptr VortexBaseReader::GetStatistics(ClientContext &, const string &name) { +unique_ptr VortexBaseReader::GetStatistics(ClientContext &, const Identifier &name) { D_ASSERT(ffi_bind); duckdb_column_statistics statistics = {}; if (!duckdb_reader_get_statistics(ffi_file->DataPtr(), diff --git a/vortex-duckdb/cpp/optimizer.cpp b/vortex-duckdb/cpp/optimizer.cpp deleted file mode 100644 index 9f799fb1e42..00000000000 --- a/vortex-duckdb/cpp/optimizer.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#include "optimizer.hpp" -#include "multi_file_reader.hpp" -#include "table_function.hpp" - -#include "duckdb/planner/expression/bound_columnref_expression.hpp" -#include "duckdb/planner/operator/logical_get.hpp" -#include "duckdb/planner/operator/logical_limit.hpp" -#include "duckdb/planner/operator/logical_projection.hpp" - -void FindGetsAndProjections(LogicalOperator &op, Analyses &analyses, Projections &projections) { - using enum LogicalOperatorType; - switch (op.type) { - case LOGICAL_GET: { - if (auto &get = op.Cast(); is_vortex_scan(get.function)) { - analyses.emplace(get.table_index, GetAnalysis {get, {}}); - } - break; - } - case LOGICAL_PROJECTION: { - LogicalProjection &projection = op.Cast(); - D_ASSERT(projection.children.size() == 1); - auto &child = *projection.children[0]; - if (!IsPassthrough(projection)) { - break; - } - LogicalGet *get = nullptr; - - // queries with LIMIT may include a STREAMING_LIMIT between PROJECTION and GET. - // See sqllogictest scalar_function_pushdown_limit.test - if (child.type == LOGICAL_LIMIT) { - if (auto &limit = child.Cast(); - limit.children.size() == 1 && limit.children[0]->type == LOGICAL_GET) { - get = &limit.children[0]->Cast(); - } - } else if (child.type == LOGICAL_GET) { - get = &child.Cast(); - } - - if (get != nullptr && is_vortex_scan(get->function)) { - projections.emplace(projection.table_index, projection); - } - break; - } - default: - break; - } - - for (auto &child : op.children) { - FindGetsAndProjections(*child, analyses, projections); - } -} - -TableColumnStorageIndex GetAnalysis::StorageIndex(TableColumnScanIndex idx) const { - return get.GetColumnIds()[idx].GetPrimaryIndex(); -} - -static bool IsVirtualColumn(const GetAnalysis &analysis, TableColumnScanIndex idx) { - return analysis.get.GetColumnIds()[idx].IsVirtualColumn(); -} - -std::optional Resolve(ColumnBinding binding, Analyses &analyses, const Projections &projections) { - if (const auto it = analyses.find(binding.table_index); it != analyses.end()) { - if (IsVirtualColumn(it->second, binding.column_index)) { - return std::nullopt; - } - return {{it->second, binding.column_index, nullptr}}; - } - - const auto projection_it = projections.find(binding.table_index); - if (projection_it == projections.end()) { - return std::nullopt; - } - - LogicalProjection &projection = projection_it->second; - const ExpressionPtr &inner = projection.expressions[binding.column_index]; - if (inner->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - return std::nullopt; - } - const ColumnBinding &get_binding = inner->Cast().binding; - if (const auto it = analyses.find(get_binding.table_index); it != analyses.end()) { - if (IsVirtualColumn(it->second, get_binding.column_index)) { - return std::nullopt; - } - return {{it->second, get_binding.column_index, &projection}}; - } - return std::nullopt; -} - -bool CanPushdownColumn(const GetAnalysis &analysis, TableColumnScanIndex idx) { - const auto it = analysis.col_to_expr.find(idx); - return it != analysis.col_to_expr.end() && it->second != nullptr; -} - -bool IsPassthrough(const LogicalProjection &projection) { - if (projection.expressions.empty()) { - return false; // don't register empty projections in Projections - } - for (const auto &e : projection.expressions) { - if (e->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - return false; - } - } - return true; -} diff --git a/vortex-duckdb/cpp/scalar_fn_pushdown.cpp b/vortex-duckdb/cpp/scalar_fn_pushdown.cpp deleted file mode 100644 index 3ff85e880df..00000000000 --- a/vortex-duckdb/cpp/scalar_fn_pushdown.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors -#include "scalar_fn_pushdown.hpp" - -#include "duckdb/planner/operator/logical_projection.hpp" -#include "duckdb/planner/operator/logical_get.hpp" -#include "optimizer.hpp" - -#include - -/** - * Our optimizer runs after all duckdb optimizers. Functions that can be pushed - * down as complex filters (e.g. WHERE str != '') are already pushed down. - * If there are any functions left, this means they were not pushed down and - * may produce conflicts (e.g. WHERE prefix("str", 'h')). - */ -void ScalarFnCollect::VisitOperator(LogicalOperator &op) { - /* - * Logical projection expressions are columns which reference underlying - * GETs. Don't process them, as they would add conflicts for every column - * used in projection. Example: PROJECTION(col) -> GET(col). We don't want - * to visit BoundColumnRefExpression in PROJECTION to avoid registering a - * non-existent conflict. - * - * However, ScalarFnReplace will visit them because we need to update their - * types if pushdown succeeded. - */ - if (op.type == LogicalOperatorType::LOGICAL_PROJECTION && - projections.count(op.Cast().table_index)) { - VisitOperatorChildren(op); - return; - } - LogicalOperatorVisitor::VisitOperator(op); -} - -ExpressionPtr ScalarFnCollect::VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) { - if (const auto binding = Resolve(expr.binding, analyses, projections)) { - // Column is used without function applied to it, register a conflict. - // Not emplace() as we need to update the value if it was present - binding->analysis.col_to_expr[binding->column_index] = nullptr; - } - return std::move(*ptr); -} - -ExpressionPtr ScalarFnCollect::VisitReplace(BoundFunctionExpression &expr, ExpressionPtr *ptr) { - if (expr.children.size() != 1 || - expr.children[0]->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - // Descend into children so e.g. fn(col, other) still sees "col" and - // registers a conflict - return nullptr; - } - const auto &bound_col = expr.children[0]->Cast(); - const auto binding = Resolve(bound_col.binding, analyses, projections); - if (!binding) { - return nullptr; - } - auto &col_to_expr = binding->analysis.col_to_expr; - - if (auto it = col_to_expr.find(binding->column_index); it == col_to_expr.end()) { - // This is the first time we see the column used by a single function. - col_to_expr.emplace(binding->column_index, &expr); - } else if (it->second == nullptr || !it->second->Equals(expr)) { - // Either column is used with different function in "expr" or - // there already is a conflict. - it->second = nullptr; - } - - return std::move(*ptr); -} - -ExpressionPtr ScalarFnReplace::VisitReplace(BoundColumnRefExpression &expr, ExpressionPtr *ptr) { - const auto binding = Resolve(expr.binding, analyses, projections); - if (!binding) { - return std::move(*ptr); - } - - const auto &[analysis, column_index, projection] = *binding; - if (CanPushdownColumn(analysis, column_index)) { - const idx_t storage_index = analysis.get.GetColumnIds()[column_index].GetPrimaryIndex(); - const LogicalType return_type = analysis.get.returned_types[storage_index]; - expr.return_type = return_type; - if (projection != nullptr && !projection->types.empty()) { - projection->types[column_index] = expr.return_type; - } - } - - return std::move(*ptr); -} - -ExpressionPtr ScalarFnReplace::VisitReplace(BoundFunctionExpression &expr, ExpressionPtr *ptr) { - if (expr.children.size() != 1 || - expr.children[0]->GetExpressionType() != ExpressionType::BOUND_COLUMN_REF) { - return nullptr; // Same as in ScalarFnCollect::VisitReplace - } - ExpressionPtr &bound_col_base = expr.children[0]; - const auto &bound_col = bound_col_base->Cast(); - const auto binding = Resolve(bound_col.binding, analyses, projections); - if (!binding) { - return nullptr; - } - - const auto &[analysis, column_index, projection] = *binding; - if (!CanPushdownColumn(analysis, column_index)) { - return std::move(*ptr); - } - - const idx_t storage_index = analysis.get.GetColumnIds()[column_index].GetPrimaryIndex(); - const LogicalType return_type = analysis.get.returned_types[storage_index]; - bound_col_base->return_type = return_type; - if (projection != nullptr && !projection->types.empty()) { - projection->types[column_index] = return_type; - } - return std::move(bound_col_base); -} - -ScalarFnCollect::ScalarFnCollect(Analyses &analyses, const Projections &projections) - : analyses(analyses), projections(projections) { -} - -ScalarFnReplace::ScalarFnReplace(Analyses &analyses, const Projections &projections) - : analyses(analyses), projections(projections) { -} diff --git a/vortex-duckdb/cpp/spatial_overrides.cpp b/vortex-duckdb/cpp/spatial_overrides.cpp index 28f095a7b89..56d3c50b45f 100644 --- a/vortex-duckdb/cpp/spatial_overrides.cpp +++ b/vortex-duckdb/cpp/spatial_overrides.cpp @@ -16,6 +16,7 @@ #include "duckdb/main/database_manager.hpp" #include "duckdb/parser/parsed_data/create_scalar_function_info.hpp" #include "duckdb/planner/expression/bound_function_expression.hpp" +#include "duckdb/planner/logical_operator.hpp" #include "duckdb/planner/logical_operator_visitor.hpp" #include "duckdb/transaction/meta_transaction.hpp" @@ -31,7 +32,7 @@ struct SpatialOverride { /// Drop spatial's bind so the filter keeps the radius visible as `children[2]`. static void DropBind(ScalarFunction &fn) { - fn.bind = nullptr; + fn.SetBindCallback(nullptr); } /// Clear the error mode so the filter pushes through view projections. @@ -50,16 +51,16 @@ static constexpr SpatialOverride SPATIAL_OVERRIDES[] = { /// spatial's original. static void RegisterSpatialOverride(ClientContext &context, const SpatialOverride &fn_override) { auto &system = Catalog::GetSystemCatalog(context); - auto entry = system.GetEntry(context, - DEFAULT_SCHEMA, - fn_override.name, - OnEntryNotFound::RETURN_NULL); + auto entry = Catalog::GetEntry( + context, + QualifiedName(system.GetName(), Identifier::DefaultSchema(), Identifier(fn_override.name)), + OnEntryNotFound::RETURN_NULL); if (!entry) { return; } ScalarFunctionSet set(fn_override.name); for (const auto &overload : entry->functions.functions) { - ScalarFunction copy = overload; + ScalarFunction copy = *overload; fn_override.tweak(copy); set.AddFunction(copy); } @@ -123,24 +124,25 @@ unique_ptr SpatialOverrideRestore::VisitReplace(BoundFunctionExpress std::any_of(std::begin(SPATIAL_OVERRIDES), std::end(SPATIAL_OVERRIDES), [&](const SpatialOverride &o) { - return expr.function.name == o.name && expr.children.size() == o.arity; + return expr.Function().GetName() == o.name && expr.GetChildren().size() == o.arity; }); if (!overridden) { return nullptr; // Not an overridden call: leave it as is. } // Spatial's original lives in the system catalog, where the override cannot shadow it. - auto original = - Catalog::GetSystemCatalog(context).GetEntry(context, - DEFAULT_SCHEMA, - expr.function.name, - OnEntryNotFound::RETURN_NULL); + auto original = Catalog::GetEntry( + context, + QualifiedName(Catalog::GetSystemCatalog(context).GetName(), + Identifier::DefaultSchema(), + expr.Function().GetName()), + OnEntryNotFound::RETURN_NULL); if (!original) { return nullptr; } // Rebind a copy of the call's arguments through the original function. vector> children; - children.reserve(expr.children.size()); - for (const auto &child : expr.children) { + children.reserve(expr.GetChildren().size()); + for (const auto &child : expr.GetChildren()) { children.push_back(child->Copy()); } ErrorData error; diff --git a/vortex-duckdb/cpp/table_filter.cpp b/vortex-duckdb/cpp/table_filter.cpp index 27630cc7c5b..341eabdd9dc 100644 --- a/vortex-duckdb/cpp/table_filter.cpp +++ b/vortex-duckdb/cpp/table_filter.cpp @@ -5,8 +5,11 @@ #include #include "duckdb/planner/table_filter.hpp" +#include "duckdb/planner/table_filter_set.hpp" +#include "duckdb/planner/filter/constant_filter.hpp" #include "duckdb/planner/filter/conjunction_filter.hpp" #include "duckdb/planner/filter/dynamic_filter.hpp" +#include "duckdb/planner/filter/table_filter_functions.hpp" #include "duckdb/planner/filter/optional_filter.hpp" #include "duckdb/planner/filter/expression_filter.hpp" #include "duckdb/planner/filter/struct_filter.hpp" @@ -17,19 +20,22 @@ using namespace duckdb; extern "C" idx_t duckdb_vx_table_filter_set_get(duckdb_vx_table_filter_set ffi_filter_set, size_t index, duckdb_vx_table_filter *table_filter_out) { - auto &filters = reinterpret_cast(ffi_filter_set)->filters; - if (filters.size() <= index) { + TableFilterSet &filter_set = *reinterpret_cast(ffi_filter_set); + if (filter_set.FilterCount() <= index) { *table_filter_out = nullptr; return 0; } - auto &[column_idx, filter] = *std::next(filters.begin(), index); - *table_filter_out = reinterpret_cast(filter.get()); - return column_idx; + auto it = filter_set.begin(); + for (size_t i = 0; i < index; ++i) { + ++it; + } + auto &entry = *it; + *table_filter_out = reinterpret_cast(&entry.Filter()); + return entry.GetIndex(); } extern "C" idx_t duckdb_vx_table_filter_set_size(duckdb_vx_table_filter_set ffi_filter_set) { - auto filter_set = reinterpret_cast(ffi_filter_set); - return filter_set->filters.size(); + return reinterpret_cast(ffi_filter_set)->FilterCount(); } extern "C" duckdb_vx_table_filter_type duckdb_vx_table_filter_get_type(duckdb_vx_table_filter ffi_filter) { @@ -39,7 +45,12 @@ extern "C" duckdb_vx_table_filter_type duckdb_vx_table_filter_get_type(duckdb_vx extern "C" const char *duckdb_vx_table_filter_to_debug_string(duckdb_vx_table_filter ffi_filter) { auto filter = reinterpret_cast(ffi_filter); - auto str = filter->DebugToString(); + std::string str; + if (filter->filter_type == TableFilterType::EXPRESSION_FILTER) { + str = filter->Cast().DebugToString(); + } else { + str = "TableFilter(type=" + std::to_string(static_cast(filter->filter_type)) + ")"; + } auto result = static_cast(duckdb_malloc(str.size() + 1)); memcpy(result, str.c_str(), str.size() + 1); return result; @@ -50,7 +61,7 @@ extern "C" void duckdb_vx_table_filter_get_constant(duckdb_vx_table_filter ffi_f if (!ffi_filter || !out) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); out->value = reinterpret_cast(&filter.constant); out->comparison_type = static_cast(filter.comparison_type); } @@ -60,7 +71,7 @@ extern "C" void duckdb_vx_table_filter_get_conjunction_or(duckdb_vx_table_filter if (!ffi_filter || !out) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); out->children = reinterpret_cast(filter.child_filters.data()); out->children_count = filter.child_filters.size(); } @@ -70,7 +81,7 @@ extern "C" void duckdb_vx_table_filter_get_conjunction_and(duckdb_vx_table_filte if (!ffi_filter || !out) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); out->children = reinterpret_cast(filter.child_filters.data()); out->children_count = filter.child_filters.size(); } @@ -85,19 +96,33 @@ struct DynamicFilterDataWrapper { }; } // namespace -extern "C" void duckdb_vx_table_filter_get_dynamic(duckdb_vx_table_filter ffi_filter, - duckdb_vx_table_filter_dynamic *out) { - if (!ffi_filter || !out) { +void populateDynamicFilter(shared_ptr &data, duckdb_vx_table_filter_dynamic *out) { + if (!data) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + annotated_shared_lock lock(data->lock); + auto wrapper = make_uniq(data); + out->data = reinterpret_cast(wrapper.release()); + out->comparison_type = static_cast(data->comparison_type); +} - // Hold the lock while accessing the filter data. - std::lock_guard lock(filter.filter_data->lock); +extern "C" void duckdb_vx_table_filter_get_dynamic(duckdb_vx_table_filter ffi, + duckdb_vx_table_filter_dynamic *out) { + D_ASSERT(ffi); + D_ASSERT(out); + auto &filter = reinterpret_cast(ffi)->Cast(); + populateDynamicFilter(filter.filter_data, out); +} - auto data_wrapper = make_uniq(filter.filter_data); - out->data = reinterpret_cast(data_wrapper.release()); - out->comparison_type = static_cast(filter.filter_data->filter->comparison_type); +extern "C" void duckdb_vx_expr_get_bound_dynamic(duckdb_vx_expr ffi, duckdb_vx_table_filter_dynamic *out) { + D_ASSERT(ffi); + D_ASSERT(out); + auto &expr = reinterpret_cast(ffi)->Cast(); + if (!expr.BindInfo() || expr.Function().GetName() != DynamicFilterScalarFun::NAME) { + return; + } + auto &filter = expr.BindInfo()->Cast(); + populateDynamicFilter(filter.filter_data, out); } extern "C" void duckdb_vx_dynamic_filter_data_free(duckdb_vx_dynamic_filter_data *ffi_data) { @@ -118,21 +143,21 @@ extern "C" duckdb_value duckdb_vx_dynamic_filter_data_get_value(duckdb_vx_dynami } // Hold the lock while accessing the filter data. - std::lock_guard lock(data_wrapper->data->lock); + annotated_shared_lock lock(data_wrapper->data->lock); - if (!data_wrapper->data->filter || !data_wrapper->data->initialized) { + if (!data_wrapper->data->initialized) { return nullptr; } // Return a heap allocated copy of the value. - return reinterpret_cast(new Value(data_wrapper->data->filter->constant)); + return reinterpret_cast(new Value(data_wrapper->data->constant)); } extern "C" duckdb_vx_table_filter duckdb_vx_table_filter_get_optional(duckdb_vx_table_filter ffi_filter) { if (!ffi_filter) { return nullptr; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); return reinterpret_cast(filter.child_filter.get()); } @@ -149,11 +174,12 @@ extern "C" void duckdb_vx_table_filter_get_struct_extract(duckdb_vx_table_filter if (!ffi_filter || !out) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); out->child_filter = reinterpret_cast(filter.child_filter.get()); - out->child_name_len = filter.child_name.size(); - out->child_name = static_cast(filter.child_name.data()); + const std::string &child_name = filter.child_name.GetIdentifierName(); + out->child_name_len = child_name.size(); + out->child_name = const_cast(child_name.data()); } extern "C" void duckdb_vx_table_filter_get_in_filter(duckdb_vx_table_filter ffi_filter, @@ -161,7 +187,7 @@ extern "C" void duckdb_vx_table_filter_get_in_filter(duckdb_vx_table_filter ffi_ if (!ffi_filter || !out) { return; } - auto &filter = reinterpret_cast(ffi_filter)->Cast(); + auto &filter = reinterpret_cast(ffi_filter)->Cast(); out->values_count = filter.values.size(); out->values = reinterpret_cast(&filter.values); diff --git a/vortex-duckdb/cpp/table_function.cpp b/vortex-duckdb/cpp/table_function.cpp index 0f6b35f3c9c..295d402b0ff 100644 --- a/vortex-duckdb/cpp/table_function.cpp +++ b/vortex-duckdb/cpp/table_function.cpp @@ -14,12 +14,14 @@ #include "duckdb/catalog/catalog.hpp" #include "duckdb/catalog/default/default_functions.hpp" #include "duckdb/common/insertion_order_preserving_map.hpp" -#include "duckdb/parser/keyword_helper.hpp" #include "duckdb/common/multi_file/multi_file_reader.hpp" +#include "duckdb/function/partition_stats.hpp" +#include "duckdb/function/scalar_macro_function.hpp" #include "duckdb/function/table_function.hpp" +#include "duckdb/logging/logger.hpp" #include "duckdb/main/capi/capi_internal.hpp" #include "duckdb/main/connection.hpp" -#include "duckdb/function/partition_stats.hpp" +#include "duckdb/parser/keyword_helper.hpp" #include "duckdb/parser/parsed_data/create_table_function_info.hpp" #include "duckdb/planner/operator/logical_get.hpp" #include "duckdb/storage/storage_index.hpp" @@ -38,22 +40,6 @@ static void *get_ffi_bind(const FunctionData *bind_data) { return bind_data->Cast().bind_data->Cast().ffi_bind_data->DataPtr(); } -bool projection_expression_pushdown(ClientContext &, const TableFunctionProjectionExpressionInput &input) { - duckdb_vx_expr ffi_expr = get_ffi_expr(input.expression); - void *const ffi_bind = get_ffi_bind(input.get.bind_data.get()); - duckdb_vx_error error_out = nullptr; - - const bool ret = duckdb_table_function_pushdown_projection_expression( // - ffi_bind, - ffi_expr, - input.projection_idx, - &error_out); - if (error_out) { - throw BinderException(IntoErrString(error_out)); - } - return ret; -} - extern "C" { idx_t duckdb_vx_aggregate_len(duckdb_vx_agg_input ffi_input) { return reinterpret_cast(ffi_input)->projections.size(); @@ -107,7 +93,7 @@ extern "C" void duckdb_vx_tfunc_bind_result_add_column(duckdb_bind_result ffi_re VortexBindResult &result = *reinterpret_cast(ffi_result); const LogicalType logical_type = *reinterpret_cast(ffi_type); - result.names.emplace_back(name_str, name_len); + result.names.emplace_back(string(name_str, name_len)); result.return_types.emplace_back(logical_type); } @@ -126,11 +112,11 @@ InsertionOrderPreservingMap to_string(TableFunctionToStringInput &input) return result; } -bool is_vortex_scan(const TableFunction &function) { +bool is_vortex_scan(const BoundTableFunction &function) { return function.bind == MultiFileFunction::MultiFileBind; } -unique_ptr get_multi_file_reader(const TableFunction &) { +unique_ptr get_multi_file_reader(const BoundTableFunction &) { return make_uniq(); } @@ -179,12 +165,39 @@ static vector get_partition_stats(ClientContext &, GetParti return result; } +static bool projection_expression_pushdown(ClientContext &, + const TableFunctionProjectionExpressionInput &input) { + duckdb_vx_expr ffi_expr = get_ffi_expr(input.expr); + void *const ffi_bind = get_ffi_bind(input.get.bind_data.get()); + duckdb_vx_error error_out = nullptr; + + const idx_t column_id = input.get.GetColumnIds()[input.column_index].GetPrimaryIndex(); + + const bool ret = + duckdb_table_function_pushdown_projection_expression(ffi_bind, ffi_expr, column_id, &error_out); + if (error_out) { + throw BinderException(IntoErrString(error_out)); + } + + if (ret) { + MultiFileBindData &bind_data = input.get.bind_data->Cast(); + bind_data.types[column_id] = input.expr.GetReturnType(); + bind_data.columns[column_id].type = input.expr.GetReturnType(); + } + + return ret; +} + duckdb_state register_table_function(DatabaseInstance &db, LogicalType parameter, const std::string &name) { - MultiFileFunction fn(name); - fn.arguments[0] = parameter; - fn.named_parameters = {{"filename", LogicalType::ANY}, - {"allow_empty", LogicalType::BOOLEAN}, - {"hive_partitioning", LogicalType::BOOLEAN}}; + MultiFileFunction fn {Identifier(name)}; + FunctionSignature signature; + signature.AddPositionalOnly("path", std::move(parameter)); + signature.WithTypedKwargs("options", [](TypedKwargs &options) { + options.Add("filename", LogicalType::ANY) + .Add("allow_empty", LogicalType::BOOLEAN) + .Add("hive_partitioning", LogicalType::BOOLEAN); + }); + fn.GetSignature() = std::move(signature); fn.filter_pushdown = true; fn.filter_prune = true; @@ -200,6 +213,7 @@ duckdb_state register_table_function(DatabaseInstance &db, LogicalType parameter fn.pushdown_complex_filter = [](auto &, auto &, FunctionData *bind_data, FilterVec &filters) { pushdown_complex_filter(*bind_data, filters); }; + fn.projection_expression_pushdown = projection_expression_pushdown; fn.to_string = to_string; fn.late_materialization = true; @@ -209,8 +223,8 @@ duckdb_state register_table_function(DatabaseInstance &db, LogicalType parameter return {COLUMN_IDENTIFIER_FILE_INDEX, COLUMN_IDENTIFIER_FILE_ROW_NUMBER}; }; - fn.statistics = MultiFileFunction::MultiFileScanStats; fn.get_partition_stats = get_partition_stats; + fn.statistics_extended = MultiFileFunction::MultiFileScanStatsExtended; fn.get_multi_file_reader = get_multi_file_reader; /** @@ -255,18 +269,15 @@ extern "C" duckdb_state duckdb_vx_register_version_function(duckdb_database ffi_ const DatabaseWrapper &wrapper = *reinterpret_cast(ffi_db); DatabaseInstance &db = *wrapper.database->instance; - const string quoted = KeywordHelper::WriteQuoted(version); + unique_ptr expr = ConstantExpression::FromValue(version); + CreateMacroInfo info(CatalogType::MACRO_ENTRY); + info.macros.emplace_back(make_uniq(std::move(expr))); + info.SetQualifiedName({{DEFAULT_SCHEMA}, "vortex_version"}); + info.internal = true; // only internals allowed in system catalog - const DefaultMacro macro {DEFAULT_SCHEMA, - "vortex_version", - {nullptr}, - {{nullptr, nullptr}}, - quoted.c_str()}; try { - auto info = DefaultFunctionGenerator::CreateInternalMacroInfo(macro); - auto &system_catalog = Catalog::GetSystemCatalog(db); auto data = CatalogTransaction::GetSystemTransaction(db); - system_catalog.CreateFunction(data, *info); + Catalog::GetSystemCatalog(db).CreateFunction(data, info); } catch (const std::exception &e) { ErrorData data(e); DUCKDB_LOG_ERROR(db, "Failed to create the vortex_version macro:\t" + data.Message()); diff --git a/vortex-duckdb/cpp/vector.cpp b/vortex-duckdb/cpp/vector.cpp index 47e0492d094..80c509b1cad 100644 --- a/vortex-duckdb/cpp/vector.cpp +++ b/vortex-duckdb/cpp/vector.cpp @@ -6,6 +6,9 @@ #include "duckdb/common/types/value.hpp" #include "duckdb/common/types/vector.hpp" +#include "duckdb/common/types/vector_buffer.hpp" +#include "duckdb/common/vector/fsst_vector.hpp" +#include "duckdb/common/vector/string_vector.hpp" using namespace duckdb; @@ -23,6 +26,8 @@ extern "C" void duckdb_vx_vector_dictionary(duckdb_vector ffi_vector, auto vector = reinterpret_cast(ffi_vector); auto dict = reinterpret_cast(ffi_dict); auto sel_vec = reinterpret_cast(ffi_sel_vec); + // Vector::Dictionary requires dict.size() == dictionary_size + dict->BufferMutable().SetVectorSize(dictionary_size); vector->Dictionary(*dict, dictionary_size, *sel_vec, count); } @@ -32,25 +37,6 @@ duckdb_vx_sequence_vector(duckdb_vector c_vector, int64_t start, int64_t step, i vector->Sequence(start, step, capacity); } -// This is a complete hack to access the data buffer and pointer of a vector. -// Duckdb passes us Vectors and not VortexVectors. This only works because -// VortexVector doesn't add any members. -class VortexVector final : public Vector { -public: - inline void SetDataBuffer(buffer_ptr new_buffer) { - buffer = std::move(new_buffer); - }; - - inline void SetDataPtr(data_ptr_t ptr) { - data = ptr; - }; - - inline ValidityMask &GetValidity() { - return validity; - }; -}; -static_assert(sizeof(VortexVector) == sizeof(Vector)); - // Same hack for ValidityMask: access protected fields via inheritance. class ExternalValidityMask final : public ValidityMask { public: @@ -64,47 +50,45 @@ class ExternalValidityMask final : public ValidityMask { static_assert(sizeof(ExternalValidityMask) == sizeof(ValidityMask)); extern "C" void duckdb_vx_string_vector_add_vector_data_buffer(duckdb_vector ffi_vector, - duckdb_vx_vector_buffer buffer) { - auto vector = reinterpret_cast(ffi_vector); - auto data = reinterpret_cast *>(buffer); - StringVector::AddBuffer(*vector, *data); + duckdb_vx_vector_buffer ffi_buffer) { + Vector &vector = *reinterpret_cast(ffi_vector); + buffer_ptr data = *reinterpret_cast *>(ffi_buffer); + StringVector::AddAuxiliaryData(vector, make_uniq(std::move(data))); } extern "C" void duckdb_vx_vector_set_vector_data_buffer(duckdb_vector ffi_vector, - duckdb_vx_vector_buffer buffer) { - auto vector = reinterpret_cast(ffi_vector); - auto dvector = reinterpret_cast(vector); - auto data = reinterpret_cast *>(buffer); - dvector->SetDataBuffer(*data); -} - -extern "C" void duckdb_vx_vector_set_data_ptr(duckdb_vector ffi_vector, void *ptr) { - auto vector = reinterpret_cast(ffi_vector); - auto dvector = reinterpret_cast(vector); - dvector->SetDataPtr((data_ptr_t)ptr); + duckdb_vx_vector_buffer buffer, + void *data_ptr, + idx_t capacity, + idx_t type_size) { + Vector &vector = *reinterpret_cast(ffi_vector); + auto &root = *reinterpret_cast *>(buffer); + auto new_buffer = + make_buffer(root, static_cast(data_ptr), capacity, type_size); + // Carry validity set on the vector before this call + if (vector.GetBufferRef() && vector.Buffer().GetBufferType() == VectorBufferType::STANDARD_BUFFER) { + new_buffer->GetValidityMask() = vector.BufferMutable().GetValidityMask(); + } + vector.SetBuffer(std::move(new_buffer)); } extern "C" void duckdb_vx_vector_set_validity_data(duckdb_vector ffi_vector, idx_t u64_offset, idx_t capacity, - duckdb_vx_vector_buffer buffer, + duckdb_vx_vector_buffer ffi_buffer, void *data_ptr) { - auto dvector = reinterpret_cast(ffi_vector); - auto &validity = dvector->GetValidity(); - // ExternalValidityMask adds no members, so this downcast only exposes - // access to ValidityMask's protected fields. - auto ext_validity = static_cast(&validity); + Vector &vector = *reinterpret_cast(ffi_vector); + VectorBuffer &buffer = vector.BufferMutable(); + ExternalValidityMask &validity = static_cast(buffer.GetValidityMask()); // Use the shared_ptr aliasing constructor: the control block ref-counts the // ExternalVectorBuffer (preventing the Rust buffer from being freed), // while the stored pointer points to the explicit data_ptr. - auto ext_buf = reinterpret_cast *>(buffer); + auto ext_buf = reinterpret_cast *>(ffi_buffer); auto keeper = shared_ptr>( *ext_buf, reinterpret_cast *>(data_ptr)); - - // Set validity_data, derive validity_mask from it at u64_offset, and set capacity. - ext_validity->SetExternal(u64_offset, capacity, std::move(keeper)); + validity.SetExternal(u64_offset, capacity, std::move(keeper)); } extern "C" duckdb_value duckdb_vx_vector_get_value(duckdb_vector ffi_vector, idx_t index) { @@ -113,24 +97,22 @@ extern "C" duckdb_value duckdb_vx_vector_get_value(duckdb_vector ffi_vector, idx return reinterpret_cast(value.release()); } -void duckdb_vector_flatten(duckdb_vector vector, unsigned long len) { - auto dvector = reinterpret_cast(vector); - dvector->Flatten(len); +void duckdb_vector_flatten(duckdb_vector vector) { + reinterpret_cast(vector)->Flatten(); } void duckdb_vx_vector_set_all_valid(duckdb_vector ffi_vector) { using enum VectorType; Vector &vector = *reinterpret_cast(ffi_vector); - const VectorType type = vector.GetVectorType(); - D_ASSERT(type != DICTIONARY_VECTOR && type != SEQUENCE_VECTOR); - switch (type) { + switch (vector.GetVectorType()) { case CONSTANT_VECTOR: return ConstantVector::Validity(vector).Reset(); case FLAT_VECTOR: - return FlatVector::Validity(vector).Reset(); + return FlatVector::ValidityMutable(vector).Reset(); case FSST_VECTOR: return FSSTVector::Validity(vector).Reset(); default: + D_ASSERT(false); __builtin_unreachable(); } } diff --git a/vortex-duckdb/cpp/vortex_duckdb.cpp b/vortex-duckdb/cpp/vortex_duckdb.cpp index 05ee9098583..8c0b7055a6e 100644 --- a/vortex-duckdb/cpp/vortex_duckdb.cpp +++ b/vortex-duckdb/cpp/vortex_duckdb.cpp @@ -4,9 +4,7 @@ #include "aggregate_fn_pushdown.hpp" #include "data.hpp" #include "error.hpp" -#include "scalar_fn_pushdown.hpp" #include "spatial_overrides.hpp" -#include "cast_pushdown.hpp" #include "vortex_duckdb.h" #include "duckdb/catalog/catalog.hpp" @@ -16,6 +14,8 @@ #include "duckdb/common/types/geometry_crs.hpp" #include "duckdb/common/types/value.hpp" #include "duckdb/common/types/vector.hpp" +#include "duckdb/common/vector/dictionary_vector.hpp" +#include "duckdb/logging/logger.hpp" #include "duckdb/main/capi/capi_internal.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/config.hpp" @@ -168,12 +168,12 @@ static unique_ptr VortexScanReplacement(ClientContext &context, auto table_function = make_uniq(); vector> children(1); - children[0] = make_uniq(Value(table_name)); + children[0] = ConstantExpression::String(table_name); table_function->function = make_uniq("read_vortex", std::move(children)); if (!FileSystem::HasGlob(table_name)) { auto &fs = FileSystem::GetFileSystem(context); - table_function->alias = fs.ExtractBaseName(table_name); + table_function->alias = Identifier(fs.ExtractBaseName(table_name)); } return table_function; @@ -197,7 +197,7 @@ extern "C" duckdb_state duckdb_vx_register_scan_replacement(duckdb_database duck // buffer_ptr is shared_ptr, two pointers long, but duckdb_vx_reusable_dict is // one pointer long, so we need a wrapper. -using Buffer = buffer_ptr; +using Buffer = buffer_ptr; struct ReusableDict { Buffer buffer; ReusableDict(Buffer buffer) : buffer(std::move(buffer)) { @@ -231,11 +231,12 @@ extern "C" void duckdb_vx_reusable_dict_set_vector(duckdb_vx_reusable_dict reusa extern "C" void duckdb_vx_vector_dictionary_reusable(duckdb_vector ffi_vector, duckdb_vx_reusable_dict reusable, - duckdb_selection_vector ffi_sel_vec) { + duckdb_selection_vector ffi_sel_vec, + idx_t sel_count) { auto vector = reinterpret_cast(ffi_vector); auto *wrapper = reinterpret_cast(reusable); auto sel_vec = reinterpret_cast(ffi_sel_vec); - vector->Dictionary(wrapper->buffer, *sel_vec); + vector->Dictionary(wrapper->buffer, *sel_vec, sel_count); } extern "C" duckdb_value duckdb_vx_value_create_null(duckdb_logical_type ty) { @@ -271,8 +272,6 @@ extern "C" duckdb_blob duckdb_vx_value_get_geometry(duckdb_value value) { } static void VortexOptimizeFunction(OptimizerExtensionInput &input, unique_ptr &plan) { - plan = TryPushdown(input.context, std::move(plan)); - plan = TryPushdown(input.context, std::move(plan)); plan = TryPushdownAggregateFunctions(input.context, std::move(plan)); } diff --git a/vortex-duckdb/patches/duckdb-mfr-finalize-scan.diff b/vortex-duckdb/patches/duckdb-mfr-finalize-scan.diff deleted file mode 100644 index d7214c7493f..00000000000 --- a/vortex-duckdb/patches/duckdb-mfr-finalize-scan.diff +++ /dev/null @@ -1,69 +0,0 @@ ---- a/src/include/duckdb/common/multi_file/multi_file_function.hpp -+++ b/src/include/duckdb/common/multi_file/multi_file_function.hpp -@@ -63,6 +63,9 @@ - virtual void GetVirtualColumns(ClientContext &context, MultiFileBindData &bind_data, virtual_column_map_t &result); - virtual unique_ptr Copy(); - virtual FileGlobInput GetGlobInput(); -+ virtual bool FinalizeScan(ClientContext &context, GlobalTableFunctionState &global_state, DataChunk &output) { -+ return false; -+ } - }; - - template -@@ -590,18 +593,30 @@ - - static OperatorPartitionData MultiFileGetPartitionData(ClientContext &context, - TableFunctionGetPartitionInput &input) { -+ if (!input.local_state) { -+ return OperatorPartitionData(0); -+ } - auto &bind_data = input.bind_data->CastNoConst(); - auto &data = input.local_state->Cast(); - auto &gstate = input.global_state->Cast(); - OperatorPartitionData partition_data(data.batch_index); -- bind_data.multi_file_reader->GetPartitionData(context, bind_data.reader_bind, *data.reader_data, -- gstate.multi_file_reader_state, input.partition_info, -- partition_data); -+ if (data.reader_data) { -+ bind_data.multi_file_reader->GetPartitionData(context, bind_data.reader_bind, *data.reader_data, -+ gstate.multi_file_reader_state, input.partition_info, -+ partition_data); -+ } - return partition_data; - } - - static void MultiFileScan(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) { - if (!data_p.local_state) { -+ auto &finalize_gstate = data_p.global_state->Cast(); -+ auto &finalize_bind_data = data_p.bind_data->CastNoConst(); -+ if (finalize_gstate.global_state && finalize_bind_data.interface && -+ finalize_bind_data.interface->FinalizeScan(context, *finalize_gstate.global_state, output)) { -+ data_p.async_result = SourceResultType::HAVE_MORE_OUTPUT; -+ return; -+ } - data_p.async_result = SourceResultType::FINISHED; - return; - } -@@ -610,6 +625,10 @@ - auto &bind_data = data_p.bind_data->CastNoConst(); - - if (gstate.finished) { -+ if (bind_data.interface->FinalizeScan(context, *gstate.global_state, output)) { -+ data_p.async_result = SourceResultType::HAVE_MORE_OUTPUT; -+ return; -+ } - data_p.async_result = SourceResultType::FINISHED; - return; - } -@@ -660,6 +679,11 @@ - } - - if (!TryInitializeNextBatch(context, bind_data, data, gstate)) { -+ if (output.size() == 0 && -+ bind_data.interface->FinalizeScan(context, *gstate.global_state, output)) { -+ data_p.async_result = SourceResultType::HAVE_MORE_OUTPUT; -+ return; -+ } - if (output.size() > 0 && data_p.results_execution_mode == AsyncResultsExecutionMode::SYNCHRONOUS) { - gstate.finished = true; - data_p.async_result = SourceResultType::HAVE_MORE_OUTPUT; diff --git a/vortex-duckdb/src/convert/dtype.rs b/vortex-duckdb/src/convert/dtype.rs index b51be89d61e..80e9eef9477 100644 --- a/vortex-duckdb/src/convert/dtype.rs +++ b/vortex-duckdb/src/convert/dtype.rs @@ -137,6 +137,10 @@ impl FromLogicalType for DType { DUCKDB_TYPE::DUCKDB_TYPE_TIMESTAMP_NS => { DType::Extension(Timestamp::new(TimeUnit::Nanoseconds, nullability).erased()) } + DUCKDB_TYPE::DUCKDB_TYPE_TIMESTAMP_TZ_NS => DType::Extension( + Timestamp::new_with_tz(TimeUnit::Nanoseconds, Some("UTC".into()), nullability) + .erased(), + ), DUCKDB_TYPE::DUCKDB_TYPE_ARRAY => { let child_type = logical_type.array_child_type(); DType::FixedSizeList( diff --git a/vortex-duckdb/src/convert/expr.rs b/vortex-duckdb/src/convert/expr.rs index a63c3478643..ae6873f1681 100644 --- a/vortex-duckdb/src/convert/expr.rs +++ b/vortex-duckdb/src/convert/expr.rs @@ -67,6 +67,7 @@ use vortex_spatial::scalar_fn::intersects::SpatialIntersects; use crate::SESSION; use crate::convert::dtype::FromLogicalType; +use crate::convert::table_filter::dynamic_filter_expr; use crate::cpp::DUCKDB_TYPE; use crate::cpp::DUCKDB_VX_EXPR_TYPE; use crate::duckdb; @@ -80,9 +81,10 @@ use crate::duckdb::ExpressionClass::BoundComparison; use crate::duckdb::ExpressionClass::BoundConjunction; use crate::duckdb::ExpressionClass::BoundConstant; use crate::duckdb::ExpressionClass::BoundRef; +use crate::duckdb::ExpressionRef; use crate::projection::DuckdbField; -fn from_bound_str(value: &duckdb::ExpressionRef) -> VortexResult { +fn from_bound_str(value: &ExpressionRef) -> VortexResult { match value.as_class().vortex_expect("unknown class") { BoundConstant(constant) => Ok(constant.value.as_string().as_str().to_owned()), _ => vortex_bail!("Expected string expression, got {:?}", value.as_class_id()), @@ -90,7 +92,7 @@ fn from_bound_str(value: &duckdb::ExpressionRef) -> VortexResult { } /// Whether the expression's return type is a `LIST` or fixed-size `ARRAY`. -fn returns_a_list(expr: &duckdb::ExpressionRef) -> bool { +fn returns_a_list(expr: &ExpressionRef) -> bool { matches!( expr.return_type().as_type_id(), DUCKDB_TYPE::DUCKDB_TYPE_LIST | DUCKDB_TYPE::DUCKDB_TYPE_ARRAY @@ -104,7 +106,7 @@ fn build_list_length(expr: Expression, nullability: Nullability) -> Expression { } /// Read an `f64` from a constant expression (the `ST_DWithin` radius); `None` for non-constants. -fn from_bound_f64(value: &duckdb::ExpressionRef) -> VortexResult> { +fn from_bound_f64(value: &ExpressionRef) -> VortexResult> { match value.as_class().vortex_expect("unknown class") { BoundConstant(constant) => Ok(Some(f64::try_from(&Scalar::try_from(constant.value)?)?)), _ => Ok(None), @@ -143,10 +145,7 @@ fn is_native_spatial_column(fields: Option<&[DuckdbField]>, name: &str) -> bool /// Lower a spatial operand: a `GEOMETRY` literal arrives as WKB, decoded once to its native type so the /// pushed `SpatialDistance` stays native; a column must be native geometry. `None` skips the push. -fn spatial_operand( - value: &duckdb::ExpressionRef, - ctx: ConvertCtx<'_>, -) -> VortexResult> { +fn spatial_operand(value: &ExpressionRef, ctx: ConvertCtx<'_>) -> VortexResult> { match value.as_class() { Some(BoundConstant(constant)) => { let scalar = Scalar::try_from(constant.value)?; @@ -174,7 +173,7 @@ fn spatial_operand( /// Lower all geometry operands of a spatial function. Returns `None`, skipping the push, when any /// operand is neither a constant geometry nor a native geometry column. fn spatial_operands( - children: &[&duckdb::ExpressionRef], + children: &[&ExpressionRef], ctx: ConvertCtx<'_>, ) -> VortexResult>> { children @@ -248,6 +247,19 @@ fn try_from_bound_function( func: &BoundFunction, ctx: ConvertCtx<'_>, ) -> VortexResult> { + if let Some(child) = func.optional() { + return try_from_expression_inner(child, ctx).or_else(|_| Ok(None)); + }; + if let Some(dynamic) = func.dynamic() { + let children: Vec<_> = func.children().collect(); + vortex_ensure_eq!(children.len(), 1); + let dtype = DType::from_logical_type(children[0].return_type(), Nullability::Nullable)?; + let Some(child) = try_from_expression_inner(children[0], ctx)? else { + return Ok(None); + }; + return Ok(Some(dynamic_filter_expr(dynamic, dtype, child)?)); + } + let expr = match func.scalar_function.name() { "strlen" => { let children: Vec<_> = func.children().collect(); @@ -332,7 +344,6 @@ fn try_from_bound_function( return Ok(None); } } - // Spatial UDFs are handled here; non-spatial names return `None` inside. name => return try_from_spatial_function(name, func, ctx), }; @@ -340,7 +351,7 @@ fn try_from_bound_function( } pub fn try_from_bound_expression( - value: &duckdb::ExpressionRef, + value: &ExpressionRef, fields: &[DuckdbField], ) -> VortexResult> { try_from_expression_inner( @@ -353,7 +364,7 @@ pub fn try_from_bound_expression( } pub(super) fn try_from_bound_expression_with_col_sub( - value: &duckdb::ExpressionRef, + value: &ExpressionRef, col_sub: &Expression, ) -> VortexResult> { // No fields: scan-time table filters never carry spatial functions, because @@ -398,7 +409,7 @@ fn can_push_cast(cast: &duckdb::BoundCast<'_>, target: &duckdb::LogicalTypeRef) // Example: we support CAST but not TRY_CAST. // Example: optional filters may fail to parse on our side (we return // Ok(None)), so we don't allow pushing these. -pub fn can_push_expression(value: &duckdb::ExpressionRef) -> bool { +pub fn can_push_expression(value: &ExpressionRef) -> bool { let Some(class) = value.as_class() else { return false; }; @@ -463,7 +474,7 @@ fn list_length_on_field(field: &DuckdbField) -> Expression { } pub fn try_from_projection_expression( - value: &duckdb::ExpressionRef, + value: &ExpressionRef, field: &DuckdbField, ) -> VortexResult> { let Some(class) = value.as_class() else { @@ -556,7 +567,7 @@ impl PushedAggregate { /// Check if this is an aggregate function we can handle in Vortex pub fn try_from_projection_aggregate( - expr: &duckdb::ExpressionRef, + expr: &ExpressionRef, ) -> VortexResult> { let Some(expr) = expr.as_class() else { return Ok(None); @@ -578,7 +589,7 @@ pub fn try_from_projection_aggregate( // If you want to add support for other expressions, also change // can_push_expression fn try_from_expression_inner( - value: &duckdb::ExpressionRef, + value: &ExpressionRef, ctx: ConvertCtx<'_>, ) -> VortexResult> { let Some(class) = value.as_class() else { diff --git a/vortex-duckdb/src/convert/table_filter.rs b/vortex-duckdb/src/convert/table_filter.rs index ed5763ce870..1ea7798f9a9 100644 --- a/vortex-duckdb/src/convert/table_filter.rs +++ b/vortex-duckdb/src/convert/table_filter.rs @@ -5,6 +5,7 @@ use std::ops::Range; use std::sync::Arc; use itertools::Itertools; +use tracing::debug; use vortex::buffer::Buffer; use vortex::dtype::DType; use vortex::dtype::Nullability; @@ -29,6 +30,9 @@ use vortex::scan::strict_sorted_buffer::StrictSortedBuffer; use super::expr::try_from_bound_expression_with_col_sub; use crate::cpp::DUCKDB_VX_EXPR_TYPE; +use crate::duckdb::DynamicFilter; +use crate::duckdb::ExpressionClass; +use crate::duckdb::ExpressionRef; use crate::duckdb::ExtractedValue; use crate::duckdb::TableFilterClass; use crate::duckdb::TableFilterRef; @@ -93,36 +97,7 @@ pub fn try_from_table_filter( in_list(col.clone(), lit(list_scalar)) } TableFilterClass::Dynamic(dynamic) => { - let op = match dynamic.operator { - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_EQUAL => CompareOperator::Eq, - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_NOTEQUAL => CompareOperator::NotEq, - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHAN => CompareOperator::Lt, - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHAN => CompareOperator::Gt, - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHANOREQUALTO => { - CompareOperator::Lte - } - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHANOREQUALTO => { - CompareOperator::Gte - } - _ => vortex_bail!( - "unsupported dynamic filter operator: {:?}", - dynamic.operator - ), - }; - let data = dynamic.data; - - vortex::expr::dynamic( - op, - move || { - let value = data.latest()?; - let scalar = Scalar::try_from(&*value) - .vortex_expect("failed to convert dynamic filter value to scalar"); - scalar.into_value() - }, - col.return_dtype(scope_dtype)?, - true, // If there is no value, we say that all rows pass the dynamic filter. - col.clone(), - ) + dynamic_filter_expr(dynamic, col.return_dtype(scope_dtype)?, col.clone())? } TableFilterClass::ExpressionRef(expr) => { match try_from_bound_expression_with_col_sub(expr, col)? { @@ -136,6 +111,40 @@ pub fn try_from_table_filter( })) } +/// A filter expression that rereads shared dynamic filter value on every +/// evaluation. +pub(super) fn dynamic_filter_expr( + dynamic: DynamicFilter, + dtype: DType, + child: Expression, +) -> VortexResult { + let op = match dynamic.operator { + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_EQUAL => CompareOperator::Eq, + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_NOTEQUAL => CompareOperator::NotEq, + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHAN => CompareOperator::Lt, + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHAN => CompareOperator::Gt, + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHANOREQUALTO => CompareOperator::Lte, + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHANOREQUALTO => { + CompareOperator::Gte + } + _ => vortex_bail!("unsupported dynamic filter operator {:?}", dynamic.operator), + }; + let data = dynamic.data; + + Ok(vortex::expr::dynamic( + op, + move || { + let value = data.latest()?; + let scalar = Scalar::try_from(&*value) + .vortex_expect("failed to convert dynamic filter value to scalar"); + scalar.into_value() + }, + dtype, + true, // If there is no value, we say that all rows pass the dynamic filter. + child, + )) +} + fn nonnegative_number_from_value(value: &ValueRef) -> VortexResult { match value.extract() { ExtractedValue::BigInt(i) => { @@ -150,6 +159,21 @@ fn nonnegative_number_from_value(value: &ValueRef) -> VortexResult { } } +fn row_range_from_comparison(operator: DUCKDB_VX_EXPR_TYPE, n: u64) -> Option> { + match operator { + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_EQUAL => Some(n..n + 1), + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHANOREQUALTO => Some(n..u64::MAX), + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHAN => { + Some(n.saturating_add(1)..u64::MAX) + } + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHANOREQUALTO => { + Some(0..n.saturating_add(1)) + } + DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHAN => Some(0..n), + _ => None, + } +} + fn intersect_sorted(left: &[u64], right: &[u64]) -> Vec { let mut result = Vec::new(); let (mut i, mut j) = (0, 0); @@ -167,6 +191,52 @@ fn intersect_sorted(left: &[u64], right: &[u64]) -> Vec { result } +/// Since 2.0 some filters are ExpressionRef instead of TableFilterRef +fn try_from_v2_virtual_column_filter( + expr: &ExpressionRef, +) -> VortexResult<(Selection, Option>)> { + let Some(ExpressionClass::BoundFunction(bfn)) = expr.as_class() else { + return Ok((Selection::All, None)); + }; + let Some(inner) = bfn.optional() else { + return Ok((Selection::All, None)); + }; + match inner.as_class() { + Some(ExpressionClass::BoundOperator(op)) + if op.op == DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_IN => + { + let indices = op + .children() + .skip(1) // first child is the column which we know already + .map(|child| match child.as_class() { + Some(ExpressionClass::BoundConstant(constant)) => { + nonnegative_number_from_value(constant.value).ok() + } + _ => None, + }) + .collect::>>(); + let Some(mut indices) = indices.filter(|indices| !indices.is_empty()) else { + return Ok((Selection::All, None)); + }; + indices.sort_unstable(); + indices.dedup(); + Ok(( + Selection::IncludeByIndex(StrictSortedBuffer::try_new(Buffer::from_iter(indices))?), + None, + )) + } + Some(ExpressionClass::BoundComparison(cmp)) => { + if let Some(ExpressionClass::BoundConstant(constant)) = cmp.right.as_class() + && let Ok(n) = nonnegative_number_from_value(constant.value) + { + return Ok((Selection::All, row_range_from_comparison(cmp.op, n))); + } + Ok((Selection::All, None)) + } + _ => Ok((Selection::All, None)), + } +} + /// For constant comparison on IN filters over file_index or file_row_number /// virtual column, create a selection and a range covering the same range as /// expressions do. @@ -174,6 +244,7 @@ pub fn try_from_virtual_column_filter( filter: &TableFilterRef, ) -> VortexResult<(Selection, Option>)> { match filter.as_class() { + TableFilterClass::ExpressionRef(expr) => try_from_v2_virtual_column_filter(expr), TableFilterClass::InFilter(values) => { let indices = values .iter() @@ -186,21 +257,10 @@ pub fn try_from_virtual_column_filter( } TableFilterClass::ConstantComparison(const_) => { let n = nonnegative_number_from_value(const_.value)?; - let range = match const_.operator { - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_EQUAL => Some(n..n + 1), - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHANOREQUALTO => { - Some(n..u64::MAX) - } - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_GREATERTHAN => { - Some(n.saturating_add(1)..u64::MAX) - } - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHANOREQUALTO => { - Some(0..n.saturating_add(1)) - } - DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_COMPARE_LESSTHAN => Some(0..n), - _ => None, - }; - Ok((Selection::All, range)) + Ok(( + Selection::All, + row_range_from_comparison(const_.operator, n), + )) } TableFilterClass::ConjunctionAnd(conj) => { let mut start = 0u64; @@ -228,9 +288,13 @@ pub fn try_from_virtual_column_filter( .unwrap_or(Selection::All); Ok((sel, range)) } - TableFilterClass::Optional(child) => { - try_from_virtual_column_filter(child).or_else(|_| Ok((Selection::All, None))) + TableFilterClass::Optional(child) => try_from_virtual_column_filter(child).or_else(|_| { + debug!("rejecting unknown optional filter {child:?}"); + Ok((Selection::All, None)) + }), + _ => { + debug!("rejecting unknown filter {filter:?}"); + Ok((Selection::All, None)) } - _ => Ok((Selection::All, None)), } } diff --git a/vortex-duckdb/src/convert/vector.rs b/vortex-duckdb/src/convert/vector.rs index 117de0a4886..fccbbd0ae88 100644 --- a/vortex-duckdb/src/convert/vector.rs +++ b/vortex-duckdb/src/convert/vector.rs @@ -50,6 +50,7 @@ use crate::cpp::duckdb_timestamp_ms; use crate::cpp::duckdb_timestamp_ns; use crate::cpp::duckdb_timestamp_s; use crate::duckdb::DataChunkRef; +use crate::duckdb::ValidityRef; use crate::duckdb::VectorRef; use crate::exporter::precision_to_duckdb_storage_size; @@ -91,6 +92,19 @@ fn vector_i128_values(vector: &VectorRef, len: usize) -> impl TrustedLen( + values: impl TrustedLen, + validity: &ValidityRef<'_>, +) -> Buffer { + Buffer::from_trusted_len_iter(values.enumerate().map(|(i, v)| { + if validity.is_valid(i) { + v + } else { + T::default() + } + })) +} + fn vector_mapped P>( vector: &VectorRef, len: usize, @@ -304,8 +318,8 @@ pub fn flat_vector_to_vortex(vector: &VectorRef, len: usize) -> VortexResult VortexResult(len); if DecimalType::smallest_decimal_value_type(&decimal_dtype) == DecimalType::I8 { // Lossy conversion is defined behavior in Rust so this is fine - let buf = - Buffer::::from_trusted_len_iter(data.iter().map(|&v| v.as_())); + let buf = buffer_zeroing_invalid( + data.iter().map(|&v| -> i8 { v.as_() }), + &validity_ref, + ); DecimalArray::try_new(buf, decimal_dtype, validity) } else { - DecimalArray::try_new(Buffer::copy_from(data), decimal_dtype, validity) + DecimalArray::try_new( + buffer_zeroing_invalid(data.iter().copied(), &validity_ref), + decimal_dtype, + validity, + ) } } DecimalType::I32 => { let data = vector.as_slice_with_len::(len); - DecimalArray::try_new(Buffer::copy_from(data), decimal_dtype, validity) + DecimalArray::try_new( + buffer_zeroing_invalid(data.iter().copied(), &validity_ref), + decimal_dtype, + validity, + ) } DecimalType::I64 => { let data = vector.as_slice_with_len::(len); - DecimalArray::try_new(Buffer::copy_from(data), decimal_dtype, validity) + DecimalArray::try_new( + buffer_zeroing_invalid(data.iter().copied(), &validity_ref), + decimal_dtype, + validity, + ) } DecimalType::I128 => { - let data = Buffer::from_iter(vector_i128_values(vector, len)); + let data = + buffer_zeroing_invalid(vector_i128_values(vector, len), &validity_ref); DecimalArray::try_new(data, decimal_dtype, validity) } _ => vortex_bail!("Unsupported decimal precision: {precision}"), @@ -414,7 +443,7 @@ pub fn data_chunk_to_vortex( let columns = (0..chunk.column_count()) .map(|i| { let vector = chunk.get_vector(i); - vector.flatten(len); + vector.flatten(); flat_vector_to_vortex(vector, len.as_()) }) .collect::>>()?; diff --git a/vortex-duckdb/src/duckdb/expr.rs b/vortex-duckdb/src/duckdb/expr.rs index 61dbbab5dcf..5033fc8c56e 100644 --- a/vortex-duckdb/src/duckdb/expr.rs +++ b/vortex-duckdb/src/duckdb/expr.rs @@ -11,6 +11,8 @@ use crate::cpp::duckdb_vx_expr_class; use crate::duckdb::AggregateFunction; use crate::duckdb::AggregateFunctionRef; use crate::duckdb::DDBString; +use crate::duckdb::DynamicFilter; +use crate::duckdb::DynamicFilterData; use crate::duckdb::LogicalType; use crate::duckdb::LogicalTypeRef; use crate::duckdb::ScalarFunction; @@ -45,14 +47,6 @@ impl ExpressionRef { pub fn as_class(&self) -> Option> { Some( match unsafe { cpp::duckdb_vx_expr_get_class(self.as_ptr()) } { - cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_CAST => { - let child = unsafe { - Expression::borrow(cpp::duckdb_vx_expr_get_bound_cast_child(self.as_ptr())) - }; - let is_try = - unsafe { cpp::duckdb_vx_expr_get_bound_cast_is_try(self.as_ptr()) }; - ExpressionClass::BoundCast(BoundCast { child, is_try }) - } cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_COLUMN_REF => { let name = unsafe { let ptr = cpp::duckdb_vx_expr_get_bound_column_ref_get_name(self.as_ptr()); @@ -85,42 +79,6 @@ impl ExpressionRef { op: out.type_, }) } - cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_COMPARISON => { - let mut out = cpp::duckdb_vx_expr_bound_comparison { - left: ptr::null_mut(), - right: ptr::null_mut(), - type_: cpp::DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_INVALID, - }; - unsafe { - cpp::duckdb_vx_expr_get_bound_comparison(self.as_ptr(), &raw mut out) - }; - - ExpressionClass::BoundComparison(BoundComparison { - left: unsafe { Expression::borrow(out.left) }, - right: unsafe { Expression::borrow(out.right) }, - op: out.type_, - }) - } - cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_BETWEEN => { - let mut out = cpp::duckdb_vx_expr_bound_between { - input: ptr::null_mut(), - lower: ptr::null_mut(), - upper: ptr::null_mut(), - lower_inclusive: false, - upper_inclusive: false, - }; - unsafe { - cpp::duckdb_vx_expr_get_bound_between(self.as_ptr(), &raw mut out); - } - - ExpressionClass::BoundBetween(BoundBetween { - input: unsafe { Expression::borrow(out.input) }, - lower: unsafe { Expression::borrow(out.lower) }, - upper: unsafe { Expression::borrow(out.upper) }, - lower_inclusive: out.lower_inclusive, - upper_inclusive: out.upper_inclusive, - }) - } cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_OPERATOR => { let mut out = cpp::duckdb_vx_expr_bound_operator { children: ptr::null_mut(), @@ -138,21 +96,70 @@ impl ExpressionRef { }) } cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_FUNCTION => { - let mut out = cpp::duckdb_vx_expr_bound_function { - children: ptr::null_mut(), - children_count: 0, - scalar_function: ptr::null_mut(), - bind_info: ptr::null_mut(), - }; - unsafe { cpp::duckdb_vx_expr_get_bound_function(self.as_ptr(), &raw mut out) }; + if unsafe { cpp::duckdb_vx_expr_is_comparison(self.as_ptr()) } { + let mut out = cpp::duckdb_vx_expr_bound_comparison { + left: ptr::null_mut(), + right: ptr::null_mut(), + type_: cpp::DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_INVALID, + }; + unsafe { + cpp::duckdb_vx_expr_get_bound_comparison(self.as_ptr(), &raw mut out) + }; - let children = - unsafe { std::slice::from_raw_parts(out.children, out.children_count) }; + ExpressionClass::BoundComparison(BoundComparison { + left: unsafe { Expression::borrow(out.left) }, + right: unsafe { Expression::borrow(out.right) }, + op: out.type_, + }) + } else if unsafe { cpp::duckdb_vx_expr_is_between(self.as_ptr()) } { + let mut out = cpp::duckdb_vx_expr_bound_between { + input: ptr::null_mut(), + lower: ptr::null_mut(), + upper: ptr::null_mut(), + lower_inclusive: false, + upper_inclusive: false, + }; + unsafe { + cpp::duckdb_vx_expr_get_bound_between(self.as_ptr(), &raw mut out); + } - ExpressionClass::BoundFunction(BoundFunction { - children, - scalar_function: unsafe { ScalarFunction::borrow(out.scalar_function) }, - }) + ExpressionClass::BoundBetween(BoundBetween { + input: unsafe { Expression::borrow(out.input) }, + lower: unsafe { Expression::borrow(out.lower) }, + upper: unsafe { Expression::borrow(out.upper) }, + lower_inclusive: out.lower_inclusive, + upper_inclusive: out.upper_inclusive, + }) + } else if unsafe { cpp::duckdb_vx_expr_is_cast(self.as_ptr()) } { + let child = unsafe { + Expression::borrow(cpp::duckdb_vx_expr_get_bound_cast_child( + self.as_ptr(), + )) + }; + let is_try = + unsafe { cpp::duckdb_vx_expr_get_bound_cast_is_try(self.as_ptr()) }; + ExpressionClass::BoundCast(BoundCast { child, is_try }) + } else { + let mut out = cpp::duckdb_vx_expr_bound_function { + children: ptr::null_mut(), + children_count: 0, + scalar_function: ptr::null_mut(), + bind_info: ptr::null_mut(), + }; + unsafe { + cpp::duckdb_vx_expr_get_bound_function(self.as_ptr(), &raw mut out) + }; + + let children = + unsafe { std::slice::from_raw_parts(out.children, out.children_count) }; + + let expr = self; + ExpressionClass::BoundFunction(BoundFunction { + children, + expr, + scalar_function: unsafe { ScalarFunction::borrow(out.scalar_function) }, + }) + } } cpp::DUCKDB_VX_EXPR_CLASS::DUCKDB_VX_EXPR_CLASS_BOUND_AGGREGATE => { let aggregate_function = unsafe { @@ -247,6 +254,7 @@ impl<'a> BoundOperator<'a> { pub struct BoundFunction<'a> { children: &'a [cpp::duckdb_vx_expr], + expr: &'a ExpressionRef, pub scalar_function: &'a ScalarFunctionRef, } @@ -257,4 +265,31 @@ impl<'a> BoundFunction<'a> { .iter() .map(|&child| unsafe { Expression::borrow(child) }) } + + /// If this bound function is an "optional" or "selectivity optional" + /// filter, return child expression inside optional filter. + pub fn optional(&self) -> Option<&'a ExpressionRef> { + let ptr = unsafe { cpp::duckdb_vx_expr_get_bound_optional(self.expr.as_ptr()) }; + if ptr.is_null() { + return None; + } + Some(unsafe { Expression::borrow(ptr) }) + } + + /// If this bound function is an dynamic filter, return child expression + /// inside dynamic filter. + pub fn dynamic(&self) -> Option { + let mut out = cpp::duckdb_vx_table_filter_dynamic { + data: ptr::null_mut(), + comparison_type: cpp::DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_INVALID, + }; + unsafe { cpp::duckdb_vx_expr_get_bound_dynamic(self.expr.as_ptr(), &raw mut out) }; + if out.data.is_null() { + return None; + } + Some(DynamicFilter { + data: unsafe { DynamicFilterData::own(out.data) }, + operator: out.comparison_type, + }) + } } diff --git a/vortex-duckdb/src/duckdb/reusable_dict.rs b/vortex-duckdb/src/duckdb/reusable_dict.rs index a4ce9f77947..70f9ae6022b 100644 --- a/vortex-duckdb/src/duckdb/reusable_dict.rs +++ b/vortex-duckdb/src/duckdb/reusable_dict.rs @@ -11,7 +11,7 @@ use crate::lifetime_wrapper; lifetime_wrapper!( /// A reusable dictionary buffer that can be used to efficiently create dictionary vectors. /// - /// This wraps DuckDB's `buffer_ptr` which is created by + /// This wraps DuckDB's `buffer_ptr` which is created by /// `DictionaryVector::CreateReusableDictionary` and can be reused with /// `Vector::Dictionary` to create dictionary vectors without copying the values. ReusableDict, @@ -62,12 +62,18 @@ impl VectorRef { /// /// This is more efficient than `dictionary` when the same dictionary values are /// used multiple times with different selection vectors. - pub fn reuse_dictionary(&mut self, reusable: &ReusableDict, sel_vec: &SelectionVector) { + pub fn reuse_dictionary( + &mut self, + reusable: &ReusableDict, + sel_vec: &SelectionVector, + sel_count: usize, + ) { unsafe { cpp::duckdb_vx_vector_dictionary_reusable( self.as_ptr(), reusable.as_ptr(), sel_vec.as_ptr(), + sel_count as _, ) } } diff --git a/vortex-duckdb/src/duckdb/table_filter.rs b/vortex-duckdb/src/duckdb/table_filter.rs index c8c8f0c1a68..79468315144 100644 --- a/vortex-duckdb/src/duckdb/table_filter.rs +++ b/vortex-duckdb/src/duckdb/table_filter.rs @@ -161,7 +161,6 @@ impl TableFilterRef { comparison_type: cpp::DUCKDB_VX_EXPR_TYPE::DUCKDB_VX_EXPR_TYPE_INVALID, }; unsafe { cpp::duckdb_vx_table_filter_get_dynamic(self.as_ptr(), &raw mut out) }; - TableFilterClass::Dynamic(DynamicFilter { data: unsafe { DynamicFilterData::own(out.data) }, operator: out.comparison_type, diff --git a/vortex-duckdb/src/duckdb/vector.rs b/vortex-duckdb/src/duckdb/vector.rs index 47cad049516..1965a34351b 100644 --- a/vortex-duckdb/src/duckdb/vector.rs +++ b/vortex-duckdb/src/duckdb/vector.rs @@ -117,8 +117,8 @@ impl VectorRef { } /// Converts a vector into a flat uncompressed vector vortex call this `canonicalize`. - pub fn flatten(&self, length: u64) { - unsafe { cpp::duckdb_vector_flatten(self.as_ptr(), length) } + pub fn flatten(&self) { + unsafe { cpp::duckdb_vector_flatten(self.as_ptr()) } } // NOTE(ngates): vector doesn't hold its own length. Which makes writing a safe @@ -151,8 +151,21 @@ impl VectorRef { !is_valid } - pub unsafe fn set_vector_buffer(&mut self, buffer: &VectorBufferRef) { - unsafe { cpp::duckdb_vx_vector_set_vector_data_buffer(self.as_ptr(), buffer.as_ptr()) } + pub unsafe fn set_vector_buffer( + &mut self, + buffer: &VectorBufferRef, + data_ptr: *const T, + capacity: usize, + ) { + unsafe { + cpp::duckdb_vx_vector_set_vector_data_buffer( + self.as_ptr(), + buffer.as_ptr(), + data_ptr as *mut c_void, + capacity as _, + size_of::() as _, + ) + } } pub fn add_string_vector_buffer(&mut self, buffer: &VectorBufferRef) { @@ -161,11 +174,6 @@ impl VectorRef { } } - /// Sets the data pointer for the vector. This is the start of the values array in the vector. - pub unsafe fn set_data_ptr(&mut self, ptr: *mut T) { - unsafe { cpp::duckdb_vx_vector_set_data_ptr(self.as_ptr(), ptr as *mut c_void) } - } - /// Sets the validity data for the vector from a [`ValidityData`]. The buffer is /// attached purely as a keep-alive, and the data pointer is used as the validity data /// at the given `u64_offset`. @@ -604,7 +612,7 @@ mod tests { sel_slice[2] = 0; vector.dictionary(&dict, 2, &sel_vec, 3); - vector.flatten(3); + vector.flatten(); assert_eq!(vector.as_slice_with_len::(3), &[100, 200, 100]); } diff --git a/vortex-duckdb/src/e2e_test/mod.rs b/vortex-duckdb/src/e2e_test/mod.rs index 695555edc3e..9abf6d12944 100644 --- a/vortex-duckdb/src/e2e_test/mod.rs +++ b/vortex-duckdb/src/e2e_test/mod.rs @@ -3,7 +3,7 @@ #[cfg(test)] mod s3_test; -#[cfg(test)] +#[cfg(all(test, duckdb_release))] mod spatial_pushdown_test; #[cfg(test)] mod vortex_scan_test; diff --git a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs index 265821842ba..42002731de0 100644 --- a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs +++ b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs @@ -1063,13 +1063,6 @@ fn test_vortex_encodings_roundtrip() { assert_eq!(fixed_child_values, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); } -// Spatial extension is not bundled with duckdb. If we're building from a -// commit, don't run this test, since bundling spatial requires openssl-dev -// which is an issue on macos runners. -#[cfg_attr( - not(duckdb_release), - ignore = "spatial extension requires a release DuckDB build" -)] #[test] fn test_fastlanes_rle_roundtrip() { let expected: Vec = (0i32..2048).map(|i| i / 256).collect(); @@ -1084,6 +1077,13 @@ fn test_fastlanes_rle_roundtrip() { assert_eq!(values, expected); } +// Spatial extension is not bundled with duckdb. If we're building from a +// commit, don't run this test, since bundling spatial requires openssl-dev +// which is an issue on macos runners. +#[cfg_attr( + not(duckdb_release), + ignore = "spatial extension requires a release DuckDB build" +)] #[test] fn test_geometry() { let file = RUNTIME.block_on(async { diff --git a/vortex-duckdb/src/exporter/decimal.rs b/vortex-duckdb/src/exporter/decimal.rs index 4c02a575ffc..e8cafa63539 100644 --- a/vortex-duckdb/src/exporter/decimal.rs +++ b/vortex-duckdb/src/exporter/decimal.rs @@ -109,9 +109,7 @@ impl ColumnExporter for DecimalZeroCopyExporter { assert!(self.values.len() >= offset + len); let pos = unsafe { self.values.as_ptr().add(offset) }; - unsafe { vector.set_vector_buffer(&self.shared_buffer) }; - // While we are setting a *mut T this is an artifact of the C API, this is in fact const. - unsafe { vector.set_data_ptr(pos as *mut D) }; + unsafe { vector.set_vector_buffer(&self.shared_buffer, pos, len) }; Ok(()) } diff --git a/vortex-duckdb/src/exporter/dict.rs b/vortex-duckdb/src/exporter/dict.rs index 50020e21439..e0dcd6413cc 100644 --- a/vortex-duckdb/src/exporter/dict.rs +++ b/vortex-duckdb/src/exporter/dict.rs @@ -124,7 +124,7 @@ impl> ColumnExporter for DictExporter { *dst = src } - vector.reuse_dictionary(&self.values, &sel_vec); + vector.reuse_dictionary(&self.values, &sel_vec, len); Ok(()) } diff --git a/vortex-duckdb/src/exporter/fixed_size_list.rs b/vortex-duckdb/src/exporter/fixed_size_list.rs index 62a8a29ecbd..75cb1b824a1 100644 --- a/vortex-duckdb/src/exporter/fixed_size_list.rs +++ b/vortex-duckdb/src/exporter/fixed_size_list.rs @@ -84,7 +84,7 @@ impl ColumnExporter for FixedSizeListExporter { // (namely UTF-8 string views in dictionaries) are materialized. // See https://github.com/vortex-data/vortex/pull/4610#issuecomment-3286676825 for a // detailed explanation on why we need this for now. - elements_vector.flatten((len * list_size) as u64); + elements_vector.flatten(); Ok(()) } @@ -226,7 +226,7 @@ mod tests { // All lists should be null. let vector = chunk.get_vector(0); - vector.flatten(chunk.len()); + vector.flatten(); assert_nulls(vector, &[false, false, false]); } diff --git a/vortex-duckdb/src/exporter/mod.rs b/vortex-duckdb/src/exporter/mod.rs index ddc009fa64a..bd1b2189cd7 100644 --- a/vortex-duckdb/src/exporter/mod.rs +++ b/vortex-duckdb/src/exporter/mod.rs @@ -326,7 +326,7 @@ mod tests { assert!(all_null); - vector.flatten(len as u64); + vector.flatten(); for i in 0..10 { assert!(vector.row_is_null(i)); @@ -364,7 +364,7 @@ mod tests { assert!(all_null); - vector.flatten(LEN as u64); + vector.flatten(); for i in 0..10 { assert!(vector.row_is_null(i)); } diff --git a/vortex-duckdb/src/exporter/primitive.rs b/vortex-duckdb/src/exporter/primitive.rs index 0a4a8592399..7590464c9c8 100644 --- a/vortex-duckdb/src/exporter/primitive.rs +++ b/vortex-duckdb/src/exporter/primitive.rs @@ -54,9 +54,7 @@ impl ColumnExporter for PrimitiveExporter { assert!(self.len >= offset + len); let pos = unsafe { self.start.add(offset) }; - unsafe { vector.set_vector_buffer(&self.shared_buffer) }; - // While we are setting a *mut T this is an artifact of the C API, this is in fact const. - unsafe { vector.set_data_ptr(pos as *mut T) }; + unsafe { vector.set_vector_buffer(&self.shared_buffer, pos, len) }; Ok(()) } diff --git a/vortex-duckdb/src/exporter/rle.rs b/vortex-duckdb/src/exporter/rle.rs index aa2f12ecabf..7716f4f9ad6 100644 --- a/vortex-duckdb/src/exporter/rle.rs +++ b/vortex-duckdb/src/exporter/rle.rs @@ -111,7 +111,7 @@ where pos += take; } - vector.reuse_dictionary(&self.values, &selection_vec); + vector.reuse_dictionary(&self.values, &selection_vec, len); Ok(()) } } @@ -150,7 +150,7 @@ mod tests { )?; chunk.set_len(len); let vector = chunk.get_vector(0); - vector.flatten(len as u64); + vector.flatten(); Ok(vector.as_slice_with_len::(len).to_vec()) } @@ -278,7 +278,7 @@ mod tests { chunk.set_len(1024); let vector = chunk.get_vector(0); - vector.flatten(1024); + vector.flatten(); let slice = vector.as_slice_with_len::(1024); for (i, expected) in source.iter().enumerate() { if let Some(v) = expected { diff --git a/vortex-duckdb/src/exporter/run_end.rs b/vortex-duckdb/src/exporter/run_end.rs index f252866ef3c..fbe0120850a 100644 --- a/vortex-duckdb/src/exporter/run_end.rs +++ b/vortex-duckdb/src/exporter/run_end.rs @@ -119,7 +119,7 @@ impl ColumnExporter for RunEndExporter { } debug_assert!(sel_vec_slice.is_empty()); - vector.reuse_dictionary(&self.values_dict, &sel_vec); + vector.reuse_dictionary(&self.values_dict, &sel_vec, len); Ok(()) } } diff --git a/vortex-duckdb/src/projection.rs b/vortex-duckdb/src/projection.rs index adecd2dbbdf..8a29293f8a8 100644 --- a/vortex-duckdb/src/projection.rs +++ b/vortex-duckdb/src/projection.rs @@ -25,6 +25,7 @@ use vortex_utils::aliases::hash_set::HashSet; use crate::convert::try_from_table_filter; use crate::convert::try_from_virtual_column_filter; +use crate::duckdb::ExpressionClass; use crate::duckdb::LogicalType; use crate::duckdb::TableFilterClass; use crate::duckdb::TableFilterSetRef; @@ -218,7 +219,14 @@ impl Filter { let idx_u: usize = idx.as_(); !is_virtual_column(column_ids[idx_u]) }) { - has_non_optional_filter |= !matches!(ex.as_class(), TableFilterClass::Optional(_)); + has_non_optional_filter |= match ex.as_class() { + TableFilterClass::Optional(_) => false, + TableFilterClass::ExpressionRef(expr) => match expr.as_class() { + Some(ExpressionClass::BoundFunction(bfn)) => bfn.optional().is_none(), + _ => true, + }, + _ => true, + }; let idx_u: usize = idx.as_(); let col_idx: usize = column_ids[idx_u].as_(); diff --git a/vortex-duckdb/src/table_function.rs b/vortex-duckdb/src/table_function.rs index 197057b80f3..ed751b1d64b 100644 --- a/vortex-duckdb/src/table_function.rs +++ b/vortex-duckdb/src/table_function.rs @@ -32,8 +32,6 @@ use vortex::expr::BoundExpression; use vortex::expr::Expression; use vortex::metrics::tracing::get_global_labels; use vortex::scalar::Scalar; -use vortex::scalar_fn::fns::binary::Binary; -use vortex::scalar_fn::fns::operators::Operator; use vortex_utils::aliases::hash_map::HashMap; use crate::convert::PushedAggregate; @@ -425,35 +423,15 @@ pub fn pushdown_complex_filter( return Ok(false); }; - // Duckdb calls pushdown_complex_filter during planning phase. - // If all filters are pushed down, duckdb enables a LEFT_DELIM_JOIN -> - // COMPARISON_JOIN (HASH_JOIN) optimization: - // duckdb/src/optimizer/deliminator.cpp: Deliminator::HasSelection, - // Deliminator::Optimize. - // - // This leads to a massive regression on tpch sf=10 q17 and other - // benchmarks. - // - // This bug is reported to Duckdb - // https://github.com/duckdb/duckdb/issues/22669 - // - // As a hack, report equality filters as not pushed. - // We can also report only the first filter as not pushed, but this - // has a negative performance impact. - let report_pushed = !expr - .as_opt::() - .map(|op| *op == Operator::Eq) - .unwrap_or(false); - // Only table filters may be optional, any complex filter is // non-optional by definition. bind_data .has_non_optional_filter .store(true, Ordering::Relaxed); - debug!(%expr, report_pushed, "pushed down expression"); + debug!(%expr, "pushed down expression"); bind_data.filters.push(expr); - Ok(report_pushed) + Ok(true) } pub fn pushdown_projection_expression( diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q1.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q1.slt.no index 4ca97a1f0d6..9ffe7878745 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q1.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q1.slt.no @@ -218,7 +218,8 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q10.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q10.slt.no index 0ae0d8253cf..c64baa26032 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q10.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q10.slt.no @@ -164,7 +164,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT memory.main.hits.UserID)" + "Order By": "u" } } ], @@ -181,34 +181,71 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.MobilePhoneModel != \"\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Expressions": [ + "UserID", + "MobilePhoneModel" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "MobilePhoneModel", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "100000" + } + } + ], "extra_info": { - "Filters": "($.MobilePhoneModel != \"\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200000" + "Groups": "#0", + "Expressions": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Expressions": [ - "UserID", - "MobilePhoneModel" + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "50000" } } ], "extra_info": { - "Groups": "MobilePhoneModel", - "Expressions": "count(DISTINCT UserID)", - "Estimated Cardinality": "126424" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "50000" } } ], @@ -217,7 +254,7 @@ logical_opt [ "MobilePhoneModel", "u" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "50000" } } ], @@ -238,38 +275,61 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.MobilePhoneModel != \"\")", + "Projections": [ + "UserID", + "MobilePhoneModel" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Projections": [ + "MobilePhoneModel", + "UserID" + ], + "Estimated Cardinality": "200000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.MobilePhoneModel != \"\")", - "Projections": [ - "UserID", - "MobilePhoneModel" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Aggregates": "", + "Estimated Cardinality": "100000" } } ], "extra_info": { - "Projections": [ - "MobilePhoneModel", - "UserID" - ], - "Estimated Cardinality": "200000" + "Projections": "#0", + "Estimated Cardinality": "100000" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "count(DISTINCT #1)", - "Estimated Cardinality": "126424" + "Aggregates": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Top": "10", - "Order By": "count(DISTINCT memory.main.hits.UserID) DESC" + "Order By": "u DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q11.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q11.slt.no index af9211d26f8..330b2d52684 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q11.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q11.slt.no @@ -168,7 +168,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT memory.main.hits.UserID)" + "Order By": "u" } } ], @@ -188,61 +188,126 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.MobilePhoneModel != \"\")", + "Function": "Vortex Scan", + "SELECT projections": "MobilePhone: cast($.MobilePhone as i8?)", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Expressions": [ + "UserID", + "MobilePhone", + "MobilePhoneModel" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "MobilePhone", + "MobilePhoneModel", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "100000" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1" + ], + "Estimated Cardinality": "100000" + } + } + ], "extra_info": { - "Filters": "($.MobilePhoneModel != \"\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200000" + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1" + ], + "Estimated Cardinality": "100000" } } ], "extra_info": { - "Expressions": [ - "UserID", - "MobilePhone", - "MobilePhoneModel" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Expressions": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Expressions": [ - "#0", - "__internal_compress_integral_utinyint(#1, 0)", + "CAST(#0 AS SMALLINT)", + "#1", "#2" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "50000" } } ], "extra_info": { - "Groups": [ - "MobilePhone", - "MobilePhoneModel" + "Expressions": [ + "#0", + "#1", + "#2" ], - "Expressions": "count(DISTINCT UserID)", - "Estimated Cardinality": "199999" + "Estimated Cardinality": "50000" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, 0)", + "#0", "#1", "#2" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "50000" } } ], @@ -252,7 +317,7 @@ logical_opt [ "MobilePhoneModel", "u" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "50000" } } ], @@ -279,37 +344,75 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.MobilePhoneModel != \"\")", + "SELECT projections": "MobilePhone: cast($.MobilePhone as i8?)", + "Projections": [ + "UserID", + "MobilePhone", + "MobilePhoneModel" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Projections": [ + "MobilePhone", + "MobilePhoneModel", + "UserID" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "", + "Estimated Cardinality": "100000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.MobilePhoneModel != \"\")", "Projections": [ - "UserID", - "MobilePhone", - "MobilePhoneModel" + "CAST(#0 AS SMALLINT)", + "#1" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "100000" } } ], "extra_info": { "Projections": [ - "#0", - "__internal_compress_integral_utinyint(#1, 0)", - "#2" + "CAST(#0 AS TINYINT)", + "#1" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "100000" } } ], "extra_info": { "Projections": [ - "MobilePhone", - "MobilePhoneModel", - "UserID" + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "100000" } } ], @@ -318,24 +421,25 @@ physical_plan [ "#0", "#1" ], - "Aggregates": "count(DISTINCT #2)", - "Estimated Cardinality": "199999" + "Aggregates": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "50000" } } ], "extra_info": { "Top": "10", - "Order By": "count(DISTINCT memory.main.hits.UserID) DESC" + "Order By": "u DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q12.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q12.slt.no index e25a8b39fe6..ccbb7994296 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q12.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q12.slt.no @@ -164,7 +164,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -260,7 +260,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q13.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q13.slt.no index 6f84ea837ff..01cd5432720 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q13.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q13.slt.no @@ -164,7 +164,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT memory.main.hits.UserID)" + "Order By": "u" } } ], @@ -181,34 +181,71 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.SearchPhrase != \"\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Expressions": [ + "UserID", + "SearchPhrase" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "SearchPhrase", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "100000" + } + } + ], "extra_info": { - "Filters": "($.SearchPhrase != \"\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200000" + "Groups": "#0", + "Expressions": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Expressions": [ - "UserID", - "SearchPhrase" + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "50000" } } ], "extra_info": { - "Groups": "SearchPhrase", - "Expressions": "count(DISTINCT UserID)", - "Estimated Cardinality": "126424" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "50000" } } ], @@ -217,7 +254,7 @@ logical_opt [ "SearchPhrase", "u" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "50000" } } ], @@ -238,38 +275,61 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.SearchPhrase != \"\")", + "Projections": [ + "UserID", + "SearchPhrase" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Projections": [ + "SearchPhrase", + "UserID" + ], + "Estimated Cardinality": "200000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.SearchPhrase != \"\")", - "Projections": [ - "UserID", - "SearchPhrase" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "200000" + "Aggregates": "", + "Estimated Cardinality": "100000" } } ], "extra_info": { - "Projections": [ - "SearchPhrase", - "UserID" - ], - "Estimated Cardinality": "200000" + "Projections": "#0", + "Estimated Cardinality": "100000" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "count(DISTINCT #1)", - "Estimated Cardinality": "126424" + "Aggregates": "count_star()", + "Estimated Cardinality": "50000" } } ], "extra_info": { "Top": "10", - "Order By": "count(DISTINCT memory.main.hits.UserID) DESC" + "Order By": "u DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q14.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q14.slt.no index becedf49924..baac3500b08 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q14.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q14.slt.no @@ -168,7 +168,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -202,6 +202,7 @@ logical_opt [ "extra_info": { "Filters": "($.SearchPhrase != \"\")", "Function": "Vortex Scan", + "SELECT projections": "SearchEngineID: cast($.SearchEngineID as u8?)", "Estimated Cardinality": "200000" } } @@ -217,7 +218,7 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 0)", + "#0", "#1" ], "Estimated Cardinality": "200000" @@ -230,17 +231,17 @@ logical_opt [ "SearchPhrase" ], "Expressions": "count_star()", - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], @@ -250,7 +251,7 @@ logical_opt [ "SearchPhrase", "c" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], @@ -274,26 +275,15 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.SearchPhrase != \"\")", - "Projections": [ - "SearchEngineID", - "SearchPhrase" - ], - "Estimated Cardinality": "200000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.SearchPhrase != \"\")", + "SELECT projections": "SearchEngineID: cast($.SearchEngineID as u8?)", "Projections": [ - "__internal_compress_integral_utinyint(#0, 0)", - "#1" + "SearchEngineID", + "SearchPhrase" ], "Estimated Cardinality": "200000" } @@ -314,23 +304,24 @@ physical_plan [ "#1" ], "Aggregates": "count_star()", - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q15.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q15.slt.no index 2e5ceba8292..713b69e4e16 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q15.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q15.slt.no @@ -251,7 +251,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "count_star() DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q16.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q16.slt.no index c60e86a803f..f4edee98649 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q16.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q16.slt.no @@ -271,7 +271,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "count_star() DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q17.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q17.slt.no index ce6fa55880d..4718759edd3 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q17.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q17.slt.no @@ -260,6 +260,9 @@ physical_plan [ } } ], - "extra_info": {} + "extra_info": { + "Limit": "10", + "Estimated Cardinality": "0" + } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q18.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q18.slt.no index 78448cf1c65..fc3dfc03518 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q18.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q18.slt.no @@ -223,7 +223,7 @@ logical_opt [ "extra_info": { "Groups": [ "UserID", - "__internal_compress_integral_utinyint(\"minute\"(EventTime), 0)", + "CAST(m AS TINYINT)", "SearchPhrase" ], "Expressions": "count_star()", @@ -234,7 +234,7 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 0)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], @@ -289,7 +289,7 @@ physical_plan [ "extra_info": { "Projections": [ "UserID", - "__internal_compress_integral_utinyint(\"minute\"(EventTime), 0)", + "CAST(m AS TINYINT)", "SearchPhrase" ], "Estimated Cardinality": "1000000" @@ -310,7 +310,7 @@ physical_plan [ "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 0)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], @@ -320,7 +320,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "count_star() DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q19.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q19.slt.no index f1e9a479d7c..7b43a0baea0 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q19.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q19.slt.no @@ -158,19 +158,19 @@ logical_opt [ "extra_info": { "Filters": "($.UserID = 435090932899640449i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "UserID", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "UserID", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ] @@ -180,9 +180,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "UserID=435090932899640449", + "Filters": "($.UserID = 435090932899640449i64)", "Projections": "UserID", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q2.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q2.slt.no index fa3df075b66..71db221d3e6 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q2.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q2.slt.no @@ -159,17 +159,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Aggregations": [ + "sum(AdvEngineID)", + "count(*)", + "sum(ResolutionWidth)" + ], + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Aggregations": [ - "sum(AdvEngineID)", - "count(*)", - "mean(ResolutionWidth)" + "Expressions": [ + "#0", + "#1", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#1 AS DOUBLE))" ], - "Estimated Cardinality": "1000000" + "Estimated Cardinality": "1" } } ], @@ -185,17 +198,30 @@ logical_opt [ ] physical_plan [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Aggregations": [ + "sum(AdvEngineID)", + "count(*)", + "sum(ResolutionWidth)" + ], + "Projections": "", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Aggregations": [ - "sum(AdvEngineID)", - "count(*)", - "mean(ResolutionWidth)" + "Projections": [ + "#0", + "#1", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#1 AS DOUBLE))" ], - "Projections": "", - "Estimated Cardinality": "1000000" + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q20.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q20.slt.no index ac03357967c..75dafcef574 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q20.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q20.slt.no @@ -218,7 +218,8 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q21.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q21.slt.no index 6f4b738bf78..54c4c73745f 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q21.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q21.slt.no @@ -171,7 +171,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -289,7 +289,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q22.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q22.slt.no index b097f27d364..b050cf9a219 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q22.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q22.slt.no @@ -176,7 +176,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -193,45 +193,146 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "$.Title like \"%Google%\"", + "vortex.not($.URL like \"%.google.%\")", + "($.SearchPhrase != \"\")" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Expressions": [ + "Title", + "UserID", + "URL", + "SearchPhrase" + ], + "Estimated Cardinality": "200000" + } + } + ], "extra_info": { - "Filters": [ - "$.Title like \"%Google%\"", - "vortex.not($.URL like \"%.google.%\")", - "($.SearchPhrase != \"\")" + "Expressions": [ + "#0", + "#1", + "#2", + "#3" ], - "Function": "Vortex Scan", "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": [ - "Title", - "UserID", - "URL", - "SearchPhrase" + "#0", + "#1", + "#2", + "#3" ], "Estimated Cardinality": "200000" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": "SearchPhrase", + "Expressions": [ + "min(URL)", + "min(Title)", + "count_star()" + ], + "Estimated Cardinality": "100000" + } + }, + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "SearchPhrase", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "100000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "count_star()", + "Estimated Cardinality": "50000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(#0 IS NOT DISTINCT FROM #0)", + "Estimated Cardinality": "25000" + } + } + ], + "extra_info": { + "Expressions": [ + "#3", + "#0", + "#1", + "#2", + "#4" + ], + "Estimated Cardinality": "25000" + } } ], "extra_info": { - "Groups": "SearchPhrase", - "Expressions": [ - "min(URL)", - "min(Title)", - "count_star()", - "count(DISTINCT UserID)" - ], - "Estimated Cardinality": "126424" + "CTE Name": "__aggregate_cte_13", + "Table Index": "13", + "Estimated Cardinality": "25000" } } ], @@ -243,7 +344,7 @@ logical_opt [ "c", "count(DISTINCT UserID)" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "25000" } } ], @@ -258,57 +359,152 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "$.Title like \"%Google%\"", + "vortex.not($.URL like \"%.google.%\")", + "($.SearchPhrase != \"\")" + ], + "Projections": [ + "Title", + "UserID", + "URL", + "SearchPhrase" + ], + "Estimated Cardinality": "200000" + } + }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Projections": [ + "SearchPhrase", + "URL", + "Title" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "min(#1)", + "min(#2)", + "count_star()" + ], + "Estimated Cardinality": "100000" + } + }, + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Projections": [ + "SearchPhrase", + "UserID" + ], + "Estimated Cardinality": "200000" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "", + "Estimated Cardinality": "100000" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "100000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "count_star()", + "Estimated Cardinality": "50000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "$.Title like \"%Google%\"", - "vortex.not($.URL like \"%.google.%\")", - "($.SearchPhrase != \"\")" - ], - "Projections": [ - "Title", - "UserID", - "URL", - "SearchPhrase" - ], - "Estimated Cardinality": "200000" + "Join Type": "INNER", + "Conditions": "#0 IS NOT DISTINCT FROM #0", + "Estimated Cardinality": "25000" } } ], "extra_info": { "Projections": [ - "SearchPhrase", - "URL", - "Title", - "UserID" + "#3", + "#0", + "#1", + "#2", + "#4" ], - "Estimated Cardinality": "200000" + "Estimated Cardinality": "25000" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "min(#1)", - "min(#2)", - "count_star()", - "count(DISTINCT #3)" - ], - "Estimated Cardinality": "126424" + "CTE Name": "__aggregate_cte_13", + "Table Index": "13", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "25000" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q23.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q23.slt.no index b2ad7eb1cb8..70483220f52 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q23.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q23.slt.no @@ -258,7 +258,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.hits.EventTime" + "Order By": "EventTime" } } ], @@ -335,7 +335,8 @@ logical_opt [ "Conditions": [ "(file_index = file_index)", "(file_row_number = file_row_number)" - ] + ], + "Estimated Cardinality": "200000" } } ], @@ -446,12 +447,14 @@ logical_opt [ "RefererHash", "URLHash", "CLID" - ] + ], + "Estimated Cardinality": "200000" } } ], "extra_info": { - "Order By": "memory.main.hits.EventTime" + "Order By": "EventTime", + "Estimated Cardinality": "200000" } } ] @@ -593,7 +596,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "memory.main.hits.EventTime ASC" + "Order By": "EventTime ASC", + "Estimated Cardinality": "10" } } ], @@ -603,12 +607,13 @@ physical_plan [ "file_index = file_index", "file_row_number = file_row_number" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "200000" } } ], "extra_info": { - "Order By": "memory.main.hits.EventTime ASC" + "Order By": "EventTime ASC", + "Estimated Cardinality": "200000" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q24.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q24.slt.no index a9d8162c8b4..b9e90f0a85a 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q24.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q24.slt.no @@ -243,7 +243,8 @@ logical_opt [ "Conditions": [ "(file_index = file_index)", "(file_row_number = file_row_number)" - ] + ], + "Estimated Cardinality": "200000" } } ], @@ -251,12 +252,14 @@ logical_opt [ "Expressions": [ "SearchPhrase", "EventTime" - ] + ], + "Estimated Cardinality": "200000" } } ], "extra_info": { - "Order By": "#1" + "Order By": "#1", + "Estimated Cardinality": "200000" } } ], @@ -304,7 +307,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "#0 ASC" + "Order By": "#0 ASC", + "Estimated Cardinality": "10" } } ], @@ -314,7 +318,7 @@ physical_plan [ "file_index = file_index", "file_row_number = file_row_number" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "200000" } } ], @@ -323,12 +327,13 @@ physical_plan [ "SearchPhrase", "EventTime" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "200000" } } ], "extra_info": { - "Order By": "#1 ASC" + "Order By": "#1 ASC", + "Estimated Cardinality": "200000" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q25.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q25.slt.no index 14349a29e34..e3e82036bd7 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q25.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q25.slt.no @@ -152,7 +152,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.hits.SearchPhrase" + "Order By": "SearchPhrase" } } ], @@ -216,7 +216,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "memory.main.hits.SearchPhrase ASC" + "Order By": "SearchPhrase ASC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q26.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q26.slt.no index 832659ed3f4..4852d7d72d7 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q26.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q26.slt.no @@ -160,7 +160,7 @@ logical_plan [ "extra_info": { "Order By": [ "#[7.1]", - "memory.main.hits.SearchPhrase" + "SearchPhrase" ] } } @@ -265,8 +265,9 @@ physical_plan [ "Top": "10", "Order By": [ "#1 ASC", - "memory.main.hits.SearchPhrase ASC" - ] + "SearchPhrase ASC" + ], + "Estimated Cardinality": "10" } } ], diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q27.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q27.slt.no index 2efcbd27e58..8847ce51e8b 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q27.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q27.slt.no @@ -176,7 +176,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "avg(octet_length(memory.main.hits.URL))" + "Order By": "l" } } ], @@ -213,6 +213,7 @@ logical_opt [ "extra_info": { "Filters": "($.URL != \"\")", "Function": "Vortex Scan", + "SELECT projections": "CounterID: cast($.CounterID as i8?)", "Estimated Cardinality": "200000" } } @@ -228,7 +229,7 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 17)", + "#0", "#1" ], "Estimated Cardinality": "200000" @@ -241,23 +242,23 @@ logical_opt [ "count_star()", "avg(strlen(URL))" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "46" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_integer(#0, 17)", + "CAST(#0 AS INTEGER)", "#1", "#2" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "46" } } ], "extra_info": { "Expressions": "(count_star() > 100000)", - "Estimated Cardinality": "25284" + "Estimated Cardinality": "9" } } ], @@ -267,13 +268,13 @@ logical_opt [ "l", "c" ], - "Estimated Cardinality": "25284" + "Estimated Cardinality": "9" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "25" + "Estimated Cardinality": "9" } } ] @@ -297,26 +298,15 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.URL != \"\")", - "Projections": [ - "CounterID", - "URL" - ], - "Estimated Cardinality": "200000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.URL != \"\")", + "SELECT projections": "CounterID: cast($.CounterID as i8?)", "Projections": [ - "__internal_compress_integral_utinyint(#0, 17)", - "#1" + "CounterID", + "URL" ], "Estimated Cardinality": "200000" } @@ -336,23 +326,24 @@ physical_plan [ "Aggregates": [ "count_star()", "avg(#1)" - ] + ], + "Estimated Cardinality": "46" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_integer(#0, 17)", + "CAST(#0 AS INTEGER)", "#1", "#2" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "46" } } ], "extra_info": { "Expression": "(count_star() > 100000)", - "Estimated Cardinality": "25284" + "Estimated Cardinality": "9" } } ], @@ -362,13 +353,14 @@ physical_plan [ "l", "c" ], - "Estimated Cardinality": "25284" + "Estimated Cardinality": "9" } } ], "extra_info": { "Top": "25", - "Order By": "avg(octet_length(memory.main.hits.URL)) DESC" + "Order By": "l DESC", + "Estimated Cardinality": "9" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q28.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q28.slt.no index c38febc7d83..5bc57ae66d5 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q28.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q28.slt.no @@ -180,7 +180,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "avg(octet_length(memory.main.hits.Referer))" + "Order By": "l" } } ], @@ -322,7 +322,8 @@ physical_plan [ ], "extra_info": { "Top": "25", - "Order By": "avg(octet_length(memory.main.hits.Referer)) DESC" + "Order By": "l DESC", + "Estimated Cardinality": "25" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q29.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q29.slt.no index 6624e00500a..52fc975e5b4 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q29.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q29.slt.no @@ -343,7 +343,7 @@ logical_opt [ "Function": "Vortex Scan", "Aggregations": [ "sum(ResolutionWidth)", - "count(ResolutionWidth)" + "count(*)" ], "Estimated Cardinality": "1000000" } @@ -352,95 +352,95 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(1 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(2 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(3 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(4 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(5 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(6 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(7 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(8 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(9 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(10 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(11 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(12 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(13 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(14 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(15 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(16 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(17 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(18 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(19 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(20 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(21 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(22 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(23 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(24 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(25 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(26 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(27 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(28 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(29 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(30 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(31 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(32 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(33 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(34 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(35 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(36 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(37 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(38 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(39 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(40 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(41 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(42 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(43 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(44 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(45 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(46 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(47 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(48 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(49 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(50 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(51 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(52 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(53 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(54 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(55 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(56 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(57 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(58 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(59 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(60 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(61 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(62 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(63 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(64 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(65 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(66 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(67 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(68 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(69 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(70 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(71 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(72 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(73 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(74 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(75 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(76 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(77 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(78 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(79 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(80 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(81 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(82 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(83 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(84 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(85 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(86 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(87 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(88 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(89 AS HUGEINT)))" + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 1))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 2))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 3))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 4))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 5))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 6))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 7))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 8))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 9))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 10))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 11))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 12))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 13))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 14))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 15))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 16))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 17))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 18))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 19))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 20))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 21))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 22))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 23))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 24))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 25))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 26))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 27))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 28))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 29))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 30))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 31))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 32))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 33))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 34))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 35))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 36))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 37))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 38))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 39))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 40))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 41))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 42))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 43))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 44))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 45))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 46))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 47))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 48))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 49))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 50))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 51))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 52))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 53))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 54))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 55))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 56))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 57))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 58))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 59))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 60))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 61))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 62))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 63))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 64))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 65))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 66))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 67))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 68))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 69))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 70))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 71))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 72))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 73))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 74))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 75))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 76))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 77))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 78))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 79))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 80))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 81))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 82))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 83))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 84))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 85))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 86))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 87))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 88))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 89))" ], "Estimated Cardinality": "1" } @@ -554,7 +554,7 @@ physical_plan [ "Function": "Vortex Scan", "Aggregations": [ "sum(ResolutionWidth)", - "count(ResolutionWidth)" + "count(*)" ], "Projections": "", "Estimated Cardinality": "1000000" @@ -564,95 +564,95 @@ physical_plan [ "extra_info": { "Projections": [ "#0", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(1 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(2 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(3 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(4 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(5 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(6 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(7 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(8 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(9 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(10 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(11 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(12 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(13 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(14 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(15 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(16 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(17 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(18 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(19 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(20 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(21 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(22 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(23 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(24 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(25 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(26 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(27 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(28 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(29 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(30 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(31 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(32 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(33 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(34 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(35 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(36 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(37 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(38 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(39 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(40 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(41 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(42 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(43 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(44 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(45 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(46 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(47 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(48 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(49 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(50 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(51 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(52 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(53 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(54 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(55 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(56 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(57 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(58 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(59 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(60 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(61 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(62 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(63 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(64 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(65 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(66 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(67 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(68 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(69 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(70 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(71 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(72 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(73 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(74 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(75 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(76 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(77 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(78 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(79 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(80 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(81 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(82 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(83 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(84 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(85 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(86 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(87 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(88 AS HUGEINT)))", - "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), CAST(89 AS HUGEINT)))" + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 1))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 2))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 3))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 4))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 5))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 6))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 7))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 8))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 9))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 10))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 11))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 12))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 13))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 14))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 15))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 16))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 17))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 18))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 19))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 20))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 21))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 22))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 23))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 24))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 25))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 26))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 27))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 28))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 29))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 30))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 31))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 32))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 33))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 34))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 35))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 36))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 37))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 38))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 39))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 40))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 41))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 42))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 43))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 44))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 45))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 46))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 47))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 48))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 49))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 50))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 51))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 52))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 53))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 54))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 55))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 56))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 57))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 58))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 59))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 60))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 61))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 62))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 63))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 64))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 65))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 66))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 67))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 68))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 69))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 70))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 71))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 72))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 73))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 74))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 75))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 76))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 77))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 78))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 79))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 80))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 81))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 82))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 83))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 84))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 85))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 86))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 87))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 88))", + "\"+\"(#0, \"*\"(CAST(#1 AS HUGEINT), 89))" ], "Estimated Cardinality": "1" } diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q3.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q3.slt.no index 9bbfc59b93c..a2f38c41c52 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q3.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q3.slt.no @@ -151,30 +151,42 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": "UserID", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Expressions": "UserID", - "Estimated Cardinality": "1000000" + "Groups": "", + "Expressions": [ + "sum(UserID)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(UserID)", + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -187,29 +199,42 @@ logical_opt [ ] physical_plan [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "UserID", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": "UserID", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Projections": "UserID", - "Estimated Cardinality": "1000000" + "Aggregates": [ + "sum(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": "avg(#0)" + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q30.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q30.slt.no index 0143bf0152f..972cd71a68a 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q30.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q30.slt.no @@ -174,7 +174,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -208,6 +208,7 @@ logical_opt [ "extra_info": { "Filters": "($.SearchPhrase != \"\")", "Function": "Vortex Scan", + "SELECT projections": "SearchEngineID: cast($.SearchEngineID as u8?)", "Estimated Cardinality": "200000" } } @@ -228,7 +229,7 @@ logical_opt [ "#0", "#1", "#2", - "__internal_compress_integral_utinyint(#3, 0)" + "#3" ], "Estimated Cardinality": "200000" } @@ -244,19 +245,19 @@ logical_opt [ "sum(IsRefresh)", "avg(ResolutionWidth)" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3", "#4" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], @@ -268,7 +269,7 @@ logical_opt [ "sum(IsRefresh)", "avg(ResolutionWidth)" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], @@ -292,30 +293,17 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.SearchPhrase != \"\")", - "Projections": [ - "ClientIP", - "IsRefresh", - "ResolutionWidth", - "SearchEngineID" - ], - "Estimated Cardinality": "200000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.SearchPhrase != \"\")", + "SELECT projections": "SearchEngineID: cast($.SearchEngineID as u8?)", "Projections": [ - "#0", - "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 0)" + "ClientIP", + "IsRefresh", + "ResolutionWidth", + "SearchEngineID" ], "Estimated Cardinality": "200000" } @@ -342,25 +330,26 @@ physical_plan [ "sum(#2)", "avg(#3)" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3", "#4" ], - "Estimated Cardinality": "199999" + "Estimated Cardinality": "199543" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q31.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q31.slt.no index 537f21705fe..cdc7b89b69f 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q31.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q31.slt.no @@ -174,7 +174,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -302,7 +302,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q32.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q32.slt.no index f0da28f6d19..acdcd1c6e62 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q32.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q32.slt.no @@ -166,7 +166,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -293,7 +293,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q33.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q33.slt.no index 93ae7751ea8..303c3b562df 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q33.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q33.slt.no @@ -156,7 +156,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -251,7 +251,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q34.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q34.slt.no index e48d3852278..7b28797f1a1 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q34.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q34.slt.no @@ -160,7 +160,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -212,7 +212,7 @@ logical_opt [ ], "extra_info": { "Groups": [ - "__internal_compress_integral_utinyint(1, 1)", + "CAST(1 AS TINYINT)", "URL" ], "Expressions": "count_star()", @@ -222,7 +222,7 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_integer(#0, 1)", + "CAST(#0 AS INTEGER)", "#1", "#2" ], @@ -271,7 +271,7 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(1, 1)", + "CAST(1 AS TINYINT)", "URL" ], "Estimated Cardinality": "1000000" @@ -290,7 +290,7 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_decompress_integral_integer(#0, 1)", + "CAST(#0 AS INTEGER)", "#1", "#2" ], @@ -300,7 +300,8 @@ physical_plan [ ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q35.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q35.slt.no index 4344481a720..25b5856c645 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q35.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q35.slt.no @@ -164,7 +164,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -181,35 +181,45 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": "ClientIP", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Expressions": "ClientIP", - "Estimated Cardinality": "1000000" + "Groups": "ClientIP", + "Expressions": "count_star()", + "Estimated Cardinality": "632120" } } ], "extra_info": { - "Groups": [ - "ClientIP", + "Expressions": [ + "#0", "(ClientIP - 1)", "(ClientIP - 2)", - "(ClientIP - 3)" + "(ClientIP - 3)", + "#1" ], - "Expressions": "count_star()", "Estimated Cardinality": "632120" } } @@ -237,47 +247,53 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "ClientIP", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": "ClientIP", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Projections": [ - "ClientIP", - "(ClientIP - 1)", - "(ClientIP - 2)", - "(ClientIP - 3)" - ], - "Estimated Cardinality": "1000000" + "Groups": "#0", + "Aggregates": "count_star()", + "Estimated Cardinality": "632120" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", - "#1", - "#2", - "#3" + "(ClientIP - 1)", + "(ClientIP - 2)", + "(ClientIP - 3)", + "#1" ], - "Aggregates": "count_star()", "Estimated Cardinality": "632120" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q36.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q36.slt.no index 21b97d95bf1..ad232785c16 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q36.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q36.slt.no @@ -171,7 +171,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -205,20 +205,20 @@ logical_opt [ "($.URL != \"\")" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "URL", "Expressions": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -227,7 +227,7 @@ logical_opt [ "URL", "PageViews" ], - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -253,31 +253,34 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "DontCountHits=0" + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.DontCountHits = 0i16)", + "($.IsRefresh = 0i16)", + "($.URL != \"\")" ], "Projections": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Projections": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q37.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q37.slt.no index 6b53defbc9a..111003927fc 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q37.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q37.slt.no @@ -171,7 +171,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -205,20 +205,20 @@ logical_opt [ "($.Title != \"\")" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "Title", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "Title", "Expressions": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -227,7 +227,7 @@ logical_opt [ "Title", "PageViews" ], - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -253,31 +253,34 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "DontCountHits=0" + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.DontCountHits = 0i16)", + "($.IsRefresh = 0i16)", + "($.Title != \"\")" ], "Projections": "Title", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Projections": "Title", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q38.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q38.slt.no index 4dda6e9979a..be78eda8e7c 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q38.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q38.slt.no @@ -171,7 +171,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -205,20 +205,20 @@ logical_opt [ "($.IsDownload = 0i16)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "URL", "Expressions": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -227,7 +227,7 @@ logical_opt [ "URL", "PageViews" ], - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], @@ -253,32 +253,35 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "IsDownload=0" + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.IsRefresh = 0i16)", + "($.IsLink != 0i16)", + "($.IsDownload = 0i16)" ], "Projections": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Projections": "URL", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "36253" + "Estimated Cardinality": "126424" } } ], "extra_info": { "Top": "10", "Offset": "1000", - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q39.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q39.slt.no index ebab3e1de6f..c08d5440e91 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q39.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q39.slt.no @@ -179,7 +179,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -217,7 +217,8 @@ logical_opt [ "($.IsRefresh = 0i16)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "SELECT projections": "TraficSourceID: cast($.TraficSourceID as i8?)", + "Estimated Cardinality": "200000" } } ], @@ -229,7 +230,7 @@ logical_opt [ "SearchEngineID", "AdvEngineID" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -237,11 +238,11 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_compress_integral_utinyint(#2, -1)", + "#2", "#3", "#4" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -254,20 +255,20 @@ logical_opt [ "Dst" ], "Expressions": "count_star()", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "199999" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, -1)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3", "#4", "#5" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "199999" } } ], @@ -280,7 +281,7 @@ logical_opt [ "4", "PageViews" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "199999" } } ], @@ -304,37 +305,24 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "CounterID=62", - "IsRefresh=0" - ], - "Projections": [ - "URL", - "Referer", - "TraficSourceID", - "SearchEngineID", - "AdvEngineID" - ], - "Estimated Cardinality": "40000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.IsRefresh = 0i16)" + ], + "SELECT projections": "TraficSourceID: cast($.TraficSourceID as i8?)", "Projections": [ - "#0", - "#1", - "__internal_compress_integral_utinyint(#2, -1)", - "#3", - "#4" + "URL", + "Referer", + "TraficSourceID", + "SearchEngineID", + "AdvEngineID" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -346,7 +334,7 @@ physical_plan [ "Src", "Dst" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -359,27 +347,28 @@ physical_plan [ "#4" ], "Aggregates": "count_star()", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "199999" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, -1)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3", "#4", "#5" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "199999" } } ], "extra_info": { "Top": "10", "Offset": "1000", - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q4.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q4.slt.no index cbe92baf34c..8920cee8f86 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q4.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q4.slt.no @@ -151,30 +151,58 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Expressions": "UserID", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": "UserID", + "Expressions": "", + "Estimated Cardinality": "500000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000000" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "UserID", - "Estimated Cardinality": "1000000" + "Expressions": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": "count(DISTINCT UserID)", + "Expressions": "#0", "Estimated Cardinality": "1" } } @@ -190,26 +218,37 @@ physical_plan [ "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "UserID", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": "UserID", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Projections": "UserID", - "Estimated Cardinality": "1000000" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "500000" } } ], "extra_info": { - "Aggregates": "count(DISTINCT #0)" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q40.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q40.slt.no index dbe1b03753d..e6e26f604e0 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q40.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q40.slt.no @@ -175,7 +175,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -209,7 +209,7 @@ logical_opt [ "($.RefererHash = 3594120000172545465i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -218,7 +218,7 @@ logical_opt [ "EventDate", "URLHash" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -228,7 +228,7 @@ logical_opt [ "EventDate" ], "Expressions": "count_star()", - "Estimated Cardinality": "39999" + "Estimated Cardinality": "123686" } } ], @@ -238,7 +238,7 @@ logical_opt [ "EventDate", "PageViews" ], - "Estimated Cardinality": "39999" + "Estimated Cardinality": "123686" } } ], @@ -264,15 +264,17 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "RefererHash=3594120000172545465" + "vortex.list.contains([-1i16, 6i16], $.TraficSourceID, opts=sql_null_semantics)", + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.IsRefresh = 0i16)", + "($.RefererHash = 3594120000172545465i64)" ], "Projections": [ "EventDate", "URLHash" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -281,7 +283,7 @@ physical_plan [ "URLHash", "EventDate" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -291,14 +293,15 @@ physical_plan [ "#1" ], "Aggregates": "count_star()", - "Estimated Cardinality": "39999" + "Estimated Cardinality": "123686" } } ], "extra_info": { "Top": "10", "Offset": "100", - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q41.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q41.slt.no index 547cc1f91c0..cb7e98aa654 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q41.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q41.slt.no @@ -175,7 +175,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "PageViews" } } ], @@ -212,7 +212,7 @@ logical_opt [ "($.URLHash = 2868770270353813622i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -221,7 +221,7 @@ logical_opt [ "WindowClientWidth", "WindowClientHeight" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -231,7 +231,7 @@ logical_opt [ "WindowClientHeight" ], "Expressions": "count_star()", - "Estimated Cardinality": "39999" + "Estimated Cardinality": "199306" } } ], @@ -241,13 +241,13 @@ logical_opt [ "WindowClientHeight", "PageViews" ], - "Estimated Cardinality": "39999" + "Estimated Cardinality": "199306" } } ], "extra_info": { - "Order By": "count_star()", - "Estimated Cardinality": "39999" + "Order By": "PageViews", + "Estimated Cardinality": "199306" } } ], @@ -275,16 +275,17 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "DontCountHits=0", - "URLHash=2868770270353813622" + "($.CounterID = 62i32)", + "(2013-07-01T00:00:00Z <= $.EventDate <= 2013-07-31T00:00:00Z)", + "($.IsRefresh = 0i16)", + "($.DontCountHits = 0i16)", + "($.URLHash = 2868770270353813622i64)" ], "Projections": [ "WindowClientWidth", "WindowClientHeight" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -293,7 +294,7 @@ physical_plan [ "WindowClientWidth", "WindowClientHeight" ], - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], @@ -303,15 +304,20 @@ physical_plan [ "#1" ], "Aggregates": "count_star()", - "Estimated Cardinality": "39999" + "Estimated Cardinality": "199306" } } ], "extra_info": { - "Order By": "count_star() DESC" + "Order By": "PageViews DESC", + "Estimated Cardinality": "199306" } } ], - "extra_info": {} + "extra_info": { + "Limit": "10", + "Offset": "10000", + "Estimated Cardinality": "0" + } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q42.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q42.slt.no index dcbe4f7aff2..c2aa6278a29 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q42.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q42.slt.no @@ -218,20 +218,20 @@ logical_opt [ "($.DontCountHits = 0i16)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Expressions": "EventTime", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "date_trunc('minute', EventTime)", "Expressions": "count_star()", - "Estimated Cardinality": "20000" + "Estimated Cardinality": "100000" } } ], @@ -241,7 +241,7 @@ logical_opt [ "PageViews", "date_trunc('minute', M)" ], - "Estimated Cardinality": "20000" + "Estimated Cardinality": "100000" } } ], @@ -282,25 +282,26 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "CounterID=62", - "IsRefresh=0", - "DontCountHits=0" + "($.CounterID = 62i32)", + "(2013-07-14T00:00:00Z <= $.EventDate <= 2013-07-15T00:00:00Z)", + "($.IsRefresh = 0i16)", + "($.DontCountHits = 0i16)" ], "Projections": "EventTime", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Projections": "date_trunc('minute', EventTime)", - "Estimated Cardinality": "40000" + "Estimated Cardinality": "200000" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "20000" + "Estimated Cardinality": "100000" } } ], @@ -310,14 +311,15 @@ physical_plan [ "PageViews", "date_trunc('minute', M)" ], - "Estimated Cardinality": "20000" + "Estimated Cardinality": "100000" } } ], "extra_info": { "Top": "10", "Offset": "1000", - "Order By": "#2 ASC" + "Order By": "#2 ASC", + "Estimated Cardinality": "10" } } ], diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q5.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q5.slt.no index 82d6c1effad..d9363c25019 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q5.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q5.slt.no @@ -151,30 +151,58 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Expressions": "SearchPhrase", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": "SearchPhrase", + "Expressions": "", + "Estimated Cardinality": "500000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000000" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "SearchPhrase", - "Estimated Cardinality": "1000000" + "Expressions": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": "count(DISTINCT SearchPhrase)", + "Expressions": "#0", "Estimated Cardinality": "1" } } @@ -190,26 +218,37 @@ physical_plan [ "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "SearchPhrase", + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": "SearchPhrase", "Estimated Cardinality": "1000000" } } ], "extra_info": { - "Projections": "SearchPhrase", - "Estimated Cardinality": "1000000" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "500000" } } ], "extra_info": { - "Aggregates": "count(DISTINCT #0)" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q7.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q7.slt.no index 3499f0420a4..0909483a812 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q7.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q7.slt.no @@ -196,6 +196,7 @@ logical_opt [ "extra_info": { "Filters": "($.AdvEngineID != 0i16)", "Function": "Vortex Scan", + "SELECT projections": "AdvEngineID: cast($.AdvEngineID as i8?)", "Estimated Cardinality": "200000" } } @@ -207,7 +208,7 @@ logical_opt [ } ], "extra_info": { - "Expressions": "__internal_compress_integral_utinyint(#0, 0)", + "Expressions": "#0", "Estimated Cardinality": "200000" } } @@ -215,16 +216,16 @@ logical_opt [ "extra_info": { "Groups": "AdvEngineID", "Expressions": "count_star()", - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], @@ -233,29 +234,31 @@ logical_opt [ "AdvEngineID", "count_star()" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 0)", + "CAST(#0 AS TINYINT)", "#1" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], "extra_info": { - "Order By": "count_star()" + "Order By": "count_star()", + "Estimated Cardinality": "53" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1" - ] + ], + "Estimated Cardinality": "53" } } ] @@ -279,21 +282,13 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.AdvEngineID != 0i16)", - "Projections": "AdvEngineID", - "Estimated Cardinality": "200000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "__internal_compress_integral_utinyint(#0, 0)", + "Function": "Vortex Scan", + "Filters": "($.AdvEngineID != 0i16)", + "SELECT projections": "AdvEngineID: cast($.AdvEngineID as i8?)", + "Projections": "AdvEngineID", "Estimated Cardinality": "200000" } } @@ -306,39 +301,41 @@ physical_plan [ ], "extra_info": { "Groups": "#0", - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "53" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 0)", + "CAST(#0 AS TINYINT)", "#1" ], - "Estimated Cardinality": "126424" + "Estimated Cardinality": "53" } } ], "extra_info": { - "Order By": "count_star() DESC" + "Order By": "count_star() DESC", + "Estimated Cardinality": "53" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_smallint(#0, 0)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "53" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q8.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q8.slt.no index a368eff4313..81ac5390073 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q8.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q8.slt.no @@ -156,7 +156,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT memory.main.hits.UserID)" + "Order By": "u" } } ], @@ -173,34 +173,71 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Expressions": [ + "RegionID", + "UserID" + ], + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": [ + "RegionID", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "500000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000000" + "Groups": "#0", + "Expressions": "count_star()", + "Estimated Cardinality": "250000" } } ], "extra_info": { "Expressions": [ - "RegionID", - "UserID" + "#0", + "#1" ], - "Estimated Cardinality": "1000000" + "Estimated Cardinality": "250000" } } ], "extra_info": { - "Groups": "RegionID", - "Expressions": "count(DISTINCT UserID)", - "Estimated Cardinality": "632120" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "250000" } } ], @@ -209,7 +246,7 @@ logical_opt [ "RegionID", "u" ], - "Estimated Cardinality": "632120" + "Estimated Cardinality": "250000" } } ], @@ -230,37 +267,60 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "RegionID", + "UserID" + ], + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Projections": [ + "RegionID", + "UserID" + ], + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "RegionID", - "UserID" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "1000000" + "Aggregates": "", + "Estimated Cardinality": "500000" } } ], "extra_info": { - "Projections": [ - "RegionID", - "UserID" - ], - "Estimated Cardinality": "1000000" + "Projections": "#0", + "Estimated Cardinality": "500000" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "count(DISTINCT #1)", - "Estimated Cardinality": "632120" + "Aggregates": "count_star()", + "Estimated Cardinality": "250000" } } ], "extra_info": { "Top": "10", - "Order By": "count(DISTINCT memory.main.hits.UserID) DESC" + "Order By": "u DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q9.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q9.slt.no index ea1e277287e..83184da7159 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/plans/q9.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/plans/q9.slt.no @@ -164,7 +164,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count_star()" + "Order By": "c" } } ], @@ -181,41 +181,142 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Expressions": [ + "RegionID", + "UserID", + "ResolutionWidth", + "AdvEngineID" + ], + "Estimated Cardinality": "1000000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "1000000" } } ], "extra_info": { "Expressions": [ - "RegionID", - "UserID", - "ResolutionWidth", - "AdvEngineID" + "#0", + "#1", + "#2", + "#3" ], "Estimated Cardinality": "1000000" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": "RegionID", + "Expressions": [ + "sum(AdvEngineID)", + "count_star()", + "avg(ResolutionWidth)" + ], + "Estimated Cardinality": "500000" + } + }, + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": [ + "RegionID", + "UserID" + ], + "Expressions": "", + "Estimated Cardinality": "500000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "count_star()", + "Estimated Cardinality": "250000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(#0 IS NOT DISTINCT FROM #0)", + "Estimated Cardinality": "954715" + } + } + ], + "extra_info": { + "Expressions": [ + "#3", + "#0", + "#1", + "#2", + "#4" + ], + "Estimated Cardinality": "954715" + } } ], "extra_info": { - "Groups": "RegionID", - "Expressions": [ - "sum(AdvEngineID)", - "count_star()", - "avg(ResolutionWidth)", - "count(DISTINCT UserID)" - ], - "Estimated Cardinality": "632120" + "CTE Name": "__aggregate_cte_13", + "Table Index": "13", + "Estimated Cardinality": "954715" } } ], @@ -227,7 +328,7 @@ logical_opt [ "avg(ResolutionWidth)", "count(DISTINCT UserID)" ], - "Estimated Cardinality": "632120" + "Estimated Cardinality": "954715" } } ], @@ -242,52 +343,147 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "RegionID", + "UserID", + "ResolutionWidth", + "AdvEngineID" + ], + "Estimated Cardinality": "1000000" + } + }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Projections": [ + "RegionID", + "AdvEngineID", + "ResolutionWidth" + ], + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "count_star()", + "avg(#2)" + ], + "Estimated Cardinality": "500000" + } + }, + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "13", + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Projections": [ + "RegionID", + "UserID" + ], + "Estimated Cardinality": "1000000" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "", + "Estimated Cardinality": "500000" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "500000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "count_star()", + "Estimated Cardinality": "250000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "RegionID", - "UserID", - "ResolutionWidth", - "AdvEngineID" - ], - "Estimated Cardinality": "1000000" + "Join Type": "INNER", + "Conditions": "#0 IS NOT DISTINCT FROM #0", + "Estimated Cardinality": "954715" } } ], "extra_info": { "Projections": [ - "RegionID", - "AdvEngineID", - "ResolutionWidth", - "UserID" + "#3", + "#0", + "#1", + "#2", + "#4" ], - "Estimated Cardinality": "1000000" + "Estimated Cardinality": "954715" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "count_star()", - "avg(#2)", - "count(DISTINCT #3)" - ], - "Estimated Cardinality": "632120" + "CTE Name": "__aggregate_cte_13", + "Table Index": "13", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "954715" } } ], "extra_info": { "Top": "10", - "Order By": "count_star() DESC" + "Order By": "c DESC", + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/clickbench/duckdb/results/q3.slt.no b/vortex-sqllogictest/slt/clickbench/duckdb/results/q3.slt.no index 9ebdadf58ad..b277934fe81 100644 --- a/vortex-sqllogictest/slt/clickbench/duckdb/results/q3.slt.no +++ b/vortex-sqllogictest/slt/clickbench/duckdb/results/q3.slt.no @@ -4,4 +4,4 @@ query R SELECT AVG("UserID") FROM hits; ---- -1948194877894919700 +1948194877894919400 diff --git a/vortex-sqllogictest/slt/duckdb/agg_corner_scalar_fn.slt b/vortex-sqllogictest/slt/duckdb/agg_corner_scalar_fn.slt index 8c25990adcb..98cdb3a3a50 100644 --- a/vortex-sqllogictest/slt/duckdb/agg_corner_scalar_fn.slt +++ b/vortex-sqllogictest/slt/duckdb/agg_corner_scalar_fn.slt @@ -24,7 +24,7 @@ SELECT sum(strlen(s)) FROM t5; query TT EXPLAIN SELECT sum(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query TT EXPLAIN (FORMAT json) SELECT sum(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; @@ -45,7 +45,7 @@ SELECT min(strlen(s)) FROM t5; query TT EXPLAIN SELECT min(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query I SELECT min(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; @@ -70,7 +70,7 @@ SELECT max(strlen(s)), count(strlen(s)) FROM t5; query TT EXPLAIN SELECT max(strlen(s)), count(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query II SELECT max(strlen(s)), count(strlen(s)) FROM '${WORK_DIR}/c5.vortex'; diff --git a/vortex-sqllogictest/slt/duckdb/agg_partition_stats.slt b/vortex-sqllogictest/slt/duckdb/agg_partition_stats.slt index c516edabe73..12051aeaf84 100644 --- a/vortex-sqllogictest/slt/duckdb/agg_partition_stats.slt +++ b/vortex-sqllogictest/slt/duckdb/agg_partition_stats.slt @@ -15,13 +15,13 @@ query TT EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats.vortex'; ---- -:.*COLUMN_DATA_SCAN.* +:.*Column Data Scan.* query TT EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats.vortex'; ---- -:.*(READ_VORTEX|AGGREGATE).* +:.*(Read Vortex|AGGREGATE).* query I SELECT count(*) @@ -33,13 +33,13 @@ query TT EXPLAIN SELECT min(i), max(i) FROM '${WORK_DIR}/agg_partition_stats.vortex'; ---- -:.*COLUMN_DATA_SCAN.* +:.*Column Data Scan.* query TT EXPLAIN SELECT min(i), max(i) FROM '${WORK_DIR}/agg_partition_stats.vortex'; ---- -:.*(READ_VORTEX|AGGREGATE).* +:.*(Read Vortex|AGGREGATE).* query II SELECT min(i), max(i) FROM '${WORK_DIR}/agg_partition_stats.vortex'; @@ -62,7 +62,7 @@ query TT EXPLAIN SELECT min(d), max(d) FROM '${WORK_DIR}/agg_partition_stats-date.vortex'; ---- -:.*COLUMN_DATA_SCAN.* +:.*Column Data Scan.* query DD SELECT min(d), max(d) FROM '${WORK_DIR}/agg_partition_stats-date.vortex'; @@ -73,7 +73,7 @@ query TT EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats.vortex' WHERE i > 50000; ---- -:.*READ_VORTEX.* +:.*Read Vortex.* query I SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats.vortex' diff --git a/vortex-sqllogictest/slt/duckdb/agg_partition_stats_multi_file.slt b/vortex-sqllogictest/slt/duckdb/agg_partition_stats_multi_file.slt index a75f138267e..1ac1b38de43 100644 --- a/vortex-sqllogictest/slt/duckdb/agg_partition_stats_multi_file.slt +++ b/vortex-sqllogictest/slt/duckdb/agg_partition_stats_multi_file.slt @@ -19,7 +19,7 @@ SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats_*.vortex'; query TT EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats_*.vortex'; ---- -:.*COLUMN_DATA_SCAN.* +:.*Column Data Scan.* query TT EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg_partition_stats_*.vortex'; diff --git a/vortex-sqllogictest/slt/duckdb/aggregate_pushdown.slt b/vortex-sqllogictest/slt/duckdb/aggregate_pushdown.slt index ff4a4af5ff8..8d0bcd0f047 100644 --- a/vortex-sqllogictest/slt/duckdb/aggregate_pushdown.slt +++ b/vortex-sqllogictest/slt/duckdb/aggregate_pushdown.slt @@ -14,7 +14,7 @@ SELECT (CASE WHEN i > 0 THEN i::INTEGER ELSE NULL END) AS i FROM cte TO '${WORK_DIR}/agg-pushdown.vortex'; query TT -EXPLAIN +EXPLAIN (FORMAT json) SELECT sum(i), min(i), max(i), avg(i), mean(i), any_value(i), first(i), count(*), count(i) FROM '${WORK_DIR}/agg-pushdown.vortex'; ---- @@ -49,12 +49,12 @@ SELECT count(i), count(*) FROM '${WORK_DIR}/agg-pushdown.vortex'; # Just count() is rejected because not pushing it down is faster: # we just set chunk length and don't do any aggregation ourselves query TT -EXPLAIN SELECT count(*) FROM '${WORK_DIR}/agg-pushdown.vortex'; +EXPLAIN (FORMAT json) SELECT count(*) FROM '${WORK_DIR}/agg-pushdown.vortex'; ---- :.*UNGROUPED_AGGREGATE.* query TT -EXPLAIN SELECT count(), count(), count() FROM '${WORK_DIR}/agg-pushdown.vortex'; +EXPLAIN (FORMAT json) SELECT count(), count(), count() FROM '${WORK_DIR}/agg-pushdown.vortex'; ---- :.*UNGROUPED_AGGREGATE.* @@ -64,7 +64,7 @@ SELECT count(), count(), count() FROM '${WORK_DIR}/agg-pushdown.vortex'; 100001 100001 100001 query TT -EXPLAIN SELECT min(i), min(i) FROM '${WORK_DIR}/agg-pushdown.vortex'; +EXPLAIN (FORMAT json) SELECT min(i), min(i) FROM '${WORK_DIR}/agg-pushdown.vortex'; ---- :.*UNGROUPED_AGGREGATE.* diff --git a/vortex-sqllogictest/slt/duckdb/cast_pushdown.slt b/vortex-sqllogictest/slt/duckdb/cast_pushdown.slt index 6c95279b94a..3c1c7fbf6f2 100644 --- a/vortex-sqllogictest/slt/duckdb/cast_pushdown.slt +++ b/vortex-sqllogictest/slt/duckdb/cast_pushdown.slt @@ -11,7 +11,7 @@ query TT EXPLAIN SELECT * FROM '$__TEST_DIR__/cast_pushdown-date.vortex' WHERE ts::DATE = '2020-01-01'; ---- -:.*FILTER.* +:.*Filter.* query T SELECT ts FROM '$__TEST_DIR__/cast_pushdown-date.vortex' @@ -27,7 +27,8 @@ TO '$__TEST_DIR__/cast_pushdown.vortex'; # Column is used uncasted query TT -EXPLAIN SELECT * FROM '$__TEST_DIR__/cast_pushdown.vortex'; +EXPLAIN (FORMAT json) +SELECT * FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -69,7 +70,8 @@ SELECT DISTINCT column00::UTINYINT FROM '$__TEST_DIR__/cast_pushdown.vortex' ORD # Column is used casted and uncasted query TT -EXPLAIN SELECT column00, column00::UTINYINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; +EXPLAIN (FORMAT json) +SELECT column00, column00::UTINYINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -112,7 +114,8 @@ WHERE column00 > 0 ORDER BY 1; # Column is used uncasted with filter on casted. # Cast is pushed in WHERE separately query TT -EXPLAIN SELECT column00 FROM '$__TEST_DIR__/cast_pushdown.vortex' +EXPLAIN (FORMAT json) +SELECT column00 FROM '$__TEST_DIR__/cast_pushdown.vortex' WHERE column00::UTINYINT > 0; ---- :.*FILTER.* @@ -158,7 +161,8 @@ ORDER BY column00::UTINYINT; # Two different casts of the same column: conflict query TT -EXPLAIN SELECT column00::UTINYINT, column00::USMALLINT +EXPLAIN (FORMAT json) +SELECT column00::UTINYINT, column00::USMALLINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -180,7 +184,8 @@ FROM '$__TEST_DIR__/cast_pushdown.vortex' ORDER BY 1, 2; # TRY_CAST is not pushed down query TT -EXPLAIN SELECT TRY_CAST(column00 AS UTINYINT) FROM '$__TEST_DIR__/cast_pushdown.vortex'; +EXPLAIN (FORMAT json) +SELECT TRY_CAST(column00 AS UTINYINT) FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -221,7 +226,7 @@ query TT EXPLAIN SELECT column00 FROM '$__TEST_DIR__/cast_pushdown.vortex' WHERE TRY_CAST(column00 AS UTINYINT) > 0; ---- -:.*FILTER.* +:.*Filter.* query I SELECT column00 FROM '$__TEST_DIR__/cast_pushdown.vortex' @@ -291,7 +296,8 @@ FROM '$__TEST_DIR__/cast_pushdown.vortex' ORDER BY 1, 2; # CAST and TRY_CAST of different target types: conflict, pushdown blocked query TT -EXPLAIN SELECT column00::UTINYINT, TRY_CAST(column00 AS USMALLINT) +EXPLAIN (FORMAT json) +SELECT column00::UTINYINT, TRY_CAST(column00 AS USMALLINT) FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -320,12 +326,14 @@ FROM '$__TEST_DIR__/cast_pushdown.vortex' ORDER BY 1, 2; # i128 and u128 casts are not allowed as Vortex doesn't support these types query TT -EXPLAIN SELECT column00::HUGEINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; +EXPLAIN (FORMAT json) +SELECT column00::HUGEINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* query TT -EXPLAIN SELECT column00::UHUGEINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; +EXPLAIN (FORMAT json) +SELECT column00::UHUGEINT FROM '$__TEST_DIR__/cast_pushdown.vortex'; ---- :.*PROJECTION.* @@ -334,14 +342,14 @@ EXPLAIN SELECT column00 FROM '$__TEST_DIR__/cast_pushdown.vortex' WHERE column01::HUGEINT >= column00; ---- -:.*FILTER.* +:.*Filter.* query TT EXPLAIN SELECT column01 FROM '$__TEST_DIR__/cast_pushdown.vortex' WHERE column00::UHUGEINT >= column01 ---- -:.*FILTER.* +:.*Filter.* statement ok COPY (SELECT * FROM ( @@ -362,7 +370,7 @@ query TT EXPLAIN SELECT d FROM '$__TEST_DIR__/cast_pushdown-date-filter.vortex' WHERE d < DATE '1993-07-01' + INTERVAL '3' MONTH; ---- -:.*FILTER.* +:.*Filter.* statement ok CREATE OR REPLACE TABLE tbl(val FLOAT) @@ -376,7 +384,8 @@ COPY (SELECT * FROM tbl) TO '$__TEST_DIR__/cast_pushdown-float.vortex'; # floating point casts are not pushed down because Vortex's behaviour, truncate # to zero, differs from Duckdb's rounding query TT -EXPLAIN SELECT CAST(val AS INTEGER) FROM '$__TEST_DIR__/cast_pushdown-float.vortex'; +EXPLAIN (FORMAT json) +SELECT CAST(val AS INTEGER) FROM '$__TEST_DIR__/cast_pushdown-float.vortex'; ---- :.*PROJECTION.* @@ -411,7 +420,7 @@ query TT EXPLAIN SELECT col::UTINYINT FROM '$__TEST_DIR__/cast_pushdown-many.vortex' WHERE TRY_CAST(col AS UTINYINT) IS NOT NULL; ---- -:.*FILTER.*TRY_CAST.* +:.*Filter.*TRY_CAST.* query TT EXPLAIN SELECT col::UTINYINT FROM '$__TEST_DIR__/cast_pushdown-many.vortex' @@ -432,7 +441,8 @@ COPY (SELECT * FROM (VALUES (1, 'a'), (257, 'b')) AS t(n, s)) TO '$__TEST_DIR__/cast_pushdown-residual-filter.vortex'; query TT -EXPLAIN SELECT n::UTINYINT FROM '$__TEST_DIR__/cast_pushdown-residual-filter.vortex' +EXPLAIN (FORMAT json) +SELECT n::UTINYINT FROM '$__TEST_DIR__/cast_pushdown-residual-filter.vortex' WHERE s || 'x' = 'ax'; ---- :.*FILTER.* diff --git a/vortex-sqllogictest/slt/duckdb/copy_return_stats.slt b/vortex-sqllogictest/slt/duckdb/copy_return_stats.slt index 11a8b7f6888..485404f8a23 100644 --- a/vortex-sqllogictest/slt/duckdb/copy_return_stats.slt +++ b/vortex-sqllogictest/slt/duckdb/copy_return_stats.slt @@ -3,18 +3,14 @@ include ../setup.slt.no -# Byte sizes are matched as `\d+`: they depend on which encodings are compiled in, so the same write -# produces a different size under `--all-features` than under the default feature set. -query TIII?? +query TIII??? COPY (SELECT * FROM (VALUES (1, 'a', 1.5), (2, 'b', NULL)) t(i, s, d)) TO '${WORK_DIR}/copy_return_stats.vortex' (FORMAT vortex, RETURN_STATS); ---- -:\$\{WORK_DIR\}/copy_return_stats\.vortex 2 \d+ 0 \{'"d"'=\{column_size_bytes=\d+, max=1\.5, min=1\.5, null_count=1, num_values=2\}, '"i"'=\{column_size_bytes=\d+, max=2, min=1, null_count=0, num_values=2\}, '"s"'=\{column_size_bytes=\d+, max=b, min=a, null_count=0, num_values=2\}\} NULL +:\$\{WORK_DIR\}/copy_return_stats\.vortex 2 \d+ 0 \{'"d"'=\{column_size_bytes=\d+, max=1\.5, min=1\.5, null_count=1, num_values=2\}, '"i"'=\{column_size_bytes=\d+, max=2, min=1, null_count=0, num_values=2\}, '"s"'=\{column_size_bytes=\d+, max=b, min=a, null_count=0, num_values=2\}\} NULL \{\} -# Vortex reports statistics per top-level field, so nested columns are covered by the file-level -# counts only; the COPY must still succeed. -query TIII?? +query TIII??? COPY (SELECT {'a': 1, 'b': 2} AS st, [1, 2, 3] AS lst, 7 AS i) TO '${WORK_DIR}/copy_return_stats_nested.vortex' (FORMAT vortex, RETURN_STATS); ---- -:\$\{WORK_DIR\}/copy_return_stats_nested\.vortex 1 \d+ 0 \{'"i"'=\{column_size_bytes=\d+, max=7, min=7, null_count=0, num_values=1\}, '"lst"'=\{column_size_bytes=\d+, null_count=0, num_values=1\}, '"st"'=\{column_size_bytes=\d+, null_count=0, num_values=1\}\} NULL +:\$\{WORK_DIR\}/copy_return_stats_nested\.vortex 1 \d+ 0 \{'"i"'=\{column_size_bytes=\d+, max=7, min=7, null_count=0, num_values=1\}, '"lst"'=\{column_size_bytes=\d+, null_count=0, num_values=1\}, '"st"'=\{column_size_bytes=\d+, null_count=0, num_values=1\}\} NULL \{\} diff --git a/vortex-sqllogictest/slt/duckdb/decimal_to_integer.slt b/vortex-sqllogictest/slt/duckdb/decimal_to_integer.slt index 5f04075b0fc..796e6cf8987 100644 --- a/vortex-sqllogictest/slt/duckdb/decimal_to_integer.slt +++ b/vortex-sqllogictest/slt/duckdb/decimal_to_integer.slt @@ -21,7 +21,7 @@ CREATE VIEW decimals AS SELECT * FROM '${WORK_DIR}/decimal_to_integer.vortex'; # DuckDB rounds decimal fractions instead of truncating them. Decimal casts must # stay outside the Vortex scan even though Vortex now supports integer targets. query TT -EXPLAIN SELECT CAST(value AS BIGINT) AS integer_value FROM decimals; +EXPLAIN (FORMAT JSON) SELECT CAST(value AS BIGINT) AS integer_value FROM decimals; ---- :.*PROJECTION.* diff --git a/vortex-sqllogictest/slt/duckdb/mean_all_null.slt b/vortex-sqllogictest/slt/duckdb/mean_all_null.slt index 5ab71f1e0de..cb442b8bd25 100644 --- a/vortex-sqllogictest/slt/duckdb/mean_all_null.slt +++ b/vortex-sqllogictest/slt/duckdb/mean_all_null.slt @@ -11,7 +11,8 @@ statement ok COPY (SELECT * FROM (VALUES (1),(2),(CAST(NULL AS BIGINT))) AS t(x)) TO '${WORK_DIR}/i-some.vortex'; query TT -EXPLAIN SELECT avg(x) FROM '${WORK_DIR}/i-null.vortex'; +EXPLAIN (FORMAT json) +SELECT avg(x) FROM '${WORK_DIR}/i-null.vortex'; ---- :.*UNGROUPED_AGGREGATE.* diff --git a/vortex-sqllogictest/slt/duckdb/nan_aggregates.slt b/vortex-sqllogictest/slt/duckdb/nan_aggregates.slt index 0ec4472e521..1541259749e 100644 --- a/vortex-sqllogictest/slt/duckdb/nan_aggregates.slt +++ b/vortex-sqllogictest/slt/duckdb/nan_aggregates.slt @@ -24,7 +24,7 @@ EXPLAIN SELECT count(*), count(x), sum(x), max(x), avg(x) FROM '${WORK_DIR}/nan-agg.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query IIRRR SELECT count(*), count(x), sum(x), max(x), avg(x) FROM '${WORK_DIR}/nan-agg.vortex'; @@ -35,7 +35,7 @@ query TT EXPLAIN SELECT min(x) FROM '${WORK_DIR}/nan-agg.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query R SELECT min(x) FROM '${WORK_DIR}/nan-agg.vortex'; @@ -46,7 +46,7 @@ query TT EXPLAIN SELECT min(x), max(x) FROM '${WORK_DIR}/nan-agg.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query RR SELECT min(x), max(x) FROM '${WORK_DIR}/nan-agg.vortex'; @@ -140,7 +140,7 @@ query TT EXPLAIN SELECT count(x), sum(x), max(x), avg(x) FROM '${WORK_DIR}/big-plain.vortex'; ---- -:.*UNGROUPED_AGGREGATE.* +:.*Ungrouped Aggregate.* query IRRR SELECT count(x), sum(x), max(x), avg(x) FROM '${WORK_DIR}/big-plain.vortex'; diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q1.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q1.slt.no index 6cfe866fb9d..a8dffb35e1b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q1.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q1.slt.no @@ -309,8 +309,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -330,7 +329,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.customer.c_customer_id" + "Order By": "c_customer_id" } } ], @@ -365,65 +364,42 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_customer_sk", - "sr_store_sk", - "sr_return_amt" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "28576" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_year = 2000i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(sr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_usmallint(#3, 2450821)" + "#3" ], - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } } ], @@ -433,17 +409,17 @@ logical_opt [ "sr_store_sk" ], "Expressions": "sum(sr_return_amt)", - "Estimated Cardinality": "5712" + "Estimated Cardinality": "9030" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "5712" + "Estimated Cardinality": "9030" } } ], @@ -453,93 +429,98 @@ logical_opt [ "ctr_store_sk", "ctr_total_return" ], - "Estimated Cardinality": "5712" + "Estimated Cardinality": "9030" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_customer_id" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "5712" - } - }, - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.s_state = \"TN\")", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "10000" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "9030" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.s_state = \"TN\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ctr_store_sk = s_store_sk)", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(c_customer_sk = ctr_customer_sk)", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ctr_store_sk = s_store_sk)", - "Estimated Cardinality": "5712" + "Expressions": [ + "#1", + "#2", + "#0" + ], + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ctr_customer_sk)", - "Estimated Cardinality": "5712" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "9030" } }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -548,62 +529,121 @@ logical_opt [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "5712" + "CTE Index": "53", + "Estimated Cardinality": "9030" } }, { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "9030" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "53", + "Estimated Cardinality": "9030" + } + } + ], + "extra_info": { + "Groups": "#[21.1]", + "Expressions": "", + "Estimated Cardinality": "4515" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "4515" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ctr_store_sk = ctr_store_sk)", + "Estimated Cardinality": "1806" + } + } + ], + "extra_info": { + "Groups": "ctr_store_sk", + "Expressions": "avg(ctr_total_return)", + "Estimated Cardinality": "903" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "5177" + "Expressions": [ + "(avg(ctr_total_return) * 1.2)", + "ctr_store_sk" + ], + "Estimated Cardinality": "903" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ctr_store_sk = ctr_store_sk)", - "Estimated Cardinality": "1034" + "Conditions": [ + "(ctr_store_sk IS NOT DISTINCT FROM ctr_store_sk)", + "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)" + ], + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Groups": "ctr_store_sk", - "Expressions": "avg(ctr_total_return)", - "Estimated Cardinality": "517" + "Expressions": "#0", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Expressions": [ - "(avg(ctr_total_return) * 1.2)", - "ctr_store_sk" - ], - "Estimated Cardinality": "517" + "Expressions": "#0", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(ctr_store_sk IS NOT DISTINCT FROM ctr_store_sk)" + "CTE Name": "__duckdb_delim_53", + "Table Index": "53", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Expressions": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "5712" + "Expressions": "c_customer_id", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Expressions": "c_customer_id", - "Estimated Cardinality": "5712" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": "#0", "Estimated Cardinality": "100" } } @@ -653,27 +693,30 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2000", + "Filters": [ + "($.d_year = 2000i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_usmallint(#3, 2450821)" + "#3" ], - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } } ], @@ -683,7 +726,7 @@ physical_plan [ "sr_store_sk", "sr_return_amt" ], - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } } ], @@ -693,197 +736,217 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "5712" + "Estimated Cardinality": "9030" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "5712" + "Estimated Cardinality": "9030" } }, { "name": "TOP_N", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_customer_id" + ], + "Estimated Cardinality": "10000" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id" - ], - "Estimated Cardinality": "10000" + "CTE Index": "0", + "Estimated Cardinality": "9030" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "5712" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "s_state='TN'", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ctr_store_sk = s_store_sk", - "Estimated Cardinality": "5712" + "Function": "Vortex Scan", + "Filters": "($.s_state = \"TN\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = ctr_customer_sk", - "Estimated Cardinality": "5712" + "Conditions": "ctr_store_sk = s_store_sk", + "Estimated Cardinality": "9030" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "c_customer_sk = ctr_customer_sk", + "Estimated Cardinality": "9030" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#0" + ], + "Estimated Cardinality": "9030" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "53", + "Estimated Cardinality": "9030" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, - { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "9030" + } + }, + { + "name": "HASH_GROUP_BY", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "53", + "Estimated Cardinality": "9030" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "5712" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "5177" + "Projections": "#[21.1]", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ctr_store_sk = ctr_store_sk", - "Estimated Cardinality": "1034" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "4515" } } ], "extra_info": { - "Projections": [ - "ctr_store_sk", - "ctr_total_return" - ], - "Estimated Cardinality": "1034" + "Join Type": "SEMI", + "Conditions": "ctr_store_sk = ctr_store_sk", + "Estimated Cardinality": "1806" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "517" + "Projections": [ + "ctr_store_sk", + "ctr_total_return" + ], + "Estimated Cardinality": "1806" } } ], "extra_info": { - "Projections": [ - "(avg(ctr_total_return) * 1.2)", - "ctr_store_sk" - ], - "Estimated Cardinality": "517" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "903" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_store_sk IS NOT DISTINCT FROM ctr_store_sk", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#1", - "Aggregates": "", - "Estimated Cardinality": "5177" + "Projections": [ + "(avg(ctr_total_return) * 1.2)", + "ctr_store_sk" + ], + "Estimated Cardinality": "903" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_store_sk IS NOT DISTINCT FROM ctr_store_sk", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Join Type": "INNER", + "Conditions": [ + "ctr_store_sk IS NOT DISTINCT FROM ctr_store_sk", + "CAST(ctr_total_return AS DOUBLE) > SUBQUERY" + ], + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Expression": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "5712" + "Projections": "#0", + "Estimated Cardinality": "9030" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "5712" + "CTE Name": "__duckdb_delim_53", + "Table Index": "53", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "9030" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.customer.c_customer_id ASC" + "Order By": "c_customer_id ASC", + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "customer_total_return", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q10.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q10.slt.no index f60c6ac2ee5..b234f7675de 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q10.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q10.slt.no @@ -370,8 +370,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -565,8 +564,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -760,8 +758,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -813,14 +810,14 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer_demographics.cd_gender", - "memory.main.customer_demographics.cd_marital_status", - "memory.main.customer_demographics.cd_education_status", - "memory.main.customer_demographics.cd_purchase_estimate", - "memory.main.customer_demographics.cd_credit_rating", - "memory.main.customer_demographics.cd_dep_count", - "memory.main.customer_demographics.cd_dep_employed_count", - "memory.main.customer_demographics.cd_dep_college_count" + "cd_gender", + "cd_marital_status", + "cd_education_status", + "cd_purchase_estimate", + "cd_credit_rating", + "cd_dep_count", + "cd_dep_employed_count", + "cd_dep_college_count" ] } } @@ -847,369 +844,701 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "CTE", "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], - "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_education_status", - "cd_purchase_estimate", - "cd_credit_rating", - "cd_dep_count", - "cd_dep_employed_count", - "cd_dep_college_count" - ], - "Estimated Cardinality": "192080" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Rush County\", \"Toole County\", \"Jefferson County\", \"Dona Ana County\", \"La Porte County\"], $.ca_county, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "192080" - } - }, { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Rush County\", \"Toole County\", \"Jefferson County\", \"Dona Ana County\", \"La Porte County\"], $.ca_county, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", + "Estimated Cardinality": "2000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Expressions": [ + "#8", + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "2000" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "2000" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "95", + "Estimated Cardinality": "2000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "95", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Groups": "#[1.0]", + "Expressions": "", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ss_customer_sk = c_customer_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "c_customer_sk", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Expressions": "SUBQUERY", + "Estimated Cardinality": "400" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "(1i64 <= $.d_moy <= 4i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "400" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9999" + "CTE Name": "__duckdb_delim_95", + "Table Index": "95", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57671" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "57671" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "38416" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "CTE Index": "104", + "Estimated Cardinality": "400" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "104", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Groups": "#[101.0]", + "Expressions": "", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "(1i64 <= $.d_moy <= 4i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Expressions": "c_customer_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "MARK", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9785" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "14014" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "14014" + "CTE Name": "__duckdb_delim_104", + "Table Index": "104", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "38416" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ship_customer_sk" - ], - "Estimated Cardinality": "143657" + "CTE Index": "113", + "Estimated Cardinality": "400" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "113", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Groups": "#[110.0]", + "Expressions": "", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(cs_ship_customer_sk = c_customer_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "(1i64 <= $.d_moy <= 4i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Expressions": "c_customer_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9785" + "Join Type": "MARK", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_ship_customer_sk = c_customer_sk)", - "Estimated Cardinality": "28105" + "Expressions": "(SUBQUERY OR SUBQUERY)", + "Estimated Cardinality": "80" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "28105" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "80" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "80" } } ], "extra_info": { - "Expressions": "(SUBQUERY OR SUBQUERY)", - "Estimated Cardinality": "38416" + "CTE Name": "__duckdb_delim_113", + "Table Index": "113", + "Estimated Cardinality": "80" } } ], @@ -1218,13 +1547,13 @@ logical_opt [ "#0", "#1", "#2", - "__internal_compress_integral_usmallint(#3, 500)", + "CAST(#3 AS SMALLINT)", "#4", - "__internal_compress_integral_utinyint(#5, 0)", - "__internal_compress_integral_utinyint(#6, 0)", - "__internal_compress_integral_utinyint(#7, 0)" + "CAST(#5 AS TINYINT)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1240,7 +1569,7 @@ logical_opt [ "cd_dep_college_count" ], "Expressions": "count_star()", - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1249,14 +1578,14 @@ logical_opt [ "#0", "#1", "#2", - "__internal_decompress_integral_bigint(#3, 500)", + "CAST(#3 AS BIGINT)", "#4", - "__internal_decompress_integral_bigint(#5, 0)", - "__internal_decompress_integral_bigint(#6, 0)", - "__internal_decompress_integral_integer(#7, 0)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "CAST(#7 AS INTEGER)", "#8" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1277,13 +1606,13 @@ logical_opt [ "cd_dep_college_count", "cnt6" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "80" } } ] @@ -1307,20 +1636,40 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Projections": [ + "cd_demo_sk", + "cd_gender", + "cd_marital_status", + "cd_education_status", + "cd_purchase_estimate", + "cd_credit_rating", + "cd_dep_count", + "cd_dep_employed_count", + "cd_dep_college_count" + ], + "Estimated Cardinality": "192080" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1329,69 +1678,69 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", "Projections": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_education_status", - "cd_purchase_estimate", - "cd_credit_rating", - "cd_dep_count", - "cd_dep_employed_count", - "cd_dep_college_count" + "c_customer_sk", + "c_current_cdemo_sk", + "c_current_addr_sk" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "10000" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Rush County\", \"Toole County\", \"Jefferson County\", \"Dona Ana County\", \"La Porte County\"], $.ca_county, opts=sql_null_semantics)", - "Projections": "ca_address_sk", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"Rush County\", \"Toole County\", \"Jefferson County\", \"Dona Ana County\", \"La Porte County\"], $.ca_county, opts=sql_null_semantics)", + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cd_demo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "192080" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "2000" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Projections": [ + "#8", + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "2000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "38416" + "CTE Index": "95", + "Estimated Cardinality": "2000" } }, { @@ -1416,168 +1765,282 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "95", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Projections": "#[1.0]", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Join Type": "SEMI", + "Conditions": "ss_customer_sk = c_customer_sk", + "Estimated Cardinality": "57692" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "9999" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57671" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": "c_customer_sk", - "Estimated Cardinality": "57671" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "SEMI", + "Join Type": "MARK", "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#8", - "Aggregates": "", - "Estimated Cardinality": "9999" + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416", - "Delim Index": "1" + "Expression": "SUBQUERY", + "Estimated Cardinality": "400" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_95", + "Table Index": "95", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "400" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "104", + "Estimated Cardinality": "400" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "38416" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "104", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "400" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": "#[101.0]", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "9785" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "14014" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "14014" + "Join Type": "SEMI", + "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#8", - "Aggregates": "", - "Estimated Cardinality": "9785" + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416", - "Delim Index": "2" + "Projections": "c_customer_sk", + "Estimated Cardinality": "14326" } - }, + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_104", + "Table Index": "104", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "400" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "CTE Index": "113", + "Estimated Cardinality": "400" } }, { @@ -1602,86 +2065,129 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "113", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Projections": "#[110.0]", + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "200" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Join Type": "SEMI", + "Conditions": "cs_ship_customer_sk = c_customer_sk", + "Estimated Cardinality": "28731" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "3", - "Estimated Cardinality": "9785" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2002i64)", + "(1i64 <= $.d_moy <= 4i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_ship_customer_sk = c_customer_sk", - "Estimated Cardinality": "28105" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { "Projections": "c_customer_sk", - "Estimated Cardinality": "28105" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#8", - "Aggregates": "", - "Estimated Cardinality": "9785" + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "0", - "Delim Index": "3" + "Expression": "(SUBQUERY OR SUBQUERY)", + "Estimated Cardinality": "80" } } ], "extra_info": { - "Expression": "(SUBQUERY OR SUBQUERY)", - "Estimated Cardinality": "38416" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "80" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7" - ], - "Estimated Cardinality": "38416" + "CTE Name": "__duckdb_delim_113", + "Table Index": "113", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "80" } } ], @@ -1690,13 +2196,13 @@ physical_plan [ "#0", "#1", "#2", - "__internal_compress_integral_usmallint(#3, 500)", + "CAST(#3 AS SMALLINT)", "#4", - "__internal_compress_integral_utinyint(#5, 0)", - "__internal_compress_integral_utinyint(#6, 0)", - "__internal_compress_integral_utinyint(#7, 0)" + "CAST(#5 AS TINYINT)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1711,7 +2217,7 @@ physical_plan [ "cd_dep_employed_count", "cd_dep_college_count" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1727,7 +2233,7 @@ physical_plan [ "#7" ], "Aggregates": "count_star()", - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1736,14 +2242,14 @@ physical_plan [ "#0", "#1", "#2", - "__internal_decompress_integral_bigint(#3, 500)", + "CAST(#3 AS BIGINT)", "#4", - "__internal_decompress_integral_bigint(#5, 0)", - "__internal_decompress_integral_bigint(#6, 0)", - "__internal_decompress_integral_integer(#7, 0)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "CAST(#7 AS INTEGER)", "#8" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], @@ -1764,22 +2270,23 @@ physical_plan [ "cd_dep_college_count", "cnt6" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "80" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer_demographics.cd_gender ASC", - "memory.main.customer_demographics.cd_marital_status ASC", - "memory.main.customer_demographics.cd_education_status ASC", - "memory.main.customer_demographics.cd_purchase_estimate ASC", - "memory.main.customer_demographics.cd_credit_rating ASC", - "memory.main.customer_demographics.cd_dep_count ASC", - "memory.main.customer_demographics.cd_dep_employed_count ASC", - "memory.main.customer_demographics.cd_dep_college_count ASC" - ] + "cd_gender ASC", + "cd_marital_status ASC", + "cd_education_status ASC", + "cd_purchase_estimate ASC", + "cd_credit_rating ASC", + "cd_dep_count ASC", + "cd_dep_employed_count ASC", + "cd_dep_college_count ASC" + ], + "Estimated Cardinality": "80" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q11.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q11.slt.no index 1952b86551c..bf397e2d7c4 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q11.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q11.slt.no @@ -572,10 +572,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "t_s_secyear.customer_id", - "t_s_secyear.customer_first_name", - "t_s_secyear.customer_last_name", - "t_s_secyear.customer_preferred_cust_flag" + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ] } } @@ -599,117 +599,179 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#3" + ], + "Expressions": "sum((ss_ext_list_price - ss_ext_discount_amt)) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_discount_amt", - "ss_ext_list_price" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], "Estimated Cardinality": "288464" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", + "Groups": [ "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", - "c_email_address" + "c_email_address", + "#0" ], - "Estimated Cardinality": "10000" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" + ], "Estimated Cardinality": "288464" } } @@ -718,193 +780,233 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1900)", + "#2", "#3", "#4", - "#5", - "#6", - "#7", - "#8", - "#9" + "finalize(#5)" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year" + "Expressions": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Expressions": "sum((ss_ext_list_price - ss_ext_discount_amt))", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "(sale_type = 's')", + "(((dyear = 2002) AND (sale_type = 's')) OR ((year_total > 0.00) AND ((dyear = 2001) AND (sale_type = 's'))))" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "57692" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag", + "dyear", + "year_total", + "sale_type" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag", - "dyear", - "year_total", - "sale_type" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#3" + ], + "Expressions": "sum((ws_ext_list_price - ws_ext_discount_amt)) EXPORT_STATE", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_ext_discount_amt", - "ws_ext_list_price" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], "Estimated Cardinality": "71632" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Groups": [ "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", - "c_email_address" + "c_email_address", + "#0" ], - "Estimated Cardinality": "10000" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" + ], "Estimated Cardinality": "71632" } } @@ -913,88 +1015,83 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1900)", + "#2", "#3", "#4", - "#5", - "#6", - "#7", - "#8", - "#9" + "finalize(#5)" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year" + "Expressions": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Expressions": "sum((ws_ext_list_price - ws_ext_discount_amt))", "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "(sale_type = 'w')", + "(((dyear = 2002) AND (sale_type = 'w')) OR ((year_total > 0.00) AND ((dyear = 2001) AND (sale_type = 'w'))))" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "14326" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag", + "dyear", + "year_total", + "sale_type" + ], + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag", - "dyear", - "year_total", - "sale_type" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "14326" + "Expressions": "", + "Estimated Cardinality": "360096" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "72018" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Estimated Cardinality": "360096" } } ], @@ -1007,17 +1104,18 @@ logical_opt [ "#4", "#5", "#6" - ] + ], + "Estimated Cardinality": "360096" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -1033,17 +1131,16 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Expressions": [ - "(dyear = 2001)", - "(year_total > 0.00)", + "(dyear = 2002)", "(sale_type = 's')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } }, { @@ -1054,23 +1151,24 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Expressions": [ - "(dyear = 2002)", + "(dyear = 2001)", + "(year_total > 0.00)", "(sale_type = 's')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966912" } }, { @@ -1084,7 +1182,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], @@ -1094,7 +1192,7 @@ logical_opt [ "(year_total > 0.00)", "(sale_type = 'w')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } }, { @@ -1105,7 +1203,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], @@ -1114,14 +1212,14 @@ logical_opt [ "(dyear = 2002)", "(sale_type = 'w')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966912" } } ], @@ -1131,29 +1229,34 @@ logical_opt [ "(customer_id = customer_id)", "(CASE WHEN ((year_total > 0.00)) THEN ((CAST((year_total * 1.0000) AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE 0.0 END < CASE WHEN ((year_total > 0.00)) THEN ((CAST((year_total * 1.0000) AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE 0.0 END)" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38513421956" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "57955887304299528" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "38513421956" } } ], "extra_info": { - "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag" - ], - "Estimated Cardinality": "57955887304299528" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "100" } } @@ -1176,39 +1279,130 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_ext_discount_amt", + "ss_ext_list_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#3", + "(ss_ext_list_price - ss_ext_discount_amt)" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_discount_amt", - "ss_ext_list_price" + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" ], "Estimated Cardinality": "288464" } @@ -1218,95 +1412,84 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_year" + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address" - ], - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", + "Projections": [ + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address", "#0", - "#1", - "__internal_compress_integral_utinyint(#2, 1900)", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8", - "#9" + "#1" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year", - "(ss_ext_list_price - ss_ext_discount_amt)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], + "Aggregates": "combine_aggr(#8)", "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", "#3", - "#4", - "#5", - "#6", - "#7" + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" ], - "Aggregates": "sum(#8)", "Estimated Cardinality": "288464" } } @@ -1318,31 +1501,29 @@ physical_plan [ "#2", "#3", "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "finalize(#5)" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expression": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "57692" + "Projections": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#7", - "#8" - ], - "Estimated Cardinality": "57692" + "Expression": "((sale_type = 's') AND (((dyear = 2002) AND (sale_type = 's')) OR ((year_total > 0.00) AND ((dyear = 2001) AND (sale_type = 's')))))", + "Estimated Cardinality": "288464" } } ], @@ -1356,46 +1537,137 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk", + "ws_ext_discount_amt", + "ws_ext_list_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#3", + "(ws_ext_list_price - ws_ext_discount_amt)" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_ext_discount_amt", - "ws_ext_list_price" + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" ], "Estimated Cardinality": "71632" } @@ -1405,95 +1677,84 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_year" + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address" - ], - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Projections": [ + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address", "#0", - "#1", - "__internal_compress_integral_utinyint(#2, 1900)", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8", - "#9" + "#1" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year", - "(ws_ext_list_price - ws_ext_discount_amt)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], + "Aggregates": "combine_aggr(#8)", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", "#3", - "#4", - "#5", - "#6", - "#7" + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" ], - "Aggregates": "sum(#8)", "Estimated Cardinality": "71632" } } @@ -1505,31 +1766,29 @@ physical_plan [ "#2", "#3", "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "finalize(#5)" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expression": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "14326" + "Projections": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#7", - "#8" - ], - "Estimated Cardinality": "14326" + "Expression": "((sale_type = 'w') AND (((dyear = 2002) AND (sale_type = 'w')) OR ((year_total > 0.00) AND ((dyear = 2001) AND (sale_type = 'w')))))", + "Estimated Cardinality": "71632" } } ], @@ -1543,7 +1802,7 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71632" } } ], @@ -1572,22 +1831,25 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { - "Expression": "((dyear = 2001) AND (year_total > 0.00) AND (sale_type = 's'))", - "Estimated Cardinality": "72018" + "Expression": "((dyear = 2002) AND (sale_type = 's'))", + "Estimated Cardinality": "360096" } } ], "extra_info": { "Projections": [ "#0", + "#1", + "#2", + "#3", "#5" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } }, { @@ -1601,32 +1863,29 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { - "Expression": "((dyear = 2002) AND (sale_type = 's'))", - "Estimated Cardinality": "72018" + "Expression": "((dyear = 2001) AND (year_total > 0.00) AND (sale_type = 's'))", + "Estimated Cardinality": "360096" } } ], "extra_info": { "Projections": [ "#0", - "#1", - "#2", - "#3", "#5" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966912" } }, { @@ -1643,13 +1902,13 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Expression": "((dyear = 2001) AND (year_total > 0.00) AND (sale_type = 'w'))", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], @@ -1658,7 +1917,7 @@ physical_plan [ "#0", "#5" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } }, { @@ -1672,13 +1931,13 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Expression": "((dyear = 2002) AND (sale_type = 'w'))", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], @@ -1687,14 +1946,14 @@ physical_plan [ "#0", "#5" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360096" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966912" } } ], @@ -1704,35 +1963,37 @@ physical_plan [ "customer_id = customer_id", "CASE WHEN ((year_total > 0.00)) THEN ((CAST((year_total * 1.0000) AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE 0.0 END < CASE WHEN ((year_total > 0.00)) THEN ((CAST((year_total * 1.0000) AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE 0.0 END" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38513421956" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "#3" + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38513421956" } } ], "extra_info": { "Top": "100", "Order By": [ - "t_s_secyear.customer_id ASC", - "t_s_secyear.customer_first_name ASC", - "t_s_secyear.customer_last_name ASC", - "t_s_secyear.customer_preferred_cust_flag ASC" - ] + "customer_id ASC", + "customer_first_name ASC", + "customer_last_name ASC", + "customer_preferred_cust_flag ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "year_total", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q12.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q12.slt.no index cfca16c7127..88506fcd7bc 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q12.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q12.slt.no @@ -245,11 +245,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_category", - "memory.main.item.i_class", - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "((sum(memory.main.web_sales.ws_ext_sales_price) * 100.0000) / sum(sum(memory.main.web_sales.ws_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class))" + "i_category", + "i_class", + "i_item_id", + "i_item_desc", + "revenueratio" ] } } @@ -270,146 +270,75 @@ logical_opt [ "name": "WINDOW", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450816)" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "71632" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "i_category", - "i_class", - "i_current_price" - ], - "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Groups": [ + "i_item_id", + "i_item_desc", + "i_category", + "i_class", + "i_current_price" ], - "Estimated Cardinality": "71632" + "Expressions": "sum(ws_ext_sales_price)", + "Estimated Cardinality": "14325" } } ], "extra_info": { "Expressions": "sum(sum(ws_ext_sales_price)) OVER (PARTITION BY i_class)", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14325" } } ], @@ -423,7 +352,7 @@ logical_opt [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14325" } } ], @@ -453,48 +382,21 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Projections": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_ext_sales_price" + ], "Estimated Cardinality": "71632" } }, @@ -503,33 +405,43 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Projections": [ + "i_item_sk", + "i_item_id", + "i_item_desc", + "i_current_price", + "i_class", + "i_category" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "71632" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450816)" - ], - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], @@ -542,7 +454,7 @@ physical_plan [ "i_current_price", "ws_ext_sales_price" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14326" } } ], @@ -555,12 +467,13 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14325" } } ], "extra_info": { - "Projections": "sum(sum(ws_ext_sales_price)) OVER (PARTITION BY i_class)" + "Projections": "sum(sum(ws_ext_sales_price)) OVER (PARTITION BY i_class)", + "Estimated Cardinality": "14325" } } ], @@ -574,7 +487,7 @@ physical_plan [ "#5", "#6" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14325" } } ], @@ -588,19 +501,20 @@ physical_plan [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14325" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.item.i_category ASC", - "memory.main.item.i_class ASC", - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "((sum(memory.main.web_sales.ws_ext_sales_price) * 100.0000) / sum(sum(memory.main.web_sales.ws_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class)) ASC" - ] + "i_category ASC", + "i_class ASC", + "i_item_id ASC", + "i_item_desc ASC", + "revenueratio ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q13.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q13.slt.no index 5e794eac6a6..c708aed87a0 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q13.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q13.slt.no @@ -342,216 +342,156 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Advanced Degree\")) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\"))) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"2 yr Degree\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"S\")) or ($.cd_marital_status = \"W\"))", + "((($.cd_education_status = \"Advanced Degree\") or ($.cd_education_status = \"College\")) or ($.cd_education_status = \"2 yr Degree\"))", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "192080" + "Estimated Cardinality": "38416" } - } - ], - "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" - ], - "Estimated Cardinality": "192080" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_cdemo_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Filters": [ + "(((($.ss_net_profit >= decimal128(10000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(20000, precision=7, scale=2))) or (($.ss_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(30000, precision=7, scale=2)))) or (($.ss_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(25000, precision=7, scale=2))))", + "(((($.ss_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ss_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ss_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(20000, precision=7, scale=2))))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_country = \"United States\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" + "Filters": [ + "((vortex.list.contains([\"TX\", \"OH\", \"TX\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"OR\", \"NM\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"VA\", \"TX\", \"MS\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" ], - "Estimated Cardinality": "200" + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "11535" + "Conditions": [ + "(ss_addr_sk = ca_address_sk)", + "((((ss_net_profit >= 100.00) AND (ss_net_profit <= 200.00)) AND (ca_state IN ('TX', 'OH', 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 300.00)) AND (ca_state IN ('OR', 'NM', 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 250.00)) AND (ca_state IN ('VA', 'TX', 'MS'))))" + ], + "Estimated Cardinality": "2307" } - } - ], - "extra_info": { - "Expressions": "((((ss_net_profit >= 100.00) AND (ss_net_profit <= 200.00)) AND ((ca_state = 'TX') OR (ca_state = 'OH') OR (ca_state = 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 300.00)) AND ((ca_state = 'OR') OR (ca_state = 'NM') OR (ca_state = 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 250.00)) AND ((ca_state = 'VA') OR (ca_state = 'TX') OR (ca_state = 'MS'))))", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "((($.hd_dep_count = 3i64) or ($.hd_dep_count = 1i64)) or ($.hd_dep_count = 1i64))", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "1440" } } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "461" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11535" + "Conditions": [ + "(cd_demo_sk = ss_cdemo_sk)", + "(((hd_dep_count = 3) AND ((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))" + ], + "Estimated Cardinality": "61" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cd_demo_sk = ss_cdemo_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "7200" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_dep_count" - ], - "Estimated Cardinality": "7200" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "61" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(d_date_sk = ss_sold_date_sk)", + "Estimated Cardinality": "61" } } ], "extra_info": { - "Expressions": "(((hd_dep_count = 3) AND ((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))", - "Estimated Cardinality": "11535" + "Groups": "", + "Expressions": [ + "sum(ss_quantity)", + "sum(ss_ext_sales_price)", + "sum(ss_ext_wholesale_cost)", + "count(ss_quantity)", + "count(ss_ext_sales_price)", + "count(ss_ext_wholesale_cost)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "avg(ss_quantity)", - "avg(ss_ext_sales_price)", - "avg(ss_ext_wholesale_cost)", - "sum(ss_ext_wholesale_cost)" + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "\"/\"(CAST(#1 AS DOUBLE), CAST(#4 AS DOUBLE))", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#5 AS DOUBLE))", + "#2" ], "Estimated Cardinality": "1" } @@ -570,17 +510,30 @@ logical_opt [ ] physical_plan [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -592,105 +545,74 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Advanced Degree\")) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\"))) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"2 yr Degree\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"S\")) or ($.cd_marital_status = \"W\"))", + "((($.cd_education_status = \"Advanced Degree\") or ($.cd_education_status = \"College\")) or ($.cd_education_status = \"2 yr Degree\"))", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], "Projections": [ "cd_demo_sk", "cd_marital_status", "cd_education_status" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "38416" } }, { "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_cdemo_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_country='United States'", - "Projections": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "11535" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expression": "((((ss_net_profit >= 100.00) AND (ss_net_profit <= 200.00)) AND ((ca_state = 'TX') OR (ca_state = 'OH') OR (ca_state = 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 300.00)) AND ((ca_state = 'OR') OR (ca_state = 'NM') OR (ca_state = 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 250.00)) AND ((ca_state = 'VA') OR (ca_state = 'TX') OR (ca_state = 'MS'))))", - "Estimated Cardinality": "11535" + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_net_profit >= decimal128(10000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(20000, precision=7, scale=2))) or (($.ss_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(30000, precision=7, scale=2)))) or (($.ss_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(25000, precision=7, scale=2))))", + "(((($.ss_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ss_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ss_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(20000, precision=7, scale=2))))" + ], + "Projections": [ + "ss_sold_date_sk", + "ss_cdemo_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_quantity", + "ss_sales_price", + "ss_ext_sales_price", + "ss_ext_wholesale_cost", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "((vortex.list.contains([\"TX\", \"OH\", \"TX\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"OR\", \"NM\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"VA\", \"TX\", \"MS\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" + ], + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" + "Join Type": "INNER", + "Conditions": [ + "ss_addr_sk = ca_address_sk", + "((((ss_net_profit >= 100.00) AND (ss_net_profit <= 200.00)) AND (ca_state IN ('TX', 'OH', 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 300.00)) AND (ca_state IN ('OR', 'NM', 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 250.00)) AND (ca_state IN ('VA', 'TX', 'MS'))))" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "2307" } }, { @@ -698,22 +620,29 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Filters": "((($.hd_dep_count = 3i64) or ($.hd_dep_count = 1i64)) or ($.hd_dep_count = 1i64))", + "Projections": [ + "hd_demo_sk", + "hd_dep_count" + ], + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "461" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cd_demo_sk = ss_cdemo_sk", - "Estimated Cardinality": "11535" + "Conditions": [ + "cd_demo_sk = ss_cdemo_sk", + "(((hd_dep_count = 3) AND ((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))" + ], + "Estimated Cardinality": "61" } }, { @@ -721,55 +650,59 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "hd_demo_sk", - "hd_dep_count" - ], - "Estimated Cardinality": "7200" + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "61" } } ], "extra_info": { - "Expression": "(((hd_dep_count = 3) AND ((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR ((hd_dep_count = 1) AND ((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))", - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "d_date_sk = ss_sold_date_sk", + "Estimated Cardinality": "61" } } ], "extra_info": { "Projections": [ - "#2", - "#4", - "#5" + "ss_quantity", + "ss_ext_sales_price", + "ss_ext_wholesale_cost", + "ss_quantity", + "ss_ext_sales_price", + "ss_ext_wholesale_cost" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "61" } } ], "extra_info": { - "Projections": [ - "ss_quantity", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_ext_wholesale_cost" + "Aggregates": [ + "sum(#0)", + "sum(#1)", + "sum(#2)", + "count(#3)", + "count(#4)", + "count(#5)" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "avg(#1)", - "avg(#2)", - "sum(#3)" - ] + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "\"/\"(CAST(#1 AS DOUBLE), CAST(#4 AS DOUBLE))", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#5 AS DOUBLE))", + "#2" + ], + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q14.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q14.slt.no index 9585cd9a3b5..43686f61809 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q14.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q14.slt.no @@ -1409,7 +1409,7 @@ logical_plan [ "extra_info": { "Groups": "", "Expressions": [ - "\"first\"(#[201.0])", + "\"first\"(#[202.0])", "count_star()" ] } @@ -1683,7 +1683,7 @@ logical_plan [ "extra_info": { "Groups": "", "Expressions": [ - "\"first\"(#[246.0])", + "\"first\"(#[247.0])", "count_star()" ] } @@ -1957,7 +1957,7 @@ logical_plan [ "extra_info": { "Groups": "", "Expressions": [ - "\"first\"(#[291.0])", + "\"first\"(#[292.0])", "count_star()" ] } @@ -2026,10 +2026,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "y.channel", - "y.i_brand_id", - "y.i_class_id", - "y.i_category_id" + "channel", + "i_brand_id", + "i_class_id", + "i_category_id" ] } } @@ -2071,46 +2071,88 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "INTERSECT", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "INTERSECT", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "INTERSECT", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "INTERSECT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk" + "brand_id", + "class_id", + "category_id" ], "Estimated Cardinality": "288464" } @@ -2119,164 +2161,87 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "brand_id", - "class_id", - "category_id" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", + "Expressions": "", "Estimated Cardinality": "143657" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "i_brand_id", - "i_class_id", - "i_category_id" + "CAST(#0 AS INTEGER)", + "CAST(#1 AS TINYINT)", + "CAST(#2 AS TINYINT)" ], "Estimated Cardinality": "143657" } @@ -2284,51 +2249,42 @@ logical_opt [ ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "110363", + "Distinct Targets": [ + "brand_id", + "class_id", + "category_id" + ] } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_uinteger(#0, 1001001)", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "110363" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "143657", - "Distinct Targets": [ - "brand_id", - "class_id", - "category_id" - ] + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "110363" } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -2338,19 +2294,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -2362,25 +2306,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -2395,39 +2325,43 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Expressions": [ + "i_brand_id", + "i_class_id", + "i_category_id" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ - "i_brand_id", - "i_class_id", - "i_category_id" - ], + "Expressions": "", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_uinteger(#0, 1001001)", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" + "CAST(#0 AS INTEGER)", + "CAST(#1 AS TINYINT)", + "CAST(#2 AS TINYINT)" ], "Estimated Cardinality": "71632" } @@ -2435,7 +2369,7 @@ logical_opt [ ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "71632", + "Estimated Cardinality": "62608", "Distinct Targets": [ "brand_id", "class_id", @@ -2446,33 +2380,19 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -2484,258 +2404,213 @@ logical_opt [ "(class_id = i_class_id)", "(category_id = i_category_id)" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } } ], "extra_info": { "Expressions": "ss_item_sk", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } }, { - "name": "CTE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": [ + "quantity", + "list_price" + ], "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_quantity", - "ss_list_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "quantity", + "list_price" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "quantity", - "list_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_quantity", - "cs_list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "Expressions": [ + "quantity", + "list_price" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "quantity", - "list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_quantity", - "ws_list_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Expressions": "", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" + "Expressions": "(CAST(quantity AS DECIMAL(26,0)) * CAST(list_price AS DECIMAL(26,2)))", + "Estimated Cardinality": "503753" } } ], "extra_info": { + "Groups": "", "Expressions": [ - "quantity", - "list_price" + "sum(#0)", + "count(#0)" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "503753" + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg((CAST(quantity AS DECIMAL(26,0)) * CAST(list_price AS DECIMAL(26,2))))", + "Expressions": "average_sales", "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": "average_sales", - "Estimated Cardinality": "1" - } - }, - { - "name": "TOP_N", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "TOP_N", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", @@ -2747,10 +2622,10 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "UNION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -2759,250 +2634,393 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_quantity", - "ss_list_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 11i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Expressions": "ss_item_sk", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ss_item_sk = #0)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": [ + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Expressions": [ + "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2))))", + "count_star()" + ], + "Estimated Cardinality": "51737" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "51737" + } + }, { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "average_sales", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ss_item_sk", - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", + "Estimated Cardinality": "51737" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(ss_item_sk = #0)", - "Estimated Cardinality": "11535" + "Expressions": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sales", + "number_sales" + ], + "Estimated Cardinality": "51737" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Expressions": "ss_item_sk", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(cs_item_sk = #0)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Groups": [ + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Expressions": [ + "sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2))))", + "count_star()" + ], + "Estimated Cardinality": "27199" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "27199" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "average_sales", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(CAST(sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", + "Estimated Cardinality": "27199" } } ], "extra_info": { "Expressions": [ - "i_item_sk", + "channel", "i_brand_id", "i_class_id", - "i_category_id" + "i_category_id", + "sales", + "number_sales" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "27199" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 2450816)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "__internal_compress_integral_usmallint(#4, 2450816)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" - ], - "Estimated Cardinality": "11535" - } - } - ], - "extra_info": { - "Groups": [ - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Expressions": [ - "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2))))", - "count_star()" - ], - "Estimated Cardinality": "11534" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "average_sales", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "11534" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": "ss_item_sk", - "Estimated Cardinality": "71632" - } - }, { "name": "COMPARISON_JOIN", "children": [ @@ -3010,473 +3028,744 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Expressions": "ss_item_sk", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ws_item_sk = #0)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "14326" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" + "Groups": [ + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Expressions": [ + "sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2))))", + "count_star()" + ], + "Estimated Cardinality": "13938" } } ], "extra_info": { "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_quantity", - "cs_list_price" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "13938" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "average_sales", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 11i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - } - ], - "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "(#0 = cs_item_sk)", - "Estimated Cardinality": "5744" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Conditions": "(CAST(sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", + "Estimated Cardinality": "13938" } } ], "extra_info": { "Expressions": [ - "i_item_sk", + "channel", "i_brand_id", "i_class_id", - "i_category_id" + "i_category_id", + "sales", + "number_sales" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "13938" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "5744" + "Expressions": "", + "Estimated Cardinality": "92874" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 2450815)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "__internal_compress_integral_usmallint(#4, 2450815)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "#4", + "#5" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "92874" } } ], "extra_info": { "Groups": [ + "channel", "i_brand_id", "i_class_id", "i_category_id" ], "Expressions": [ - "sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2))))", - "count_star()" + "sum(sales) EXPORT_STATE", + "sum(number_sales) EXPORT_STATE" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "46437" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4" + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "#4", + "#5" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "46437" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "46437" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "310", + "Estimated Cardinality": "46437" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "46437" + } + } + ], "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "1" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Expressions": [ + "combine_aggr(#4)", + "combine_aggr(#5)" + ], + "Estimated Cardinality": "23218" } } ], "extra_info": { - "Expressions": "average_sales", - "Estimated Cardinality": "1" + "Expressions": [ + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "23218" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "#0", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "23218" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(CAST(sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "5743" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "5743" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "314", + "Estimated Cardinality": "23218" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" + "Expressions": [ + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "23218" } } ], "extra_info": { - "Expressions": "ss_item_sk", - "Estimated Cardinality": "71632" + "Groups": [ + "#0", + "#1" + ], + "Expressions": [ + "combine_aggr(#3)", + "combine_aggr(#4)" + ], + "Estimated Cardinality": "11609" } - }, + } + ], + "extra_info": { + "Expressions": [ + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "#2", + "#3" + ], + "Estimated Cardinality": "11609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "11609" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "318", + "Estimated Cardinality": "11609" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_string_ubigint(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "11609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Groups": "#0", + "Expressions": [ + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "5804" } } ], "extra_info": { "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_quantity", - "ws_list_price" + "__internal_decompress_string(#0)", + "#1", + "#2" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "5804" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "5804" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "322", + "Estimated Cardinality": "5804" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "combine_aggr(#1)", + "combine_aggr(#2)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#0)", + "finalize(#1)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "322", + "Estimated Cardinality": "5804" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "5804" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "318", + "Estimated Cardinality": "11609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "11609" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "314", + "Estimated Cardinality": "23218" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "NULL::BIGINT", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "23218" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "310", + "Estimated Cardinality": "46437" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 11i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)", + "finalize(#5)" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "46437" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Expressions": "", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - } - ], - "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "(#0 = ws_item_sk)", - "Estimated Cardinality": "2864" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Estimated Cardinality": "1800" + "CTE Name": "__grouping_sets_cte_322", + "Table Index": "322", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "2864" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 2450816)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "__internal_compress_integral_usmallint(#4, 2450816)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" - ], - "Estimated Cardinality": "2864" - } - } - ], - "extra_info": { - "Groups": [ - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Expressions": [ - "sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2))))", - "count_star()" - ], - "Estimated Cardinality": "2864" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4" - ], - "Estimated Cardinality": "2864" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "1" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Expressions": "average_sales", - "Estimated Cardinality": "1" + "CTE Name": "__grouping_sets_cte_318", + "Table Index": "318", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "CTE Name": "__grouping_sets_cte_314", + "Table Index": "314", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(CAST(sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "2864" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Expressions": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "2864" + "CTE Name": "__grouping_sets_cte_310", + "Table Index": "310", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "20141" + "Expressions": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sum_sales", + "sum_number_sales" + ], + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Groups": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Expressions": [ - "sum(sales)", - "sum(number_sales)" - ], - "Estimated Cardinality": "20140" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { "Expressions": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sum_sales", - "sum_number_sales" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "20140" + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "CTE Name": "avg_sales", + "Table Index": "1", "Estimated Cardinality": "100" } } ], "extra_info": { - "CTE Name": "avg_sales", - "Table Index": "1", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], "Estimated Cardinality": "100" } } @@ -3703,9 +3992,9 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_uinteger(#0, 1001001)", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" + "CAST(#0 AS INTEGER)", + "CAST(#1 AS TINYINT)", + "CAST(#2 AS TINYINT)" ], "Estimated Cardinality": "143657" } @@ -3734,11 +4023,11 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "110363" } }, { @@ -3838,9 +4127,9 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_uinteger(#0, 1001001)", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" + "CAST(#0 AS INTEGER)", + "CAST(#1 AS TINYINT)", + "CAST(#2 AS TINYINT)" ], "Estimated Cardinality": "71632" } @@ -3869,11 +4158,11 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } }, { @@ -3898,767 +4187,1135 @@ physical_plan [ "class_id = i_class_id", "category_id = i_category_id" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } } ], "extra_info": { "Projections": "ss_item_sk", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "62608" } }, { "name": "CTE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "UNION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_quantity", + "ss_list_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_quantity", - "ss_list_price" + "quantity", + "list_price" ], "Estimated Cardinality": "288464" } }, { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Projections": [ - "quantity", - "list_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_quantity", + "cs_list_price" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_quantity", - "cs_list_price" + "quantity", + "list_price" ], "Estimated Cardinality": "143657" } }, { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Projections": [ - "quantity", - "list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_quantity", + "ws_list_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999i64 <= $.d_year <= 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_quantity", - "ws_list_price" + "quantity", + "list_price" ], "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1999i64 <= $.d_year <= 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "71632" - } + "extra_info": {} } ], "extra_info": { - "Projections": [ - "quantity", - "list_price" - ], - "Estimated Cardinality": "71632" + "Projections": "(CAST(quantity AS DECIMAL(26,0)) * CAST(list_price AS DECIMAL(26,2)))", + "Estimated Cardinality": "503753" } } ], - "extra_info": {} + "extra_info": { + "Projections": [ + "#0", + "#0" + ], + "Estimated Cardinality": "503753" + } } ], "extra_info": { - "Projections": "(CAST(quantity AS DECIMAL(26,0)) * CAST(list_price AS DECIMAL(26,2)))", - "Estimated Cardinality": "503753" + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": "avg(#0)" + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" } }, { "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "NESTED_LOOP_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "NESTED_LOOP_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_quantity", - "ss_list_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_quantity", + "ss_list_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "ss_item_sk = #0", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Projections": [ + "i_brand_id", + "i_class_id", + "i_category_id", + "(CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "sum(#3)", + "count_star()" + ], + "Estimated Cardinality": "51737" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "51737" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ { "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" + "CTE Index": "1", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "ss_item_sk = #0", - "Estimated Cardinality": "11535" + "Projections": "#0", + "Estimated Cardinality": "1" } - }, + } + ], + "extra_info": { + "Aggregates": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", + "Estimated Cardinality": "51737" + } + } + ], + "extra_info": { + "Projections": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sales", + "number_sales" + ], + "Estimated Cardinality": "51737" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "NESTED_LOOP_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_quantity", + "cs_list_price" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "cs_item_sk = #0", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Projections": [ + "i_brand_id", + "i_class_id", + "i_category_id", + "(CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "sum(#3)", + "count_star()" + ], + "Estimated Cardinality": "27199" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "27199" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Estimated Cardinality": "1800" + "Projections": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Aggregates": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 2450816)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "__internal_compress_integral_usmallint(#4, 2450816)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" ], - "Estimated Cardinality": "11535" - } - } - ], - "extra_info": { - "Projections": [ - "i_brand_id", - "i_class_id", - "i_category_id", - "(CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))" - ], - "Estimated Cardinality": "11535" - } - } - ], - "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" - ], - "Aggregates": [ - "sum(#3)", - "count_star()" - ], - "Estimated Cardinality": "11534" - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "CAST(sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", + "Estimated Cardinality": "27199" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sales", + "number_sales" + ], + "Estimated Cardinality": "27199" } - } - ], - "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", - "Estimated Cardinality": "11534" - } - } - ], - "extra_info": { - "Projections": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "NESTED_LOOP_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "NESTED_LOOP_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" - } - }, - { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_quantity", - "cs_list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_quantity", + "ws_list_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "62608" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "ws_item_sk = #0", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS INTEGER)", + "CAST(#6 AS TINYINT)", + "CAST(#7 AS TINYINT)", + "#8" + ], + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "#0 = cs_item_sk", - "Estimated Cardinality": "5744" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "i_item_sk", "i_brand_id", "i_class_id", - "i_category_id" + "i_category_id", + "(CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "5744" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "sum(#3)", + "count_star()" + ], + "Estimated Cardinality": "13938" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 2450815)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", - "__internal_compress_integral_usmallint(#4, 2450815)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" + "#4" + ], + "Estimated Cardinality": "13938" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Aggregates": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "i_brand_id", - "i_class_id", - "i_category_id", - "(CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))" - ], - "Estimated Cardinality": "5744" + "Join Type": "INNER", + "Conditions": "CAST(sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", + "Estimated Cardinality": "13938" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" - ], - "Aggregates": [ - "sum(#3)", - "count_star()" - ], - "Estimated Cardinality": "5743" + "Projections": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sales", + "number_sales" + ], + "Estimated Cardinality": "13938" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "#4", + "#5" + ], + "Estimated Cardinality": "92874" + } + } + ], + "extra_info": { + "Projections": [ + "channel", + "i_brand_id", + "i_class_id", + "i_category_id", + "sales", + "number_sales" + ], + "Estimated Cardinality": "92874" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Aggregates": [ + "sum(#4) EXPORT_STATE", + "sum(#5) EXPORT_STATE" + ], + "Estimated Cardinality": "46437" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "#4", + "#5" + ], + "Estimated Cardinality": "46437" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "310", + "Estimated Cardinality": "46437" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", "#3", - "#4" + "#4", + "#5" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "46437" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#4", + "#5" + ], + "Estimated Cardinality": "46437" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "combine_aggr(#3)", + "combine_aggr(#4)" + ], + "Estimated Cardinality": "23218" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4" + ], + "Estimated Cardinality": "23218" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "1" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "CTE Index": "314", + "Estimated Cardinality": "23218" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": [ + "__internal_compress_string_ubigint(#0)", + "CAST(#1 AS INTEGER)", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "23218" } } ], "extra_info": { "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + "#0", + "#1", + "#3", + "#4" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "23218" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "CAST(sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", - "Estimated Cardinality": "5743" + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "11609" } } ], "extra_info": { "Projections": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "#2", + "#3" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "11609" } }, { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "NESTED_LOOP_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "71632" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_quantity", - "ws_list_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" - } - } - ], - "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "#0 = ws_item_sk", - "Estimated Cardinality": "2864" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "2864" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 2450816)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "__internal_compress_integral_usmallint(#4, 2450816)", - "__internal_compress_integral_usmallint(#5, 1)", - "__internal_compress_integral_uinteger(#6, 1001001)", - "__internal_compress_integral_utinyint(#7, 1)", - "__internal_compress_integral_utinyint(#8, 1)" - ], - "Estimated Cardinality": "2864" + "CTE Index": "318", + "Estimated Cardinality": "11609" } } ], "extra_info": { "Projections": [ - "i_brand_id", - "i_class_id", - "i_category_id", - "(CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))" + "__internal_compress_string_ubigint(#0)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "11609" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", - "#1", - "#2" - ], - "Aggregates": [ - "sum(#3)", - "count_star()" + "#2", + "#3" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "11609" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4" + "Groups": "#0", + "Aggregates": [ + "combine_aggr(#1)", + "combine_aggr(#2)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "5804" } - }, + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2" + ], + "Estimated Cardinality": "5804" + } + }, + { + "name": "UNION", + "children": [ { "name": "PROJECTION", "children": [ @@ -4672,99 +5329,189 @@ physical_plan [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "1" + "CTE Index": "322", + "Estimated Cardinality": "5804" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "#1", + "#2" + ], + "Estimated Cardinality": "5804" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "combine_aggr(#0)", + "combine_aggr(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#0)", + "finalize(#1)" ], "Estimated Cardinality": "1" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "322", + "Estimated Cardinality": "5804" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "5804" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "318", + "Estimated Cardinality": "11609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "NULL::BIGINT", + "NULL::BIGINT", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "11609" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "314", + "Estimated Cardinality": "23218" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "NULL::BIGINT", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "23218" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "310", + "Estimated Cardinality": "46437" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)", + "finalize(#5)" + ], + "Estimated Cardinality": "46437" + } } ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "CAST(sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))) AS DOUBLE) > SUBQUERY", - "Estimated Cardinality": "2864" - } + "extra_info": {} } ], "extra_info": { - "Projections": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "2864" + "CTE Name": "__grouping_sets_cte_322", + "Table Index": "322", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "87069" } } ], - "extra_info": {} + "extra_info": { + "CTE Name": "__grouping_sets_cte_318", + "Table Index": "318", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "87069" + } } ], "extra_info": { - "Projections": [ - "channel", - "i_brand_id", - "i_class_id", - "i_category_id", - "sales", - "number_sales" - ], - "Estimated Cardinality": "20141" + "CTE Name": "__grouping_sets_cte_314", + "Table Index": "314", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "87069" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": [ - "sum(#4)", - "sum(#5)" - ], - "Estimated Cardinality": "20140" + "CTE Name": "__grouping_sets_cte_310", + "Table Index": "310", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "87069" } } ], "extra_info": { "Top": "100", "Order By": [ - "y.channel ASC", - "y.i_brand_id ASC", - "y.i_class_id ASC", - "y.i_category_id ASC" - ] + "channel ASC", + "i_brand_id ASC", + "i_class_id ASC", + "i_category_id ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "avg_sales", "Table Index": "1", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } @@ -4772,6 +5519,7 @@ physical_plan [ "extra_info": { "CTE Name": "cross_items", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q15.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q15.slt.no index 9729f724c9e..a41e81f2b3b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q15.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q15.slt.no @@ -260,7 +260,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.customer_address.ca_zip" + "Order By": "ca_zip" } } ], @@ -277,182 +277,110 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "143657" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" } }, { - "name": "CHUNK_GET", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "0" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "(\"substring\"(ca_zip, 1, 5) = #0)", - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": "(IN (...) OR (cs_sales_price > 500.00) OR ((ca_state = 'CA') OR (ca_state = 'WA') OR (ca_state = 'GA')))", - "Estimated Cardinality": "28731" + "Join Type": "INNER", + "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_qoy = 2i64)", - "($.d_year = 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "CHUNK_GET", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Expressions": "", + "Estimated Cardinality": "9" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "5744" + "Join Type": "MARK", + "Conditions": "(\"substring\"(ca_zip, 1, 5) = #0)", + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450815)" + "Expressions": "(IN (...) OR (cs_sales_price > 500.00) OR ((ca_state = 'CA') OR (ca_state = 'WA') OR (ca_state = 'GA')))", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "5744" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "ca_zip", - "Expressions": "sum(cs_sales_price)", - "Estimated Cardinality": "5630" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "5630" + "Groups": "ca_zip", + "Expressions": "sum(cs_sales_price)", + "Estimated Cardinality": "4984" } } ], @@ -461,7 +389,7 @@ logical_opt [ "ca_zip", "sum(cs_sales_price)" ], - "Estimated Cardinality": "5630" + "Estimated Cardinality": "4984" } } ], @@ -482,20 +410,33 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_sales_price" + ], + "Estimated Cardinality": "143657" + } + }, { "name": "HASH_JOIN", "children": [ @@ -505,113 +446,88 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_sales_price" + "c_customer_sk", + "c_current_addr_sk" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "10000" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_state", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_state", + "ca_zip" + ], + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "143657" - } - }, - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "\"substring\"(ca_zip, 1, 5) = #0", + "Join Type": "INNER", + "Conditions": "cs_bill_customer_sk = c_customer_sk", "Estimated Cardinality": "143657" } + }, + { + "name": "COLUMN_DATA_SCAN", + "children": [], + "extra_info": { + "Estimated Cardinality": "9" + } } ], "extra_info": { - "Expression": "(IN (...) OR (cs_sales_price > 500.00) OR ((ca_state = 'CA') OR (ca_state = 'WA') OR (ca_state = 'GA')))", - "Estimated Cardinality": "28731" + "Join Type": "MARK", + "Conditions": "\"substring\"(ca_zip, 1, 5) = #0", + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#3" - ], + "Expression": "(IN (...) OR (cs_sales_price > 500.00) OR ((ca_state = 'CA') OR (ca_state = 'WA') OR (ca_state = 'GA')))", "Estimated Cardinality": "28731" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_qoy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "5744" + "Projections": [ + "#0", + "#1", + "#3" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450815)" - ], - "Estimated Cardinality": "5744" + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } } ], @@ -620,20 +536,21 @@ physical_plan [ "ca_zip", "cs_sales_price" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "5630" + "Estimated Cardinality": "4984" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.customer_address.ca_zip ASC" + "Order By": "ca_zip ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q16.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q16.slt.no index 08eab8fe6e8..ed0f668378b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q16.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q16.slt.no @@ -355,8 +355,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -449,8 +448,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -489,7 +487,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT cs1.cs_order_number)" + "Order By": "order count" } } ], @@ -506,251 +504,489 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - }, - { - "name": "DELIM_GET", - "children": [], + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_state = \"GA\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_ship_addr_sk = ca_address_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.cc_county = \"Williamson County\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_call_center_sk = cc_call_center_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2002-02-01 <= $.d_date <= 2002-04-02)", + "(2450817i64 <= $.d_date_sk <= 2452740i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_ship_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "66", + "Estimated Cardinality": "28731" + } + }, + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": { + "Expressions": "" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": [ + "(cs_warehouse_sk IS NOT DISTINCT FROM cs_warehouse_sk)", + "(cs_order_number IS NOT DISTINCT FROM cs_order_number)" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": "SUBQUERY", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "5746" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "28730" + "CTE Name": "__duckdb_delim_66", + "Table Index": "66", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(cs_order_number = cs_order_number)", - "(cs_warehouse_sk != cs_warehouse_sk)" + "Expressions": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "1504681" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Expressions": [ - "cs_warehouse_sk", - "cs_order_number" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "1504681" + "Estimated Cardinality": "5746" } - } - ], - "extra_info": { - "Expressions": [ - "cs_warehouse_sk", - "cs_order_number" - ], - "Estimated Cardinality": "1504681" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_ship_date_sk", - "cs_ship_addr_sk", - "cs_call_center_sk", - "cs_warehouse_sk", - "cs_order_number", - "cs_ext_ship_cost", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "5746" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Expressions": "(CAST(#[72.17] AS BIGINT) BETWEEN 2 AND 15999)", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Groups": "#[72.17]", + "Expressions": "", + "Estimated Cardinality": "2873" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2873" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "2873" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(cr_order_number = cs_order_number)", + "Estimated Cardinality": "2855" + } + } + ], + "extra_info": { + "Expressions": "cs_order_number", + "Estimated Cardinality": "2855" + } + } + ], "extra_info": { - "Filters": "($.ca_state = \"GA\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Join Type": "MARK", + "Conditions": "(cs_order_number IS NOT DISTINCT FROM cs_order_number)", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_ship_addr_sk = ca_address_sk)", - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2002-02-01 <= $.d_date <= 2002-04-02)", - "(2450817i64 <= $.d_date_sk <= 2452740i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Expressions": "(NOT SUBQUERY)", + "Estimated Cardinality": "1149" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_ship_date_sk = d_date_sk)", - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.cc_county = \"Williamson County\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1149" } } ], "extra_info": { - "Expressions": "cc_call_center_sk", - "Estimated Cardinality": "1" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1149" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_call_center_sk = cc_call_center_sk)", - "Estimated Cardinality": "28731" + "CTE Name": "__duckdb_delim_75", + "Table Index": "75", + "Estimated Cardinality": "1149" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "(cs_warehouse_sk IS NOT DISTINCT FROM cs_warehouse_sk)", - "(cs_order_number IS NOT DISTINCT FROM cs_order_number)" + "Expressions": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "5746" + "Estimated Cardinality": "1149" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1149" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CROSS_PRODUCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" + "CTE Index": "82", + "Estimated Cardinality": "1149" } - }, + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(cs_ext_ship_cost)", + "sum(cs_net_profit)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Groups": "cs_order_number", + "Expressions": "", + "Estimated Cardinality": "574" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "5632" + "Expressions": "42", + "Estimated Cardinality": "574" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cr_order_number = cs_order_number)", - "Estimated Cardinality": "5632" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "cs_order_number", - "Estimated Cardinality": "5632" + "Expressions": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "cs_order_number", - "Estimated Cardinality": "5632" + "Expressions": "", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "(cs_order_number IS NOT DISTINCT FROM cs_order_number)", - "Estimated Cardinality": "1149" + "Expressions": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "count(DISTINCT cs_order_number)", - "sum(cs_ext_ship_cost)", - "sum(cs_net_profit)" - ], + "CTE Name": "__aggregate_cte_82", + "Table Index": "82", "Estimated Cardinality": "1" } } @@ -776,16 +1012,16 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", @@ -818,9 +1054,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_state='GA'", + "Filters": "($.ca_state = \"GA\")", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], @@ -835,18 +1071,15 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(2002-02-01 <= $.d_date <= 2002-04-02)", - "(2450817i64 <= $.d_date_sk <= 2452740i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Filters": "($.cc_county = \"Williamson County\")", + "Projections": "cc_call_center_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_ship_date_sk = d_date_sk", + "Conditions": "cs_call_center_sk = cc_call_center_sk", "Estimated Cardinality": "28731" } }, @@ -855,117 +1088,105 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "cc_county='Williamson County'", - "Projections": "cc_call_center_sk", - "Estimated Cardinality": "1" + "Filters": [ + "(2002-02-01 <= $.d_date <= 2002-04-02)", + "(2450817i64 <= $.d_date_sk <= 2452740i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_call_center_sk = cc_call_center_sk", + "Conditions": "cs_ship_date_sk = d_date_sk", "Estimated Cardinality": "28731" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_warehouse_sk", - "cs_order_number" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "28730" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "cs_order_number = cs_order_number", - "cs_warehouse_sk != cs_warehouse_sk" - ], - "Estimated Cardinality": "1504681" + "CTE Index": "66", + "Estimated Cardinality": "28731" } + }, + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": {} } ], "extra_info": { - "Projections": [ - "cs_warehouse_sk", - "cs_order_number" + "Join Type": "MARK", + "Conditions": [ + "cs_warehouse_sk IS NOT DISTINCT FROM cs_warehouse_sk", + "cs_order_number IS NOT DISTINCT FROM cs_order_number" ], - "Estimated Cardinality": "1504681" + "Estimated Cardinality": "28731" } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "cs_warehouse_sk IS NOT DISTINCT FROM cs_warehouse_sk", - "cs_order_number IS NOT DISTINCT FROM cs_order_number" - ], + "Expression": "SUBQUERY", "Estimated Cardinality": "5746" } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "", - "Estimated Cardinality": "28730" - } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "cs_warehouse_sk IS NOT DISTINCT FROM cs_warehouse_sk", - "cs_order_number IS NOT DISTINCT FROM cs_order_number" + "Projections": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "5746", - "Delim Index": "1" + "Estimated Cardinality": "5746" } - }, + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_66", + "Table Index": "66", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "5746" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "1149" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "5746" + } + }, { "name": "HASH_JOIN", "children": [ @@ -979,73 +1200,224 @@ physical_plan [ } }, { - "name": "DELIM_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Expression": "(CAST(#[72.17] AS BIGINT) BETWEEN 2 AND 15999)", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Projections": "#[72.17]", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "2873" + } + } + ], "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "5632" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2873" } } ], "extra_info": { - "Join Type": "INNER", + "Join Type": "SEMI", "Conditions": "cr_order_number = cs_order_number", - "Estimated Cardinality": "5632" + "Estimated Cardinality": "2855" } } ], "extra_info": { - "Projections": "cs_order_number", - "Estimated Cardinality": "5632" + "Join Type": "MARK", + "Conditions": "cs_order_number IS NOT DISTINCT FROM cs_order_number", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "cs_order_number IS NOT DISTINCT FROM cs_order_number", + "Expression": "(NOT SUBQUERY)", "Estimated Cardinality": "1149" } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_75", + "Table Index": "75", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1149" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Projections": [ + "cs_ext_ship_cost", + "cs_net_profit" + ], + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "sum(#1)" + ], + "Estimated Cardinality": "1" + } }, { - "name": "HASH_GROUP_BY", - "children": [], + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Projections": "cs_order_number", + "Estimated Cardinality": "1149" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "574" + } + } + ], + "extra_info": { + "Projections": "42", + "Estimated Cardinality": "574" + } + } + ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "5632" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], - "extra_info": { - "Join Type": "ANTI", - "Conditions": "cs_order_number IS NOT DISTINCT FROM cs_order_number", - "Estimated Cardinality": "1149", - "Delim Index": "2" - } + "extra_info": {} } ], "extra_info": { "Projections": [ - "cs_order_number", - "cs_ext_ship_cost", - "cs_net_profit" + "#2", + "#0", + "#1" ], - "Estimated Cardinality": "1149" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "count(DISTINCT #0)", - "sum(#1)", - "sum(#2)" - ] + "CTE Name": "__aggregate_cte_82", + "Table Index": "82", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "count(DISTINCT cs1.cs_order_number) ASC" + "Order By": "order count ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q17.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q17.slt.no index 35e81f3f7f5..0a2de86fe46 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q17.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q17.slt.no @@ -534,9 +534,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "memory.main.store.s_state" + "i_item_id", + "i_item_desc", + "s_state" ] } } @@ -554,47 +554,52 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_quantity" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": [ - "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "($.d_quarter_name = \"2001Q1\")", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Function": "Vortex Scan", "Estimated Cardinality": "14609" @@ -602,20 +607,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ @@ -623,94 +619,38 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_quantity" - ], - "Estimated Cardinality": "288464" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_quarter_name = \"2001Q1\")", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_state" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -720,74 +660,50 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "28576" } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(sr_item_sk = i_item_sk)", + "Estimated Cardinality": "28576" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc" - ], - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(sr_item_sk = i_item_sk)", - "Estimated Cardinality": "28576" + "Conditions": [ + "(cs_item_sk = sr_item_sk)", + "(cs_bill_customer_sk = sr_customer_sk)" + ], + "Estimated Cardinality": "143657" } } ], @@ -795,41 +711,50 @@ logical_opt [ "Join Type": "INNER", "Conditions": [ "(ss_item_sk = i_item_sk)", - "(ss_customer_sk = sr_customer_sk)", + "(ss_customer_sk = cs_bill_customer_sk)", "(ss_ticket_number = sr_ticket_number)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1450163" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(cs_item_sk = ss_item_sk)", - "(cs_bill_customer_sk = ss_customer_sk)" + "Groups": [ + "i_item_id", + "i_item_desc", + "s_state" + ], + "Expressions": [ + "count(ss_quantity)", + "sum(ss_quantity)", + "stddev_samp(CAST(ss_quantity AS DOUBLE))", + "count(sr_return_quantity)", + "sum(sr_return_quantity)", + "stddev_samp(CAST(sr_return_quantity AS DOUBLE))", + "count(cs_quantity)", + "sum(cs_quantity)", + "stddev_samp(CAST(cs_quantity AS DOUBLE))" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "s_state" - ], "Expressions": [ - "count(ss_quantity)", - "avg(ss_quantity)", - "stddev_samp(CAST(ss_quantity AS DOUBLE))", - "count(sr_return_quantity)", - "avg(sr_return_quantity)", - "stddev_samp(CAST(sr_return_quantity AS DOUBLE))", - "count(cs_quantity)", - "avg(cs_quantity)", - "stddev_samp(CAST(cs_quantity AS DOUBLE))" + "#0", + "#1", + "#2", + "#3", + "\"/\"(CAST(#4 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#5", + "#6", + "\"/\"(CAST(#7 AS DOUBLE), CAST(#6 AS DOUBLE))", + "#8", + "#9", + "\"/\"(CAST(#10 AS DOUBLE), CAST(#9 AS DOUBLE))", + "#11" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], @@ -851,7 +776,7 @@ logical_opt [ "catalog_sales_quantitystdev", "catalog_sales_quantitycov" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], @@ -869,51 +794,14 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_quantity" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" - } - }, { "name": "HASH_JOIN", "children": [ @@ -944,16 +832,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_quarter_name='2001Q1'", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": [ + "s_store_sk", + "s_state" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" } }, { @@ -961,18 +851,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_state" + "Filters": [ + "($.d_quarter_name = \"2001Q1\")", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" } }, { @@ -987,13 +878,12 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_return_quantity" + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk", + "cs_quantity" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "143657" } }, { @@ -1003,7 +893,7 @@ physical_plan [ "Function": "Vortex Scan", "Filters": [ "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], "Projections": "d_date_sk", "Estimated Cardinality": "14609" @@ -1012,28 +902,79 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "28576" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_returned_date_sk", + "sr_item_sk", + "sr_customer_sk", + "sr_ticket_number", + "sr_return_quantity" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id", + "i_item_desc" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "sr_item_sk = i_item_sk", + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([\"2001Q1\", \"2001Q2\", \"2001Q3\"], $.d_quarter_name, opts=sql_null_semantics)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id", - "i_item_desc" - ], - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "sr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "28576" + "Conditions": [ + "cs_item_sk = sr_item_sk", + "cs_bill_customer_sk = sr_customer_sk" + ], + "Estimated Cardinality": "143657" } } ], @@ -1041,60 +982,69 @@ physical_plan [ "Join Type": "INNER", "Conditions": [ "ss_item_sk = i_item_sk", - "ss_customer_sk = sr_customer_sk", + "ss_customer_sk = cs_bill_customer_sk", "ss_ticket_number = sr_ticket_number" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1450163" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "cs_item_sk = ss_item_sk", - "cs_bill_customer_sk = ss_customer_sk" + "Projections": [ + "i_item_id", + "i_item_desc", + "s_state", + "ss_quantity", + "ss_quantity", + "CAST(ss_quantity AS DOUBLE)", + "sr_return_quantity", + "sr_return_quantity", + "CAST(sr_return_quantity AS DOUBLE)", + "cs_quantity", + "cs_quantity", + "CAST(cs_quantity AS DOUBLE)" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1450163" } } ], "extra_info": { - "Projections": [ - "i_item_id", - "i_item_desc", - "s_state", - "ss_quantity", - "ss_quantity", - "CAST(ss_quantity AS DOUBLE)", - "sr_return_quantity", - "sr_return_quantity", - "CAST(sr_return_quantity AS DOUBLE)", - "cs_quantity", - "cs_quantity", - "CAST(cs_quantity AS DOUBLE)" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "count(#3)", + "sum(#4)", + "stddev_samp(#5)", + "count(#6)", + "sum(#7)", + "stddev_samp(#8)", + "count(#9)", + "sum(#10)", + "stddev_samp(#11)" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", - "#2" + "#2", + "#3", + "\"/\"(CAST(#4 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#5", + "#6", + "\"/\"(CAST(#7 AS DOUBLE), CAST(#6 AS DOUBLE))", + "#8", + "#9", + "\"/\"(CAST(#10 AS DOUBLE), CAST(#9 AS DOUBLE))", + "#11" ], - "Aggregates": [ - "count(#3)", - "avg(#4)", - "stddev_samp(#5)", - "count(#6)", - "avg(#7)", - "stddev_samp(#8)", - "count(#9)", - "avg(#10)", - "stddev_samp(#11)" - ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], @@ -1116,17 +1066,18 @@ physical_plan [ "catalog_sales_quantitystdev", "catalog_sales_quantitycov" ], - "Estimated Cardinality": "289953" + "Estimated Cardinality": "1143319" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "memory.main.store.s_state ASC" - ] + "i_item_id ASC", + "i_item_desc ASC", + "s_state ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q18.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q18.slt.no index 6bc75d0e1d4..0d6d280dfdf 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q18.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q18.slt.no @@ -425,10 +425,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer_address.ca_country", - "memory.main.customer_address.ca_state", - "memory.main.customer_address.ca_county", - "memory.main.item.i_item_id" + "ca_country", + "ca_state", + "ca_county", + "i_item_id" ] } } @@ -446,31 +446,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], - "extra_info": { - "Expressions": "cd_demo_sk", - "Estimated Cardinality": "192080" - } - }, - { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", @@ -482,7 +464,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -492,54 +474,70 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_bill_cdemo_sk", - "cs_item_sk", - "cs_quantity", - "cs_list_price", - "cs_sales_price", - "cs_coupon_amt", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + } + ], + "extra_info": { + "Expressions": "cd_demo_sk", + "Estimated Cardinality": "192080" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([1i64, 6i64, 8i64, 9i64, 12i64, 2i64], $.c_birth_month, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "2000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"MS\", \"IN\", \"ND\", \"OK\", \"NM\", \"VA\", \"MS\"], $.ca_state, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "14365" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -550,28 +548,16 @@ logical_opt [ "($.cd_demo_sk >= 16i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "7683" + "Estimated Cardinality": "38416" } } ], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_dep_count" - ], - "Estimated Cardinality": "7683" + "Join Type": "INNER", + "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", + "Estimated Cardinality": "3841" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "5744" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -583,108 +569,501 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "3841" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "1800" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "5744" + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "3841" } - }, + } + ], + "extra_info": { + "Groups": [ + "i_item_id", + "ca_country", + "ca_state", + "ca_county" + ], + "Expressions": [ + "avg(CAST(cs_quantity AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(cs_list_price AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(cs_sales_price AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(cs_net_profit AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(c_birth_year AS DECIMAL(12,2))) EXPORT_STATE", + "avg(CAST(cd_dep_count AS DECIMAL(12,2))) EXPORT_STATE" + ], + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "1920" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "vortex.list.contains([1i64, 6i64, 8i64, 9i64, 12i64, 2i64], $.c_birth_month, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "2000" + "CTE Index": "57", + "Estimated Cardinality": "1920" } } ], "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk", - "c_birth_year" + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)", + "combine_aggr(#8)", + "combine_aggr(#9)", + "combine_aggr(#10)" ], - "Estimated Cardinality": "2000" + "Estimated Cardinality": "960" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "960" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "61", + "Estimated Cardinality": "960" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Expressions": [ + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)", + "combine_aggr(#8)", + "combine_aggr(#9)" + ], + "Estimated Cardinality": "480" + } + } + ], "extra_info": { - "Filters": "vortex.list.contains([\"MS\", \"IN\", \"ND\", \"OK\", \"NM\", \"VA\", \"MS\"], $.ca_state, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "480" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "480" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": [ + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)", + "combine_aggr(#8)" + ], + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "240" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "69", + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "69", + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)" + ], + "Estimated Cardinality": "240" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "480" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)" + ], + "Estimated Cardinality": "480" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "61", + "Estimated Cardinality": "960" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)", + "finalize(#9)" + ], + "Estimated Cardinality": "960" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "57", + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)", + "finalize(#9)", + "finalize(#10)" + ], + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "3601" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "3601" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_69", + "Table Index": "69", + "Estimated Cardinality": "3601" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_county", - "ca_state", - "ca_country" - ], - "Estimated Cardinality": "1000" + "CTE Name": "__grouping_sets_cte_65", + "Table Index": "65", + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2000" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "5744" + "CTE Name": "__grouping_sets_cte_61", + "Table Index": "61", + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "551707" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "ca_country", - "ca_state", - "ca_county" - ], - "Expressions": [ - "avg(CAST(cs_quantity AS DECIMAL(12,2)))", - "avg(CAST(cs_list_price AS DECIMAL(12,2)))", - "avg(CAST(cs_coupon_amt AS DECIMAL(12,2)))", - "avg(CAST(cs_sales_price AS DECIMAL(12,2)))", - "avg(CAST(cs_net_profit AS DECIMAL(12,2)))", - "avg(CAST(c_birth_year AS DECIMAL(12,2)))", - "avg(CAST(cd_dep_count AS DECIMAL(12,2)))" - ], - "Estimated Cardinality": "551707" + "CTE Name": "__grouping_sets_cte_57", + "Table Index": "57", + "Estimated Cardinality": "3601" } } ], @@ -702,7 +1081,7 @@ logical_opt [ "agg6", "agg7" ], - "Estimated Cardinality": "551707" + "Estimated Cardinality": "3601" } } ], @@ -717,24 +1096,14 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Projections": "cd_demo_sk", - "Estimated Cardinality": "192080" - } - }, { "name": "HASH_JOIN", "children": [ @@ -767,20 +1136,70 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Projections": "cd_demo_sk", + "Estimated Cardinality": "192080" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([1i64, 6i64, 8i64, 9i64, 12i64, 2i64], $.c_birth_month, opts=sql_null_semantics)", + "Projections": [ + "c_customer_sk", + "c_current_cdemo_sk", + "c_current_addr_sk", + "c_birth_year" + ], + "Estimated Cardinality": "2000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"MS\", \"IN\", \"ND\", \"OK\", \"NM\", \"VA\", \"MS\"], $.ca_state, opts=sql_null_semantics)", + "Projections": [ + "ca_address_sk", + "ca_county", + "ca_state", + "ca_country" + ], + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=1998", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_bill_customer_sk = c_customer_sk", + "Estimated Cardinality": "14365" } }, { @@ -789,21 +1208,22 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "cd_gender='F'", - "cd_education_status='Unknown'" + "($.cd_gender = \"F\")", + "($.cd_education_status = \"Unknown\")", + "($.cd_demo_sk >= 16i64)" ], "Projections": [ "cd_demo_sk", "cd_dep_count" ], - "Estimated Cardinality": "7683" + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_bill_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "5744" + "Estimated Cardinality": "3841" } }, { @@ -822,110 +1242,445 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "5744" + "Estimated Cardinality": "3841" } }, { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "3841" + } + } + ], + "extra_info": { + "Projections": [ + "i_item_id", + "ca_country", + "ca_state", + "ca_county", + "CAST(cs_quantity AS DECIMAL(12,2))", + "CAST(cs_list_price AS DECIMAL(12,2))", + "CAST(cs_coupon_amt AS DECIMAL(12,2))", + "CAST(cs_sales_price AS DECIMAL(12,2))", + "CAST(cs_net_profit AS DECIMAL(12,2))", + "CAST(c_birth_year AS DECIMAL(12,2))", + "CAST(cd_dep_count AS DECIMAL(12,2))" + ], + "Estimated Cardinality": "3841" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Aggregates": [ + "avg(#4) EXPORT_STATE", + "avg(#5) EXPORT_STATE", + "avg(#6) EXPORT_STATE", + "avg(#7) EXPORT_STATE", + "avg(#8) EXPORT_STATE", + "avg(#9) EXPORT_STATE", + "avg(#10) EXPORT_STATE" + ], + "Estimated Cardinality": "1920" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "57", + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10" + ], + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": [ + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)", + "combine_aggr(#8)", + "combine_aggr(#9)" + ], + "Estimated Cardinality": "960" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([1i64, 6i64, 8i64, 9i64, 12i64, 2i64], $.c_birth_month, opts=sql_null_semantics)", + "CTE Index": "61", + "Estimated Cardinality": "960" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "960" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)", + "combine_aggr(#8)" + ], + "Estimated Cardinality": "480" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "480" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "480" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)", + "combine_aggr(#7)" + ], + "Estimated Cardinality": "240" + } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "69", + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Aggregates": [ + "combine_aggr(#0)", + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)", + "combine_aggr(#5)", + "combine_aggr(#6)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { "Projections": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk", - "c_birth_year" + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)" ], - "Estimated Cardinality": "2000" + "Estimated Cardinality": "1" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "69", + "Estimated Cardinality": "240" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)" + ], + "Estimated Cardinality": "240" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "480" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"MS\", \"IN\", \"ND\", \"OK\", \"NM\", \"VA\", \"MS\"], $.ca_state, opts=sql_null_semantics)", "Projections": [ - "ca_address_sk", - "ca_county", - "ca_state", - "ca_country" + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)" ], - "Estimated Cardinality": "1000" + "Estimated Cardinality": "480" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "61", + "Estimated Cardinality": "960" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "finalize(#3)", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)", + "finalize(#9)" + ], + "Estimated Cardinality": "960" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "57", + "Estimated Cardinality": "1920" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)", + "finalize(#5)", + "finalize(#6)", + "finalize(#7)", + "finalize(#8)", + "finalize(#9)", + "finalize(#10)" + ], + "Estimated Cardinality": "1920" } } ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "2000" - } + "extra_info": {} } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "5744" + "CTE Name": "__grouping_sets_cte_69", + "Table Index": "69", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cd_demo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "551707" + "CTE Name": "__grouping_sets_cte_65", + "Table Index": "65", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Projections": [ - "i_item_id", - "ca_country", - "ca_state", - "ca_county", - "CAST(cs_quantity AS DECIMAL(12,2))", - "CAST(cs_list_price AS DECIMAL(12,2))", - "CAST(cs_coupon_amt AS DECIMAL(12,2))", - "CAST(cs_sales_price AS DECIMAL(12,2))", - "CAST(cs_net_profit AS DECIMAL(12,2))", - "CAST(c_birth_year AS DECIMAL(12,2))", - "CAST(cd_dep_count AS DECIMAL(12,2))" - ], - "Estimated Cardinality": "551707" + "CTE Name": "__grouping_sets_cte_61", + "Table Index": "61", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3601" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": [ - "avg(#4)", - "avg(#5)", - "avg(#6)", - "avg(#7)", - "avg(#8)", - "avg(#9)", - "avg(#10)" - ], - "Estimated Cardinality": "551707" + "CTE Name": "__grouping_sets_cte_57", + "Table Index": "57", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3601" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer_address.ca_country ASC", - "memory.main.customer_address.ca_state ASC", - "memory.main.customer_address.ca_county ASC", - "memory.main.item.i_item_id ASC" - ] + "ca_country ASC", + "ca_state ASC", + "ca_county ASC", + "i_item_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q19.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q19.slt.no index 8b0ef829d01..5d517b5947c 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q19.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q19.slt.no @@ -365,11 +365,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price)", - "memory.main.item.i_brand", - "memory.main.item.i_brand_id", - "memory.main.item.i_manufact_id", - "memory.main.item.i_manufact" + "ext_price", + "brand", + "brand_id", + "i_manufact_id", + "i_manufact" ] } } @@ -405,97 +405,35 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 1998i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_manager_id = 8i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_brand", - "i_manufact_id", - "i_manufact" - ], - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -505,19 +443,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "5000" } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -529,23 +455,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_zip" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(\"substring\"(ca_zip, 1, 5) != \"substring\"(s_zip, 1, 5))", + "Estimated Cardinality": "5000" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(\"substring\"(ca_zip, 1, 5) != \"substring\"(s_zip, 1, 5))", - "Estimated Cardinality": "5000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -557,42 +471,52 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], + "Join Type": "INNER", + "Conditions": "(ca_address_sk = c_current_addr_sk)", "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ca_address_sk = c_current_addr_sk)", - "Estimated Cardinality": "10000" + "Conditions": [ + "(ss_store_sk = s_store_sk)", + "(ss_customer_sk = c_customer_sk)" + ], + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1998i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(ss_store_sk = s_store_sk)", - "(ss_customer_sk = c_customer_sk)" - ], - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_uinteger(#1, 1001001)", + "CAST(#1 AS INTEGER)", "#2", - "__internal_compress_integral_usmallint(#3, 1)", + "CAST(#3 AS SMALLINT)", "#4", - "__internal_compress_integral_utinyint(#5, 1)", - "__internal_compress_integral_usmallint(#6, 1)" + "#5" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -604,19 +528,19 @@ logical_opt [ "i_manufact" ], "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4" ], - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], @@ -628,7 +552,7 @@ logical_opt [ "i_manufact", "ext_price" ], - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], @@ -686,59 +610,58 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=11" + "Filters": "($.i_manager_id = 8i64)", + "Projections": [ + "i_item_sk", + "i_brand_id", + "i_brand", + "i_manufact_id", + "i_manufact" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manager_id=8", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_brand", - "i_manufact_id", - "i_manufact" - ], - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "NESTED_LOOP_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "NESTED_LOOP_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_zip" + ], + "Estimated Cardinality": "5000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_zip" + ], + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_zip" - ], + "Join Type": "INNER", + "Conditions": "\"substring\"(ca_zip, 1, 5) != \"substring\"(s_zip, 1, 5)", "Estimated Cardinality": "5000" } }, @@ -748,60 +671,61 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_zip" + "c_customer_sk", + "c_current_addr_sk" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "\"substring\"(ca_zip, 1, 5) != \"substring\"(s_zip, 1, 5)", - "Estimated Cardinality": "5000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk" - ], + "Conditions": "ca_address_sk = c_current_addr_sk", "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ca_address_sk = c_current_addr_sk", - "Estimated Cardinality": "10000" + "Conditions": [ + "ss_store_sk = s_store_sk", + "ss_customer_sk = c_customer_sk" + ], + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1998i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "ss_store_sk = s_store_sk", - "ss_customer_sk = c_customer_sk" - ], - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_uinteger(#1, 1001001)", + "CAST(#1 AS INTEGER)", "#2", - "__internal_compress_integral_usmallint(#3, 1)", + "CAST(#3 AS SMALLINT)", "#4", - "__internal_compress_integral_utinyint(#5, 1)", - "__internal_compress_integral_usmallint(#6, 1)" + "#5" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -813,7 +737,7 @@ physical_plan [ "i_manufact", "ss_ext_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -825,19 +749,19 @@ physical_plan [ "#3" ], "Aggregates": "sum(#4)", - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4" ], - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], @@ -849,19 +773,20 @@ physical_plan [ "i_manufact", "ext_price" ], - "Estimated Cardinality": "11533" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Top": "100", "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price) DESC", - "memory.main.item.i_brand ASC", - "memory.main.item.i_brand_id ASC", - "memory.main.item.i_manufact_id ASC", - "memory.main.item.i_manufact ASC" - ] + "ext_price DESC", + "brand ASC", + "brand_id ASC", + "i_manufact_id ASC", + "i_manufact ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q2.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q2.slt.no index 86ec49cb64b..59f83eea208 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q2.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q2.slt.no @@ -549,7 +549,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "y.d_week_seq1" + "Order By": "d_week_seq1" } } ], @@ -585,84 +585,63 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "sold_date_sk", - "sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } - }, + } + ], + "extra_info": { + "Expressions": [ + "ws_sold_date_sk", + "ws_ext_sales_price" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "sold_date_sk", + "sales_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "sold_date_sk", - "sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "215289" + "Expressions": [ + "cs_sold_date_sk", + "cs_ext_sales_price" + ], + "Estimated Cardinality": "143657" } } ], @@ -671,37 +650,21 @@ logical_opt [ "sold_date_sk", "sales_price" ], - "Estimated Cardinality": "215289" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], + "Expressions": "", "Estimated Cardinality": "215289" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_week_seq", - "d_day_name" - ], + "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } } @@ -709,38 +672,38 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(sold_date_sk = d_date_sk)", - "Estimated Cardinality": "219547" + "Estimated Cardinality": "215289" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#1 AS SMALLINT)", "#2" ], - "Estimated Cardinality": "219547" + "Estimated Cardinality": "215289" } } ], "extra_info": { "Groups": "d_week_seq", "Expressions": [ - "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (sales_price) ELSE NULL END)" + "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END)" ], - "Estimated Cardinality": "69431" + "Estimated Cardinality": "10435" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2", "#3", @@ -749,7 +712,7 @@ logical_opt [ "#6", "#7" ], - "Estimated Cardinality": "69431" + "Estimated Cardinality": "10435" } } ], @@ -764,159 +727,159 @@ logical_opt [ "fri_sales", "sat_sales" ], - "Estimated Cardinality": "69431" + "Estimated Cardinality": "10435" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "ORDER_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "69431" - } - }, - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "10435" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "10435" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(d_week_seq1 = (d_week_seq2 - 53))", + "Estimated Cardinality": "10434" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.d_year = 2001i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "($.d_year = 2001i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(d_week_seq = d_week_seq)", + "Estimated Cardinality": "14606" } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = d_week_seq)", - "Estimated Cardinality": "13882" - } - } - ], - "extra_info": { - "Expressions": [ - "d_week_seq1", - "sun_sales1", - "mon_sales1", - "tue_sales1", - "wed_sales1", - "thu_sales1", - "fri_sales1", - "sat_sales1" - ], - "Estimated Cardinality": "13882" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "69431" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.d_year = 2002i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(d_week_seq = d_week_seq)", + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = d_week_seq)", - "Estimated Cardinality": "13882" + "Expressions": [ + "d_week_seq1", + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "round((CAST(sat_sales1 AS DOUBLE) / CAST(sat_sales2 AS DOUBLE)), 2)" + ], + "Estimated Cardinality": "20446" } } ], "extra_info": { "Expressions": [ - "d_week_seq2", - "sun_sales2", - "mon_sales2", - "tue_sales2", - "wed_sales2", - "thu_sales2", - "fri_sales2", - "sat_sales2" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "13882" + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq1 = (d_week_seq2 - 53))", - "Estimated Cardinality": "2690" + "Order By": "d_week_seq1", + "Estimated Cardinality": "20446" } } ], "extra_info": { "Expressions": [ - "d_week_seq1", - "r1", - "r2", - "r3", - "r4", - "r5", - "r6", - "round((CAST(sat_sales1 AS DOUBLE) / CAST(sat_sales2 AS DOUBLE)), 2)" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "2690" + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Order By": "y.d_week_seq1", - "Estimated Cardinality": "2690" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "20446" } } ], "extra_info": { "CTE Name": "wswscs", "Table Index": "1", - "Estimated Cardinality": "2690" + "Estimated Cardinality": "20446" } } ] @@ -987,32 +950,32 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "sold_date_sk = d_date_sk", - "Estimated Cardinality": "219547" + "Estimated Cardinality": "215289" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#1 AS SMALLINT)", "#2" ], - "Estimated Cardinality": "219547" + "Estimated Cardinality": "215289" } } ], "extra_info": { "Projections": [ "d_week_seq", - "CASE WHEN ((d_day_name = 'Sunday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Monday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Tuesday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Wednesday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Thursday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Friday')) THEN (sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Saturday')) THEN (sales_price) ELSE NULL END" + "CASE WHEN ((d_day_name = 'Sunday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Monday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Tuesday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Wednesday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Thursday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Friday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Saturday')) THEN (sales_price) ELSE NULL::DECIMAL(7,2) END" ], - "Estimated Cardinality": "219547" + "Estimated Cardinality": "215289" } } ], @@ -1027,13 +990,13 @@ physical_plan [ "sum(#6)", "sum(#7)" ], - "Estimated Cardinality": "69431" + "Estimated Cardinality": "10435" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2", "#3", @@ -1042,17 +1005,17 @@ physical_plan [ "#6", "#7" ], - "Estimated Cardinality": "69431" + "Estimated Cardinality": "10435" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", @@ -1061,11 +1024,49 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "10435" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "10435" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "d_week_seq1 = (d_week_seq2 - 53)", + "Estimated Cardinality": "10434" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.d_year = 2001i64)", + "Projections": "d_week_seq", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "69431" + "Join Type": "INNER", + "Conditions": "d_week_seq = d_week_seq", + "Estimated Cardinality": "14606" } }, { @@ -1073,111 +1074,75 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", + "Filters": "($.d_year = 2002i64)", "Projections": "d_week_seq", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "d_week_seq = d_week_seq", - "Estimated Cardinality": "13882" + "Estimated Cardinality": "20446" } } ], "extra_info": { "Projections": [ "d_week_seq1", - "sun_sales1", - "mon_sales1", - "tue_sales1", - "wed_sales1", - "thu_sales1", - "fri_sales1", - "sat_sales1" - ], - "Estimated Cardinality": "13882" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "69431" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_week_seq", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "d_week_seq = d_week_seq", - "Estimated Cardinality": "13882" - } - } - ], - "extra_info": { - "Projections": [ - "d_week_seq2", - "sun_sales2", - "mon_sales2", - "tue_sales2", - "wed_sales2", - "thu_sales2", - "fri_sales2", - "sat_sales2" + "r1", + "r2", + "r3", + "r4", + "r5", + "r6", + "round((CAST(sat_sales1 AS DOUBLE) / CAST(sat_sales2 AS DOUBLE)), 2)" ], - "Estimated Cardinality": "13882" + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "d_week_seq1 = (d_week_seq2 - 53)", - "Estimated Cardinality": "2690" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Projections": [ - "d_week_seq1", - "r1", - "r2", - "r3", - "r4", - "r5", - "r6", - "round((CAST(sat_sales1 AS DOUBLE) / CAST(sat_sales2 AS DOUBLE)), 2)" - ], - "Estimated Cardinality": "2690" + "Order By": "d_week_seq1 ASC", + "Estimated Cardinality": "20446" } } ], "extra_info": { - "Order By": "y.d_week_seq1 ASC" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "20446" } } ], "extra_info": { "CTE Name": "wswscs", "Table Index": "1", - "Estimated Cardinality": "2690" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "20446" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q20.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q20.slt.no index 6c6d77503e5..52eb23401a0 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q20.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q20.slt.no @@ -245,11 +245,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_category", - "memory.main.item.i_class", - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "((sum(memory.main.catalog_sales.cs_ext_sales_price) * 100.0000) / sum(sum(memory.main.catalog_sales.cs_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class))" + "i_category", + "i_class", + "i_item_id", + "i_item_desc", + "revenueratio" ] } } @@ -270,146 +270,75 @@ logical_opt [ "name": "WINDOW", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450815)" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "143657" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "i_category", - "i_class", - "i_current_price" - ], - "Expressions": "sum(cs_ext_sales_price)", - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Groups": [ + "i_item_id", + "i_item_desc", + "i_category", + "i_class", + "i_current_price" ], - "Estimated Cardinality": "143657" + "Expressions": "sum(cs_ext_sales_price)", + "Estimated Cardinality": "28730" } } ], "extra_info": { "Expressions": "sum(sum(cs_ext_sales_price)) OVER (PARTITION BY i_class)", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28730" } } ], @@ -423,7 +352,7 @@ logical_opt [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28730" } } ], @@ -453,48 +382,21 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Projections": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_ext_sales_price" + ], "Estimated Cardinality": "143657" } }, @@ -503,33 +405,43 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Projections": [ + "i_item_sk", + "i_item_id", + "i_item_desc", + "i_current_price", + "i_class", + "i_category" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450815)" - ], - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } } ], @@ -542,7 +454,7 @@ physical_plan [ "i_current_price", "cs_ext_sales_price" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28731" } } ], @@ -555,12 +467,13 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28730" } } ], "extra_info": { - "Projections": "sum(sum(cs_ext_sales_price)) OVER (PARTITION BY i_class)" + "Projections": "sum(sum(cs_ext_sales_price)) OVER (PARTITION BY i_class)", + "Estimated Cardinality": "28730" } } ], @@ -574,7 +487,7 @@ physical_plan [ "#5", "#6" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28730" } } ], @@ -588,19 +501,20 @@ physical_plan [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28730" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.item.i_category ASC", - "memory.main.item.i_class ASC", - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "((sum(memory.main.catalog_sales.cs_ext_sales_price) * 100.0000) / sum(sum(memory.main.catalog_sales.cs_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class)) ASC" - ] + "i_category ASC", + "i_class ASC", + "i_item_id ASC", + "i_item_desc ASC", + "revenueratio ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q21.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q21.slt.no index bbb640f17d4..ae78388fac1 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q21.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q21.slt.no @@ -272,8 +272,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "x.w_warehouse_name", - "x.i_item_id" + "w_warehouse_name", + "i_item_id" ] } } @@ -294,10 +294,10 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -306,77 +306,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "234900" - } - } - ], - "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk", - "inv_warehouse_sk", - "inv_quantity_on_hand" - ], - "Estimated Cardinality": "234900" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "234900" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], + "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", + "Function": "Vortex Scan", "Estimated Cardinality": "360" } } @@ -384,68 +327,61 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(inv_item_sk = i_item_sk)", - "Estimated Cardinality": "234900" + "Estimated Cardinality": "46980" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-02-10 <= $.d_date <= 2000-04-10)", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "234900" + "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "46980" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-02-10 <= $.d_date <= 2000-04-10)", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "w_warehouse_name", - "i_item_id" - ], - "Expressions": [ - "sum(CASE WHEN ((d_date < '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END)", - "sum(CASE WHEN ((d_date >= '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END)" - ], - "Estimated Cardinality": "234899" + "Join Type": "INNER", + "Conditions": "(inv_date_sk = d_date_sk)", + "Estimated Cardinality": "46980" } } ], "extra_info": { - "Expressions": [ + "Groups": [ "w_warehouse_name", - "i_item_id", - "inv_before", - "inv_after" + "i_item_id" ], - "Estimated Cardinality": "234899" + "Expressions": [ + "sum(CASE WHEN ((d_date < '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END)", + "sum(CASE WHEN ((d_date >= '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END)" + ], + "Estimated Cardinality": "342" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((inv_before > 0)) THEN ((CAST((inv_after * 1.000) AS DOUBLE) / CAST(inv_before AS DOUBLE))) ELSE NULL END BETWEEN 0.6666666666666666 AND 1.5)", - "Estimated Cardinality": "234899" + "Expressions": "(CASE WHEN ((inv_before > 0)) THEN ((CAST((inv_after * 1.000) AS DOUBLE) / CAST(inv_before AS DOUBLE))) ELSE NULL::DOUBLE END BETWEEN 0.6666666666666666 AND 1.5)", + "Estimated Cardinality": "68" } } ], @@ -456,13 +392,13 @@ logical_opt [ "inv_before", "inv_after" ], - "Estimated Cardinality": "234899" + "Estimated Cardinality": "68" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "68" } } ] @@ -507,18 +443,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", "Projections": [ - "w_warehouse_sk", - "w_warehouse_name" + "i_item_sk", + "i_item_id" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "inv_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "234900" + "Conditions": "inv_item_sk = i_item_sk", + "Estimated Cardinality": "46980" } }, { @@ -526,19 +463,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", "Projections": [ - "i_item_sk", - "i_item_id" + "w_warehouse_sk", + "w_warehouse_name" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "inv_item_sk = i_item_sk", - "Estimated Cardinality": "234900" + "Conditions": "inv_warehouse_sk = w_warehouse_sk", + "Estimated Cardinality": "46980" } }, { @@ -561,7 +497,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "inv_date_sk = d_date_sk", - "Estimated Cardinality": "234900" + "Estimated Cardinality": "46980" } } ], @@ -572,7 +508,7 @@ physical_plan [ "CASE WHEN ((d_date < '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END", "CASE WHEN ((d_date >= '2000-03-11'::DATE)) THEN (inv_quantity_on_hand) ELSE 0 END" ], - "Estimated Cardinality": "234900" + "Estimated Cardinality": "46980" } } ], @@ -585,22 +521,23 @@ physical_plan [ "sum(#2)", "sum(#3)" ], - "Estimated Cardinality": "234899" + "Estimated Cardinality": "342" } } ], "extra_info": { - "Expression": "(CASE WHEN ((inv_before > 0)) THEN ((CAST((inv_after * 1.000) AS DOUBLE) / CAST(inv_before AS DOUBLE))) ELSE NULL END BETWEEN 0.6666666666666666 AND 1.5)", - "Estimated Cardinality": "234899" + "Expression": "(CASE WHEN ((inv_before > 0)) THEN ((CAST((inv_after * 1.000) AS DOUBLE) / CAST(inv_before AS DOUBLE))) ELSE NULL::DOUBLE END BETWEEN 0.6666666666666666 AND 1.5)", + "Estimated Cardinality": "68" } } ], "extra_info": { "Top": "100", "Order By": [ - "x.w_warehouse_name ASC", - "x.i_item_id ASC" - ] + "w_warehouse_name ASC", + "i_item_id ASC" + ], + "Estimated Cardinality": "68" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q22.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q22.slt.no index b2d0647c8ad..fbb84191c49 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q22.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q22.slt.no @@ -194,11 +194,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "avg(memory.main.inventory.inv_quantity_on_hand)", - "memory.main.item.i_product_name", - "memory.main.item.i_brand", - "memory.main.item.i_class", - "memory.main.item.i_category" + "qoh", + "i_product_name", + "i_brand", + "i_class", + "i_category" ] } } @@ -216,39 +216,45 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "234900" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(inv_item_sk = i_item_sk)", "Estimated Cardinality": "234900" } - } - ], - "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk", - "inv_quantity_on_hand" - ], - "Estimated Cardinality": "234900" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -263,58 +269,364 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(inv_date_sk = d_date_sk)", + "Estimated Cardinality": "234900" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "234900" + "Groups": [ + "i_product_name", + "i_brand", + "i_class", + "i_category" + ], + "Expressions": "avg(inv_quantity_on_hand) EXPORT_STATE", + "Estimated Cardinality": "117450" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "117450" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "117450" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Expressions": "combine_aggr(#4)", + "Estimated Cardinality": "58725" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "58725" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "58725" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Expressions": "combine_aggr(#3)", + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "29362" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "combine_aggr(#2)", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "14681" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "41", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "41", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#1)" + ], + "Estimated Cardinality": "14681" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#2)" + ], + "Estimated Cardinality": "29362" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "58725" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "finalize(#3)" + ], + "Estimated Cardinality": "58725" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "117450" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)" + ], + "Estimated Cardinality": "117450" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_41", + "Table Index": "41", + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_37", + "Table Index": "37", + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "220219" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand", - "i_class", - "i_category", - "i_product_name" - ], - "Estimated Cardinality": "1800" + "CTE Name": "__grouping_sets_cte_33", + "Table Index": "33", + "Estimated Cardinality": "220219" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_item_sk = i_item_sk)", - "Estimated Cardinality": "234900" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "220219" } } ], "extra_info": { - "Groups": [ - "i_product_name", - "i_brand", - "i_class", - "i_category" - ], - "Expressions": "avg(inv_quantity_on_hand)", - "Estimated Cardinality": "234900" + "CTE Name": "__grouping_sets_cte_29", + "Table Index": "29", + "Estimated Cardinality": "220219" } } ], @@ -326,7 +638,7 @@ logical_opt [ "i_category", "qoh" ], - "Estimated Cardinality": "234900" + "Estimated Cardinality": "220219" } } ], @@ -341,27 +653,52 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "inv_date_sk", + "inv_item_sk", + "inv_quantity_on_hand" + ], + "Estimated Cardinality": "234900" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_brand", + "i_class", + "i_category", + "i_product_name" + ], + "Estimated Cardinality": "1800" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "inv_date_sk", - "inv_item_sk", - "inv_quantity_on_hand" - ], + "Join Type": "INNER", + "Conditions": "inv_item_sk = i_item_sk", "Estimated Cardinality": "234900" } }, @@ -384,63 +721,322 @@ physical_plan [ "Conditions": "inv_date_sk = d_date_sk", "Estimated Cardinality": "234900" } - }, + } + ], + "extra_info": { + "Projections": [ + "i_product_name", + "i_brand", + "i_class", + "i_category", + "inv_quantity_on_hand" + ], + "Estimated Cardinality": "234900" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Aggregates": "avg(#4) EXPORT_STATE", + "Estimated Cardinality": "117450" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "117450" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_brand", - "i_class", - "i_category", - "i_product_name" + "#0", + "#1", + "#2", + "#4" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "117450" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "inv_item_sk = i_item_sk", - "Estimated Cardinality": "234900" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "combine_aggr(#3)", + "Estimated Cardinality": "58725" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "58725" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3" + ], + "Estimated Cardinality": "58725" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "combine_aggr(#2)", + "Estimated Cardinality": "29362" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2" + ], + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "combine_aggr(#1)", + "Estimated Cardinality": "14681" + } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "41", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Projections": "#1", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Aggregates": "combine_aggr(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "41", + "Estimated Cardinality": "14681" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#1)" + ], + "Estimated Cardinality": "14681" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "29362" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#2)" + ], + "Estimated Cardinality": "29362" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "58725" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "finalize(#3)" + ], + "Estimated Cardinality": "58725" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "117450" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)" + ], + "Estimated Cardinality": "117450" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_41", + "Table Index": "41", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "220219" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_37", + "Table Index": "37", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "220219" } } ], "extra_info": { - "Projections": [ - "i_product_name", - "i_brand", - "i_class", - "i_category", - "inv_quantity_on_hand" - ], - "Estimated Cardinality": "234900" + "CTE Name": "__grouping_sets_cte_33", + "Table Index": "33", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "220219" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": "avg(#4)", - "Estimated Cardinality": "234900" + "CTE Name": "__grouping_sets_cte_29", + "Table Index": "29", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "220219" } } ], "extra_info": { "Top": "100", "Order By": [ - "avg(memory.main.inventory.inv_quantity_on_hand) ASC", - "memory.main.item.i_product_name ASC", - "memory.main.item.i_brand ASC", - "memory.main.item.i_class ASC", - "memory.main.item.i_category ASC" - ] + "qoh ASC", + "i_product_name ASC", + "i_brand ASC", + "i_class ASC", + "i_category ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q23.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q23.slt.no index 7f3b680efbe..36f62193a32 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q23.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q23.slt.no @@ -627,7 +627,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) AS DOUBLE) > ((CAST(50 AS DOUBLE) / CAST(100.0 AS DOUBLE)) * CAST(max(tpcds_cmax) AS DOUBLE)))" + "Expressions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) AS DOUBLE) > (0.5 * CAST(max(tpcds_cmax) AS DOUBLE)))" } } ], @@ -1099,9 +1099,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sq3.c_last_name", - "sq3.c_first_name", - "sq3.sales" + "c_last_name", + "c_first_name", + "sales" ] } } @@ -1158,23 +1158,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, @@ -1185,74 +1173,50 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Expressions": [ - "d_date_sk", - "d_date" + "i_item_sk", + "i_item_desc" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Conditions": "(ss_item_sk = i_item_sk)", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_desc" - ], - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "itemdesc", - "i_item_sk" + "Filters": [ + "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1800" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], @@ -1264,21 +1228,21 @@ logical_opt [ "Groups": [ "itemdesc", "i_item_sk", - "d_date" + "#2" ], "Expressions": "count_star()", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], @@ -1295,57 +1259,36 @@ logical_opt [ } ], "extra_info": { - "Expressions": "#0" + "Expressions": "#0", + "Estimated Cardinality": "57692" } }, { - "name": "CTE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "FILTER", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_customer_sk", - "ss_quantity", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "CROSS_PRODUCT", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1353,296 +1296,232 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "CROSS_PRODUCT", "children": [ { - "name": "AGGREGATE", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ss_customer_sk = c_customer_sk)", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_quantity", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "10000" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "288464" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" + "Groups": "c_customer_sk", + "Expressions": "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2))))", + "Estimated Cardinality": "9999" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Groups": "c_customer_sk", - "Expressions": "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2))))", - "Estimated Cardinality": "182344" + "Expressions": "csales", + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" - ], - "Estimated Cardinality": "182344" + "Groups": "", + "Expressions": "max(csales)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "csales", - "Estimated Cardinality": "182344" + "Expressions": "tpcds_cmax", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": "max(csales)", + "Expressions": "#0", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "tpcds_cmax", - "Estimated Cardinality": "1" + "Expressions": "", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": "#0", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_customer_sk = c_customer_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "10000" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "288464" + "Groups": "c_customer_sk", + "Expressions": [ + "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2))))", + "max(tpcds_cmax)" + ], + "Estimated Cardinality": "9999" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "#3" + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Groups": "c_customer_sk", - "Expressions": [ - "sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2))))", - "max(tpcds_cmax)" - ], - "Estimated Cardinality": "182344" + "Expressions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) AS DOUBLE) > (0.5 * CAST(max(tpcds_cmax) AS DOUBLE)))", + "Estimated Cardinality": "1999" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "182344" + "Expressions": "c_customer_sk", + "Estimated Cardinality": "1999" } } ], "extra_info": { - "Expressions": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) AS DOUBLE) > (0.5 * CAST(max(tpcds_cmax) AS DOUBLE)))", - "Estimated Cardinality": "36468" + "Expressions": "#0", + "Estimated Cardinality": "1999" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "ssales" - ], - "Estimated Cardinality": "36468" - } - }, - { - "name": "TOP_N", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "TOP_N", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "UNION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "2", - "Estimated Cardinality": "36468" - } - }, - { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - }, { "name": "COMPARISON_JOIN", "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" - } - }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1652,131 +1531,102 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "143657" } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "2", + "Estimated Cardinality": "1999" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(c_customer_sk = c_customer_sk)", + "Estimated Cardinality": "1999" + } } ], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_quantity", - "cs_list_price" - ], - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "28717" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "($.d_moy = 2i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_year = 2000i64)", + "($.d_moy = 2i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Estimated Cardinality": "28717" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(item_sk = cs_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(cs_item_sk = item_sk)", + "Estimated Cardinality": "920412" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = cs_bill_customer_sk)", - "Estimated Cardinality": "11535" + "Groups": [ + "c_last_name", + "c_first_name" + ], + "Expressions": "sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2))))", + "Estimated Cardinality": "915967" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = cs_bill_customer_sk)", - "Estimated Cardinality": "42066" + "Expressions": [ + "c_last_name", + "c_first_name", + "sales" + ], + "Estimated Cardinality": "915967" } - } - ], - "extra_info": { - "Groups": [ - "c_last_name", - "c_first_name" - ], - "Expressions": "sum((CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2))))", - "Estimated Cardinality": "42065" - } - } - ], - "extra_info": { - "Expressions": [ - "c_last_name", - "c_first_name", - "sales" - ], - "Estimated Cardinality": "42065" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "2", - "Estimated Cardinality": "36468" - } - }, - { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - }, { "name": "COMPARISON_JOIN", "children": [ @@ -1792,7 +1642,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1802,77 +1652,92 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "71632" } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "2", + "Estimated Cardinality": "1999" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(c_customer_sk = c_customer_sk)", + "Estimated Cardinality": "1999" + } } ], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk", - "ws_quantity", - "ws_list_price" - ], - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "14319" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "($.d_moy = 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_year = 2000i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "14319" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(item_sk = ws_item_sk)", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "458947" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ws_bill_customer_sk)", - "Estimated Cardinality": "11535" + "Groups": [ + "c_last_name", + "c_first_name" + ], + "Expressions": "sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2))))", + "Estimated Cardinality": "457840" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ws_bill_customer_sk)", - "Estimated Cardinality": "42066" + "Expressions": [ + "c_last_name", + "c_first_name", + "sales" + ], + "Estimated Cardinality": "457840" } } ], "extra_info": { - "Groups": [ - "c_last_name", - "c_first_name" - ], - "Expressions": "sum((CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2))))", - "Estimated Cardinality": "42065" + "Expressions": "", + "Estimated Cardinality": "1373807" } } ], @@ -1882,35 +1747,39 @@ logical_opt [ "c_first_name", "sales" ], - "Estimated Cardinality": "42065" + "Estimated Cardinality": "1373807" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "84130" + "Estimated Cardinality": "100" } } ], "extra_info": { "Expressions": [ - "c_last_name", - "c_first_name", - "sales" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "84130" + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "CTE Name": "best_ss_customer", + "Table Index": "2", "Estimated Cardinality": "100" } } ], "extra_info": { - "CTE Name": "best_ss_customer", - "Table Index": "2", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "100" } } @@ -1967,59 +1836,47 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_date" + "i_item_sk", + "i_item_desc" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Conditions": "ss_item_sk = i_item_sk", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_desc" - ], - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([2000i64, 2001i64, 2002i64, 2003i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "itemdesc", - "i_item_sk" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], @@ -2031,7 +1888,7 @@ physical_plan [ "Projections": [ "itemdesc", "i_item_sk", - "d_date" + "#2" ], "Estimated Cardinality": "288464" } @@ -2044,18 +1901,18 @@ physical_plan [ "#2" ], "Aggregates": "count_star()", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], @@ -2199,10 +2056,10 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" + "#3" ], "Estimated Cardinality": "288464" } @@ -2220,33 +2077,34 @@ physical_plan [ "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": "csales", - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": "csales", - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Aggregates": "max(#0)" + "Aggregates": "max(#0)", + "Estimated Cardinality": "1" } } ], @@ -2262,7 +2120,7 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3" @@ -2287,32 +2145,29 @@ physical_plan [ "sum(#1)", "max(#2)" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Expression": "(CAST(sum((CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) AS DOUBLE) > (0.5 * CAST(max(tpcds_cmax) AS DOUBLE)))", - "Estimated Cardinality": "36468" + "Estimated Cardinality": "1999" } } ], "extra_info": { - "Projections": [ - "#0", - "#1" - ], - "Estimated Cardinality": "36468" + "Projections": "#0", + "Estimated Cardinality": "1999" } }, { @@ -2330,39 +2185,25 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "2", - "Estimated Cardinality": "36468" - } - }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk", + "cs_quantity", + "cs_list_price" + ], + "Estimated Cardinality": "143657" } }, { @@ -2374,54 +2215,69 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_quantity", - "cs_list_price" + "c_customer_sk", + "c_first_name", + "c_last_name" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "10000" } }, { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2000", - "d_moy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "CTE Index": "2", + "Estimated Cardinality": "1999" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "c_customer_sk = c_customer_sk", + "Estimated Cardinality": "1999" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "item_sk = cs_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "cs_bill_customer_sk = c_customer_sk", + "Estimated Cardinality": "28717" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "($.d_moy = 2i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = cs_bill_customer_sk", - "Estimated Cardinality": "11535" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28717" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = cs_bill_customer_sk", - "Estimated Cardinality": "42066" + "Conditions": "cs_item_sk = item_sk", + "Estimated Cardinality": "920412" } } ], @@ -2431,7 +2287,7 @@ physical_plan [ "c_first_name", "(CAST(cs_quantity AS DECIMAL(26,0)) * CAST(cs_list_price AS DECIMAL(26,2)))" ], - "Estimated Cardinality": "42066" + "Estimated Cardinality": "920412" } } ], @@ -2441,7 +2297,7 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "42065" + "Estimated Cardinality": "915967" } }, { @@ -2457,35 +2313,29 @@ physical_plan [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "2", - "Estimated Cardinality": "36468" + "CTE Index": "0", + "Estimated Cardinality": "57692" } }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_bill_customer_sk", + "ws_quantity", + "ws_list_price" + ], + "Estimated Cardinality": "71632" } }, { @@ -2497,54 +2347,61 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk", - "ws_quantity", - "ws_list_price" + "c_customer_sk", + "c_first_name", + "c_last_name" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "10000" } }, { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2000", - "d_moy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "CTE Index": "2", + "Estimated Cardinality": "1999" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "c_customer_sk = c_customer_sk", + "Estimated Cardinality": "1999" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "item_sk = ws_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Estimated Cardinality": "14319" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = ws_bill_customer_sk", - "Estimated Cardinality": "11535" + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14319" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = ws_bill_customer_sk", - "Estimated Cardinality": "42066" + "Conditions": "item_sk = ws_item_sk", + "Estimated Cardinality": "458947" } } ], @@ -2554,7 +2411,7 @@ physical_plan [ "c_first_name", "(CAST(ws_quantity AS DECIMAL(26,0)) * CAST(ws_list_price AS DECIMAL(26,2)))" ], - "Estimated Cardinality": "42066" + "Estimated Cardinality": "458947" } } ], @@ -2564,7 +2421,7 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "42065" + "Estimated Cardinality": "457840" } } ], @@ -2574,16 +2431,18 @@ physical_plan [ "extra_info": { "Top": "100", "Order By": [ - "sq3.c_last_name ASC", - "sq3.c_first_name ASC", - "sq3.sales ASC" - ] + "c_last_name ASC", + "c_first_name ASC", + "sales ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "best_ss_customer", "Table Index": "2", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } @@ -2591,6 +2450,7 @@ physical_plan [ "extra_info": { "CTE Name": "frequent_ss_items", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q24.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q24.slt.no index 4ff76c8f7d4..38fbd1977f5 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q24.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q24.slt.no @@ -432,44 +432,21 @@ logical_plan [ "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": "avg(netpaid)" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": "(CAST(0.05 AS DOUBLE) * avg(netpaid))" + "CTE Index": "0" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#[57.0])", - "count_star()" - ] + "Expressions": "avg(netpaid)" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#[63.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[63.0] END" - ] + "Expressions": "(CAST(0.05 AS DOUBLE) * avg(netpaid))" } } ], @@ -495,9 +472,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "ssales.c_last_name", - "ssales.c_first_name", - "ssales.s_store_name" + "c_last_name", + "c_first_name", + "s_store_name" ] } } @@ -522,13 +499,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -537,212 +514,271 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_net_paid" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.s_market_id = 8i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ca_zip = s_zip)", + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(c_current_addr_sk = ca_address_sk)", + "(c_birth_country != upper(ca_country))" + ], + "Estimated Cardinality": "170997" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "CAST(#4 AS TINYINT)", + "#5", + "#6", + "#3" + ], + "Estimated Cardinality": "170997" } } ], "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number" + "Groups": [ + "#0", + "#3", + "#2", + "#1", + "#4", + "#6", + "#5" ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_current_price", - "i_size", - "i_color", - "i_units", - "i_manager_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_item_sk = i_item_sk)", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ss_item_sk = i_item_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Expressions": "count_star()", + "Estimated Cardinality": "9999" } } ], "extra_info": { "Expressions": [ - "c_customer_sk", - "c_current_addr_sk", - "c_first_name", - "c_last_name", - "c_birth_country" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "9999" } }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(sr_item_sk = i_item_sk)", + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(ss_item_sk = i_item_sk)", + "(ss_ticket_number = sr_ticket_number)" + ], + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", + "#2", + "#3", + "#4", + "#5", + "#6", + "CAST(#7 AS TINYINT)" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state", - "ca_zip", - "ca_country" + "Groups": [ + "#0", + "#1", + "#5", + "#3", + "#7", + "#6", + "#4" ], - "Estimated Cardinality": "5000" - } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": { - "Expressions": "" + "Expressions": "sum(ss_net_paid) EXPORT_STATE", + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_zip = s_zip)", - "Estimated Cardinality": "5000" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "CAST(#4 AS BIGINT)", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "9999" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "(c_current_addr_sk = ca_address_sk)", - "(c_birth_country != upper(ca_country))" + "(#0 = #0)", + "(#1 = #1)" ], - "Estimated Cardinality": "170997" + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ss_customer_sk = c_customer_sk)", - "(ss_store_sk = s_store_sk)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "CAST(#8 AS TINYINT)", + "#9", + "#10", + "#11" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Expressions": [ + "Groups": [ "#0", "#1", "#2", "#3", "#4", - "__internal_compress_integral_utinyint(#5, 1)", - "#9", - "#10", - "#8", "#6", - "#7" + "#7", + "#8", + "#9", + "#10" ], + "Expressions": "combine_aggr(#11, #5)", "Estimated Cardinality": "4932665" } } ], "extra_info": { - "Groups": [ - "c_last_name", - "c_first_name", - "s_store_name", - "ca_state", - "s_state", - "i_color", - "i_current_price", - "i_manager_id", - "i_units", - "i_size" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "CAST(#7 AS BIGINT)", + "#8", + "#9", + "#10" ], - "Expressions": "sum(ss_net_paid)", "Estimated Cardinality": "4932665" } } @@ -752,14 +788,8 @@ logical_opt [ "#0", "#1", "#2", - "#3", - "#4", "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1)", - "#8", - "#9", - "#10" + "finalize(#10)" ], "Estimated Cardinality": "4932665" } @@ -784,54 +814,55 @@ logical_opt [ "#2", "#3", "#4" - ] + ], + "Estimated Cardinality": "4932665" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "AGGREGATE", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "4932665" + } + } + ], "extra_info": { - "CTE Index": "0", + "Expressions": "(i_color = 'peach')", "Estimated Cardinality": "4932665" } } ], "extra_info": { - "Expressions": "(i_color = 'peach')", - "Estimated Cardinality": "4932665" + "Groups": [ + "c_last_name", + "c_first_name", + "s_store_name" + ], + "Expressions": "sum(netpaid)", + "Estimated Cardinality": "4800288" } - } - ], - "extra_info": { - "Groups": [ - "c_last_name", - "c_first_name", - "s_store_name" - ], - "Expressions": "sum(netpaid)", - "Estimated Cardinality": "4932665" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", @@ -850,68 +881,69 @@ logical_opt [ ], "extra_info": { "Groups": "", - "Expressions": "avg(netpaid)", + "Expressions": [ + "sum(netpaid)", + "count(netpaid)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "(0.05 * avg(netpaid))", + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "(0.05 * avg(netpaid))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(CAST(sum(netpaid) AS DOUBLE) > SUBQUERY)", + "Estimated Cardinality": "4800288" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(CAST(sum(netpaid) AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "4932665" + "Expressions": [ + "c_last_name", + "c_first_name", + "s_store_name", + "paid" + ], + "Estimated Cardinality": "4800288" } } ], "extra_info": { - "Expressions": [ + "Order By": [ "c_last_name", "c_first_name", - "s_store_name", - "paid" + "s_store_name" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } } ], "extra_info": { - "Order By": [ - "ssales.c_last_name", - "ssales.c_first_name", - "ssales.s_store_name" + "Expressions": [ + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } } ], "extra_info": { "CTE Name": "ssales", "Table Index": "0", - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } } ] @@ -938,136 +970,288 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_net_paid" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_item_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_current_addr_sk", + "c_first_name", + "c_last_name", + "c_birth_country" + ], + "Estimated Cardinality": "10000" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_state", + "ca_zip", + "ca_country" + ], + "Estimated Cardinality": "5000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_market_id = 8i64)", + "Projections": [ + "s_store_sk", + "s_store_name", + "s_state", + "s_zip" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ca_zip = s_zip", + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "c_current_addr_sk = ca_address_sk", + "c_birth_country != upper(ca_country)" + ], + "Estimated Cardinality": "170997" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "CAST(#4 AS TINYINT)", + "#5", + "#6", + "#3" + ], + "Estimated Cardinality": "170997" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_current_price", - "i_size", - "i_color", - "i_units", - "i_manager_id" + "#0", + "#3", + "#2", + "#1", + "#4", + "#6", + "#5" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "170997" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "28576" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Aggregates": "count_star()", + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ss_item_sk = i_item_sk", - "ss_ticket_number = sr_ticket_number" + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "9999" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk", - "c_first_name", - "c_last_name", - "c_birth_country" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_item_sk", + "ss_customer_sk", + "ss_store_sk", + "ss_ticket_number", + "ss_net_paid" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_ticket_number" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_current_price", + "i_size", + "i_color", + "i_units", + "i_manager_id" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "sr_item_sk = i_item_sk", + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "ss_item_sk = i_item_sk", + "ss_ticket_number = sr_ticket_number" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", + "#2", + "#3", + "#4", + "#5", + "#6", + "CAST(#7 AS TINYINT)" + ], + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ca_address_sk", - "ca_state", - "ca_zip", - "ca_country" + "#0", + "#1", + "#5", + "#3", + "#7", + "#6", + "#4", + "ss_net_paid" ], - "Estimated Cardinality": "5000" + "Estimated Cardinality": "288464" } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_zip = s_zip", - "Estimated Cardinality": "5000" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Aggregates": "sum(#7) EXPORT_STATE", + "Estimated Cardinality": "9999" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "c_current_addr_sk = ca_address_sk", - "c_birth_country != upper(ca_country)" + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "CAST(#4 AS BIGINT)", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "170997" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "ss_customer_sk = c_customer_sk", - "ss_store_sk = s_store_sk" + "#0 = #0", + "#1 = #1" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "9999" } } ], @@ -1078,32 +1262,34 @@ physical_plan [ "#2", "#3", "#4", - "__internal_compress_integral_utinyint(#5, 1)", + "#5", + "#6", + "#7", + "CAST(#8 AS TINYINT)", "#9", "#10", - "#8", - "#6", - "#7" + "#11" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": [ - "c_last_name", - "c_first_name", - "s_store_name", - "ca_state", - "s_state", - "i_color", - "i_current_price", - "i_manager_id", - "i_units", - "i_size", - "ss_net_paid" + "#0", + "#1", + "#2", + "#3", + "#4", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#5" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "9999" } } ], @@ -1120,7 +1306,7 @@ physical_plan [ "#8", "#9" ], - "Aggregates": "sum(#10)", + "Aggregates": "combine_aggr(#10, #11)", "Estimated Cardinality": "4932665" } } @@ -1134,7 +1320,7 @@ physical_plan [ "#4", "#5", "#6", - "__internal_decompress_integral_bigint(#7, 1)", + "CAST(#7 AS BIGINT)", "#8", "#9", "#10" @@ -1145,11 +1331,11 @@ physical_plan [ ], "extra_info": { "Projections": [ - "c_last_name", - "c_first_name", - "s_store_name", - "i_color", - "netpaid" + "#0", + "#1", + "#2", + "#5", + "finalize(#10)" ], "Estimated Cardinality": "4932665" } @@ -1205,72 +1391,56 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } }, { "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "4932665" - } - } - ], - "extra_info": { - "Projections": "netpaid", - "Estimated Cardinality": "4932665" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "CTE Index": "0", + "Estimated Cardinality": "4932665" } } ], "extra_info": { - "Projections": "(0.05 * avg(netpaid))", - "Estimated Cardinality": "1" + "Projections": [ + "netpaid", + "netpaid" + ], + "Estimated Cardinality": "4932665" } } ], "extra_info": { - "Projections": "#0", + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "(0.05 * avg(netpaid))", "Estimated Cardinality": "1" } } @@ -1278,7 +1448,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "CAST(sum(netpaid) AS DOUBLE) > SUBQUERY", - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } } ], @@ -1289,23 +1459,25 @@ physical_plan [ "s_store_name", "paid" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "4800288" } } ], "extra_info": { "Order By": [ - "ssales.c_last_name ASC", - "ssales.c_first_name ASC", - "ssales.s_store_name ASC" - ] + "c_last_name ASC", + "c_first_name ASC", + "s_store_name ASC" + ], + "Estimated Cardinality": "4800288" } } ], "extra_info": { "CTE Name": "ssales", "Table Index": "0", - "Estimated Cardinality": "4932665" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "4800288" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q25.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q25.slt.no index ed52639e8cb..29d43475ef5 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q25.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q25.slt.no @@ -519,10 +519,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "memory.main.store.s_store_id", - "memory.main.store.s_store_name" + "i_item_id", + "i_item_desc", + "s_store_id", + "s_store_name" ] } } @@ -552,195 +552,106 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_net_profit" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 4i64)", - "($.d_year = 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_moy = 4i64)", + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(4i64 <= $.d_moy <= 10i64)", - "($.d_year = 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(4i64 <= $.d_moy <= 10i64)", + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(4i64 <= $.d_moy <= 10i64)", - "($.d_year = 2001i64)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "5713" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -748,57 +659,48 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(sr_item_sk = i_item_sk)", - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(4i64 <= $.d_moy <= 10i64)", + "($.d_year = 2001i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(cs_item_sk = sr_item_sk)", - "(cs_bill_customer_sk = sr_customer_sk)" - ], - "Estimated Cardinality": "5743" + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "(ss_item_sk = i_item_sk)", - "(ss_customer_sk = cs_bill_customer_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "11591" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id", - "s_store_name" + "(cs_item_sk = sr_item_sk)", + "(cs_bill_customer_sk = sr_customer_sk)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "143657" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11591" + "Conditions": [ + "(ss_item_sk = i_item_sk)", + "(ss_customer_sk = cs_bill_customer_sk)", + "(ss_ticket_number = sr_ticket_number)" + ], + "Estimated Cardinality": "1450163" } } ], @@ -814,7 +716,7 @@ logical_opt [ "sum(sr_net_loss)", "sum(cs_net_profit)" ], - "Estimated Cardinality": "11591" + "Estimated Cardinality": "1129739" } } ], @@ -828,7 +730,7 @@ logical_opt [ "store_returns_loss", "catalog_sales_profit" ], - "Estimated Cardinality": "11591" + "Estimated Cardinality": "1129739" } } ], @@ -873,24 +775,86 @@ physical_plan [ "Estimated Cardinality": "288464" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_id", + "s_store_name" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 4i64)", + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk", + "cs_net_profit" + ], + "Estimated Cardinality": "143657" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", "Filters": [ - "d_year=2001", - "d_moy=4" + "(4i64 <= $.d_moy <= 10i64)", + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" } }, { @@ -905,67 +869,13 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_net_profit" + "sr_returned_date_sk", + "sr_item_sk", + "sr_customer_sk", + "sr_ticket_number", + "sr_net_loss" ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" } }, { @@ -985,48 +895,49 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "5713" + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(4i64 <= $.d_moy <= 10i64)", + "($.d_year = 2001i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "cs_item_sk = sr_item_sk", - "cs_bill_customer_sk = sr_customer_sk" - ], - "Estimated Cardinality": "5743" + "Conditions": "sr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "ss_item_sk = i_item_sk", - "ss_customer_sk = cs_bill_customer_sk", - "ss_ticket_number = sr_ticket_number" - ], - "Estimated Cardinality": "11591" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_id", - "s_store_name" + "cs_item_sk = sr_item_sk", + "cs_bill_customer_sk = sr_customer_sk" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "143657" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11591" + "Conditions": [ + "ss_item_sk = i_item_sk", + "ss_customer_sk = cs_bill_customer_sk", + "ss_ticket_number = sr_ticket_number" + ], + "Estimated Cardinality": "1450163" } } ], @@ -1040,7 +951,7 @@ physical_plan [ "sr_net_loss", "cs_net_profit" ], - "Estimated Cardinality": "11591" + "Estimated Cardinality": "1450163" } } ], @@ -1056,18 +967,19 @@ physical_plan [ "sum(#5)", "sum(#6)" ], - "Estimated Cardinality": "11591" + "Estimated Cardinality": "1129739" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "memory.main.store.s_store_id ASC", - "memory.main.store.s_store_name ASC" - ] + "i_item_id ASC", + "i_item_desc ASC", + "s_store_id ASC", + "s_store_name ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q26.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q26.slt.no index b9fd9c56b92..65f193344c8 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q26.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q26.slt.no @@ -311,7 +311,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.item.i_item_id" + "Order By": "i_item_id" } } ], @@ -328,13 +328,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -343,127 +343,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_cdemo_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_quantity", - "cs_list_price", - "cs_sales_price", - "cs_coupon_amt" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.cd_gender = \"M\")", - "($.cd_marital_status = \"S\")", - "($.cd_education_status = \"College\")", - "($.cd_demo_sk >= 16i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "7683" - } - } - ], - "extra_info": { - "Expressions": "cd_demo_sk", - "Estimated Cardinality": "7683" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "5744" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "5744" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -475,52 +362,77 @@ logical_opt [ } ], "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "(cs_promo_sk = p_promo_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.cd_gender = \"M\")", + "($.cd_marital_status = \"S\")", + "($.cd_education_status = \"College\")", + "($.cd_demo_sk >= 16i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_promo_sk = p_promo_sk)", - "Estimated Cardinality": "5744" + "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", + "Estimated Cardinality": "7683" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 1)" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "7683" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "5744" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": [ - "avg(cs_quantity)", - "avg(cs_list_price)", - "avg(cs_coupon_amt)", - "avg(cs_sales_price)" - ], - "Estimated Cardinality": "5630" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "7683" } } ], "extra_info": { + "Groups": "i_item_id", "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4" + "avg(cs_quantity)", + "avg(cs_list_price)", + "avg(cs_coupon_amt)", + "avg(cs_sales_price)" ], - "Estimated Cardinality": "5630" + "Estimated Cardinality": "1774" } } ], @@ -532,7 +444,7 @@ logical_opt [ "agg3", "agg4" ], - "Estimated Cardinality": "5630" + "Estimated Cardinality": "1774" } } ], @@ -553,7 +465,7 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -565,41 +477,21 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_cdemo_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_quantity", - "cs_list_price", - "cs_sales_price", - "cs_coupon_amt" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_cdemo_sk", + "cs_item_sk", + "cs_promo_sk", + "cs_quantity", + "cs_list_price", + "cs_sales_price", + "cs_coupon_amt" + ], + "Estimated Cardinality": "143657" } }, { @@ -607,20 +499,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "cd_gender='M'", - "cd_marital_status='S'", - "cd_education_status='College'" - ], - "Projections": "cd_demo_sk", - "Estimated Cardinality": "7683" + "Filters": "(($.p_channel_email = \"N\") or ($.p_channel_event = \"N\"))", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_bill_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "5744" + "Conditions": "cs_promo_sk = p_promo_sk", + "Estimated Cardinality": "28731" } }, { @@ -628,18 +516,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" + "Filters": [ + "($.cd_gender = \"M\")", + "($.cd_marital_status = \"S\")", + "($.cd_education_status = \"College\")", + "($.cd_demo_sk >= 16i64)" ], - "Estimated Cardinality": "1800" + "Projections": "cd_demo_sk", + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "5744" + "Conditions": "cs_bill_cdemo_sk = cd_demo_sk", + "Estimated Cardinality": "7683" } }, { @@ -647,29 +538,38 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(($.p_channel_email = \"N\") or ($.p_channel_event = \"N\"))", - "Projections": "p_promo_sk", - "Estimated Cardinality": "6" + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_promo_sk = p_promo_sk", - "Estimated Cardinality": "5744" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "7683" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 1)" - ], - "Estimated Cardinality": "5744" + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "7683" } } ], @@ -681,7 +581,7 @@ physical_plan [ "cs_coupon_amt", "cs_sales_price" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "7683" } } ], @@ -693,13 +593,14 @@ physical_plan [ "avg(#3)", "avg(#4)" ], - "Estimated Cardinality": "5630" + "Estimated Cardinality": "1774" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.item.i_item_id ASC" + "Order By": "i_item_id ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q27.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q27.slt.no index 7cc7f1a6b33..bafae717f70 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q27.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q27.slt.no @@ -477,8 +477,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "foo.i_item_id", - "foo.s_state" + "i_item_id", + "s_state" ] } } @@ -517,63 +517,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_cdemo_sk", - "ss_store_sk", - "ss_quantity", - "ss_list_price", - "ss_sales_price", - "ss_coupon_amt" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -585,25 +536,16 @@ logical_opt [ "(2i64 <= $.cd_demo_sk <= 192076i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "7683" + "Estimated Cardinality": "38416" } } ], "extra_info": { - "Expressions": "cd_demo_sk", - "Estimated Cardinality": "7683" + "Join Type": "INNER", + "Conditions": "(ss_cdemo_sk = cd_demo_sk)", + "Estimated Cardinality": "57694" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -615,23 +557,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_state" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57694" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -643,18 +573,28 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57694" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2002i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1800" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57694" } } ], @@ -667,7 +607,7 @@ logical_opt [ "agg3", "agg4" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } } ], @@ -679,164 +619,200 @@ logical_opt [ "#3", "#4", "#5" - ] + ], + "Estimated Cardinality": "57694" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57694" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "11535" + "Groups": [ + "i_item_id", + "s_state" + ], + "Expressions": [ + "avg(agg1)", + "avg(agg2)", + "avg(agg3)", + "avg(agg4)" + ], + "Estimated Cardinality": "1709" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "s_state" - ], "Expressions": [ - "avg(agg1)", - "avg(agg2)", - "avg(agg3)", - "avg(agg4)" + "i_item_id", + "s_state", + "g_state", + "agg1", + "agg2", + "agg3", + "agg4" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "1709" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_id", - "s_state", - "g_state", - "agg1", - "agg2", - "agg3", - "agg4" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57694" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "11535" + "Groups": "i_item_id", + "Expressions": [ + "avg(agg1)", + "avg(agg2)", + "avg(agg3)", + "avg(agg4)" + ], + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Groups": "i_item_id", "Expressions": [ - "avg(agg1)", - "avg(agg2)", - "avg(agg3)", - "avg(agg4)" + "i_item_id", + "s_state", + "g_state", + "agg1", + "agg2", + "agg3", + "agg4" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1799" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_id", - "s_state", - "g_state", - "agg1", - "agg2", - "agg3", - "agg4" - ], - "Estimated Cardinality": "11307" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57694" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(agg1)", + "sum(agg2)", + "sum(agg3)", + "sum(agg4)", + "count(agg1)", + "count(agg2)", + "count(agg3)", + "count(agg4)" + ], + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "11535" + "Expressions": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#4 AS DOUBLE))", + "\"/\"(CAST(#1 AS DOUBLE), CAST(#5 AS DOUBLE))", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#6 AS DOUBLE))", + "\"/\"(CAST(#3 AS DOUBLE), CAST(#7 AS DOUBLE))" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "avg(agg1)", - "avg(agg2)", - "avg(agg3)", - "avg(agg4)" + "i_item_id", + "s_state", + "g_state", + "agg1", + "agg2", + "agg3", + "agg4" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "i_item_id", - "s_state", - "g_state", - "agg1", - "agg2", - "agg3", - "agg4" - ], - "Estimated Cardinality": "1" + "Expressions": "", + "Estimated Cardinality": "3509" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "22842" + "Expressions": [ + "i_item_id", + "s_state", + "g_state", + "agg1", + "agg2", + "agg3", + "agg4" + ], + "Estimated Cardinality": "3509" } } ], "extra_info": { - "Expressions": [ - "i_item_id", - "s_state", - "g_state", - "agg1", - "agg2", - "agg3", - "agg4" - ], - "Estimated Cardinality": "22842" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], "Estimated Cardinality": "100" } } @@ -890,16 +866,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.cd_gender = \"M\")", + "($.cd_marital_status = \"S\")", + "($.cd_education_status = \"College\")", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], + "Projections": "cd_demo_sk", + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_cdemo_sk = cd_demo_sk", + "Estimated Cardinality": "57694" } }, { @@ -907,20 +888,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "cd_gender='M'", - "cd_marital_status='S'", - "cd_education_status='College'" + "Filters": "($.s_state = \"TN\")", + "Projections": [ + "s_store_sk", + "s_state" ], - "Projections": "cd_demo_sk", - "Estimated Cardinality": "7683" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "57694" } }, { @@ -928,19 +908,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "s_state='TN'", "Projections": [ - "s_store_sk", - "s_state" + "i_item_sk", + "i_item_id" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57694" } }, { @@ -948,18 +927,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" + "Filters": [ + "($.d_year = 2002i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1800" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57694" } } ], @@ -972,7 +952,7 @@ physical_plan [ "agg3", "agg4" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } }, { @@ -995,7 +975,7 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } } ], @@ -1008,7 +988,7 @@ physical_plan [ "agg3", "agg4" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } } ], @@ -1023,7 +1003,7 @@ physical_plan [ "avg(#4)", "avg(#5)" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "1709" } } ], @@ -1037,7 +1017,7 @@ physical_plan [ "agg3", "agg4" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "1709" } }, { @@ -1054,7 +1034,7 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } } ], @@ -1066,7 +1046,7 @@ physical_plan [ "agg3", "agg4" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57694" } } ], @@ -1078,7 +1058,7 @@ physical_plan [ "avg(#3)", "avg(#4)" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1799" } } ], @@ -1092,45 +1072,68 @@ physical_plan [ "agg3", "agg4" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1799" } }, { "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "57694" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "11535" + "Projections": [ + "agg1", + "agg2", + "agg3", + "agg4", + "agg1", + "agg2", + "agg3", + "agg4" + ], + "Estimated Cardinality": "57694" } } ], "extra_info": { - "Projections": [ - "agg1", - "agg2", - "agg3", - "agg4" + "Aggregates": [ + "sum(#0)", + "sum(#1)", + "sum(#2)", + "sum(#3)", + "count(#4)", + "count(#5)", + "count(#6)", + "count(#7)" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "avg(#1)", - "avg(#2)", - "avg(#3)" - ] + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#4 AS DOUBLE))", + "\"/\"(CAST(#1 AS DOUBLE), CAST(#5 AS DOUBLE))", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#6 AS DOUBLE))", + "\"/\"(CAST(#3 AS DOUBLE), CAST(#7 AS DOUBLE))" + ], + "Estimated Cardinality": "1" } } ], @@ -1154,15 +1157,17 @@ physical_plan [ "extra_info": { "Top": "100", "Order By": [ - "foo.i_item_id ASC", - "foo.s_state ASC" - ] + "i_item_id ASC", + "s_state ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "results", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q28.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q28.slt.no index 514888167a2..4466da68b17 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q28.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q28.slt.no @@ -599,7 +599,7 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "LIMIT", + "name": "CROSS_PRODUCT", "children": [ { "name": "CROSS_PRODUCT", @@ -614,107 +614,171 @@ logical_opt [ "name": "CROSS_PRODUCT", "children": [ { - "name": "CROSS_PRODUCT", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(12200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(13200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(83600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(183600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(1700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(3700, precision=7, scale=2))))", + "(21i64 <= $.ss_quantity <= 25i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(12200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(13200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(83600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(183600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(1700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(3700, precision=7, scale=2))))", - "(21i64 <= $.ss_quantity <= 25i64)" - ], - "Function": "Vortex Scan", + "Expressions": "#0", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "ss_list_price", + "Expressions": "#0", "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Groups": "", - "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "B5_LP", - "B5_CNT", - "B5_CNTD" - ], - "Estimated Cardinality": "1" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "142", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "142", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(15400, precision=7, scale=2)) and ($.ss_list_price <= decimal128(16400, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(732600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(832600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(2700, precision=7, scale=2))))", - "(26i64 <= $.ss_quantity <= 30i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" + "Expressions": "", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ss_list_price", - "Estimated Cardinality": "57692" + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" - ], + "CTE Name": "__aggregate_cte_142", + "Table Index": "142", "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "B6_LP", - "B6_CNT", - "B6_CNTD" + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "B5_LP", + "B5_CNT", + "B5_CNTD" + ], "Estimated Cardinality": "1" } }, @@ -722,36 +786,157 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(15400, precision=7, scale=2)) and ($.ss_list_price <= decimal128(16400, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(732600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(832600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(2700, precision=7, scale=2))))", + "(26i64 <= $.ss_quantity <= 30i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(13500, precision=7, scale=2)) and ($.ss_list_price <= decimal128(14500, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(607100, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(707100, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3800, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5800, precision=7, scale=2))))", - "(16i64 <= $.ss_quantity <= 20i64)" - ], - "Function": "Vortex Scan", + "Expressions": "#0", "Estimated Cardinality": "57692" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "155", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "155", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } } ], "extra_info": { - "Expressions": "ss_list_price", - "Estimated Cardinality": "57692" + "CTE Name": "__aggregate_cte_155", + "Table Index": "155", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" ], "Estimated Cardinality": "1" } @@ -759,9 +944,9 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "B4_LP", - "B4_CNT", - "B4_CNTD" + "B6_LP", + "B6_CNT", + "B6_CNTD" ], "Estimated Cardinality": "1" } @@ -776,36 +961,157 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(13500, precision=7, scale=2)) and ($.ss_list_price <= decimal128(14500, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(607100, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(707100, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3800, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5800, precision=7, scale=2))))", + "(16i64 <= $.ss_quantity <= 20i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(14200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(15200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(1221400, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(1321400, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(7900, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(9900, precision=7, scale=2))))", - "(11i64 <= $.ss_quantity <= 15i64)" - ], - "Function": "Vortex Scan", + "Expressions": "#0", "Estimated Cardinality": "57692" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "129", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "129", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } } ], "extra_info": { - "Expressions": "ss_list_price", - "Estimated Cardinality": "57692" + "CTE Name": "__aggregate_cte_129", + "Table Index": "129", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" ], "Estimated Cardinality": "1" } @@ -813,9 +1119,9 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "B3_LP", - "B3_CNT", - "B3_CNTD" + "B4_LP", + "B4_CNT", + "B4_CNTD" ], "Estimated Cardinality": "1" } @@ -830,46 +1136,167 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(14200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(15200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(1221400, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(1321400, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(7900, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(9900, precision=7, scale=2))))", + "(11i64 <= $.ss_quantity <= 15i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(9000, precision=7, scale=2)) and ($.ss_list_price <= decimal128(10000, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(232300, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(332300, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3100, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5100, precision=7, scale=2))))", - "(6i64 <= $.ss_quantity <= 10i64)" - ], - "Function": "Vortex Scan", + "Expressions": "#0", "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": "ss_list_price", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" - ], - "Estimated Cardinality": "1" - } - } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "116", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "116", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_116", + "Table Index": "116", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } ], "extra_info": { "Expressions": [ - "B2_LP", - "B2_CNT", - "B2_CNTD" + "B3_LP", + "B3_CNT", + "B3_CNTD" ], "Estimated Cardinality": "1" } @@ -884,36 +1311,157 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(9000, precision=7, scale=2)) and ($.ss_list_price <= decimal128(10000, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(232300, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(332300, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3100, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5100, precision=7, scale=2))))", + "(6i64 <= $.ss_quantity <= 10i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Filters": [ - "(((($.ss_list_price >= decimal128(800, precision=7, scale=2)) and ($.ss_list_price <= decimal128(1800, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(45900, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(145900, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(5700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(7700, precision=7, scale=2))))", - "(0i64 <= $.ss_quantity <= 5i64)" - ], - "Function": "Vortex Scan", + "Expressions": "#0", "Estimated Cardinality": "57692" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "103", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "103", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } } ], "extra_info": { - "Expressions": "ss_list_price", - "Estimated Cardinality": "57692" + "CTE Name": "__aggregate_cte_103", + "Table Index": "103", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "avg(ss_list_price)", - "count(ss_list_price)", - "count(DISTINCT ss_list_price)" + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" ], "Estimated Cardinality": "1" } @@ -921,9 +1469,9 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "B1_LP", - "B1_CNT", - "B1_CNTD" + "B2_LP", + "B2_CNT", + "B2_CNTD" ], "Estimated Cardinality": "1" } @@ -933,96 +1481,892 @@ logical_opt [ "Expressions": "", "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": "" - } - } - ], - "extra_info": { - "Expressions": [ - "B1_LP", - "B1_CNT", - "B1_CNTD", - "B2_LP", - "B2_CNT", - "B2_CNTD", - "B3_LP", - "B3_CNT", - "B3_CNTD", - "B4_LP", - "B4_CNT", - "B4_CNTD", - "B5_LP", - "B5_CNT", - "B5_CNTD", - "B6_LP", - "B6_CNT", - "B6_CNTD" - ], - "Estimated Cardinality": "0" - } - } -] -physical_plan [ - { - "name": "PROJECTION", - "children": [ - { - "name": "STREAMING_LIMIT", - "children": [ + }, { - "name": "CROSS_PRODUCT", + "name": "PROJECTION", "children": [ { - "name": "CROSS_PRODUCT", + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((($.ss_list_price >= decimal128(800, precision=7, scale=2)) and ($.ss_list_price <= decimal128(1800, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(45900, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(145900, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(5700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(7700, precision=7, scale=2))))", + "(0i64 <= $.ss_quantity <= 5i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "90", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_list_price)", + "count(ss_list_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "90", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "ss_list_price", + "Expressions": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_90", + "Table Index": "90", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "B1_LP", + "B1_CNT", + "B1_CNTD" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "B1_LP", + "B1_CNT", + "B1_CNTD", + "B2_LP", + "B2_CNT", + "B2_CNTD", + "B3_LP", + "B3_CNT", + "B3_CNTD", + "B4_LP", + "B4_CNT", + "B4_CNTD", + "B5_LP", + "B5_CNT", + "B5_CNTD", + "B6_LP", + "B6_CNT", + "B6_CNTD" + ], + "Estimated Cardinality": "0" + } + } +] +physical_plan [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(12200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(13200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(83600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(183600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(1700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(3700, precision=7, scale=2))))", + "(21i64 <= $.ss_quantity <= 25i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "142", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_list_price", + "ss_list_price" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "142", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_142", + "Table Index": "142", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(15400, precision=7, scale=2)) and ($.ss_list_price <= decimal128(16400, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(732600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(832600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(2700, precision=7, scale=2))))", + "(26i64 <= $.ss_quantity <= 30i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "155", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_list_price", + "ss_list_price" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "155", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_155", + "Table Index": "155", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(13500, precision=7, scale=2)) and ($.ss_list_price <= decimal128(14500, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(607100, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(707100, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3800, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5800, precision=7, scale=2))))", + "(16i64 <= $.ss_quantity <= 20i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "129", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_list_price", + "ss_list_price" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "129", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_129", + "Table Index": "129", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(14200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(15200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(1221400, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(1321400, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(7900, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(9900, precision=7, scale=2))))", + "(11i64 <= $.ss_quantity <= 15i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "116", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_list_price", + "ss_list_price" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "116", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_116", + "Table Index": "116", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + }, + { + "name": "PROJECTION", "children": [ { - "name": "CROSS_PRODUCT", + "name": "CTE", "children": [ { - "name": "CROSS_PRODUCT", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(9000, precision=7, scale=2)) and ($.ss_list_price <= decimal128(10000, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(232300, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(332300, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3100, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5100, precision=7, scale=2))))", + "(6i64 <= $.ss_quantity <= 10i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", "children": [ { "name": "CROSS_PRODUCT", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "103", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(12200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(13200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(83600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(183600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(1700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(3700, precision=7, scale=2))))", - "(21i64 <= $.ss_quantity <= 25i64)" + "Projections": [ + "ss_list_price", + "ss_list_price" ], - "Projections": "ss_list_price", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" + "Aggregates": [ + "sum(#0)", + "count(#1)" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" } }, { @@ -1032,203 +2376,225 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "103", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(15400, precision=7, scale=2)) and ($.ss_list_price <= decimal128(16400, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(732600, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(832600, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(2700, precision=7, scale=2))))", - "(26i64 <= $.ss_quantity <= 30i64)" - ], - "Projections": "ss_list_price", - "Estimated Cardinality": "57692" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" } } ], "extra_info": { - "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" - ], - "Estimated Cardinality": "57692" + "Projections": "#0", + "Estimated Cardinality": "28846" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" } } ], "extra_info": {} - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "CTE Name": "__aggregate_cte_103", + "Table Index": "103", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_list_price >= decimal128(800, precision=7, scale=2)) and ($.ss_list_price <= decimal128(1800, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(45900, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(145900, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(5700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(7700, precision=7, scale=2))))", + "(0i64 <= $.ss_quantity <= 5i64)" + ], + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "90", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(13500, precision=7, scale=2)) and ($.ss_list_price <= decimal128(14500, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(607100, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(707100, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3800, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5800, precision=7, scale=2))))", - "(16i64 <= $.ss_quantity <= 20i64)" + "Projections": [ + "ss_list_price", + "ss_list_price" ], - "Projections": "ss_list_price", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" + "Aggregates": [ + "sum(#0)", + "count(#1)" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] + "Projections": [ + "#0", + "#1", + "#1" + ], + "Estimated Cardinality": "1" } - } - ], - "extra_info": {} - }, - { - "name": "UNGROUPED_AGGREGATE", - "children": [ + }, { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "90", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "ss_list_price", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "28846" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(14200, precision=7, scale=2)) and ($.ss_list_price <= decimal128(15200, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(1221400, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(1321400, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(7900, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(9900, precision=7, scale=2))))", - "(11i64 <= $.ss_quantity <= 15i64)" - ], - "Projections": "ss_list_price", - "Estimated Cardinality": "57692" + "Projections": "#0", + "Estimated Cardinality": "28846" } } ], "extra_info": { - "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" - ], - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] - } - } - ], - "extra_info": {} - }, - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(9000, precision=7, scale=2)) and ($.ss_list_price <= decimal128(10000, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(232300, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(332300, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(3100, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(5100, precision=7, scale=2))))", - "(6i64 <= $.ss_quantity <= 10i64)" - ], - "Projections": "ss_list_price", - "Estimated Cardinality": "57692" + "Aggregates": "count(#0)", + "Estimated Cardinality": "1" } } ], - "extra_info": { - "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" - ], - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] - } - } - ], - "extra_info": {} - }, - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(((($.ss_list_price >= decimal128(800, precision=7, scale=2)) and ($.ss_list_price <= decimal128(1800, precision=7, scale=2))) or (($.ss_coupon_amt >= decimal128(45900, precision=7, scale=2)) and ($.ss_coupon_amt <= decimal128(145900, precision=7, scale=2)))) or (($.ss_wholesale_cost >= decimal128(5700, precision=7, scale=2)) and ($.ss_wholesale_cost <= decimal128(7700, precision=7, scale=2))))", - "(0i64 <= $.ss_quantity <= 5i64)" - ], - "Projections": "ss_list_price", - "Estimated Cardinality": "57692" - } + "extra_info": {} } ], "extra_info": { "Projections": [ - "ss_list_price", - "ss_list_price", - "ss_list_price" + "#0", + "#1", + "#3", + "#2" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "avg(#0)", - "count(#1)", - "count(DISTINCT #2)" - ] + "CTE Name": "__aggregate_cte_90", + "Table Index": "90", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" } } ], - "extra_info": {} + "extra_info": { + "Projections": [ + "\"/\"(CAST(#0 AS DOUBLE), CAST(#3 AS DOUBLE))", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } } ], "extra_info": {} diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q29.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q29.slt.no index 8680500dffd..e83cce8ee10 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q29.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q29.slt.no @@ -518,10 +518,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "memory.main.store.s_store_id", - "memory.main.store.s_store_name" + "i_item_id", + "i_item_desc", + "s_store_id", + "s_store_name" ] } } @@ -539,14 +539,96 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_moy = 9i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -554,300 +636,85 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_quantity" - ], - "Estimated Cardinality": "143657" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_quantity" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(9i64 <= $.d_moy <= 12i64)", - "($.d_year = 1999i64)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "5713" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_item_sk = i_item_sk)", - "Estimated Cardinality": "5713" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ss_item_sk = i_item_sk)", - "(ss_customer_sk = sr_customer_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 9i64)", - "($.d_year = 1999i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "11532" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id", - "s_store_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11532" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(cs_item_sk = ss_item_sk)", - "(cs_bill_customer_sk = ss_customer_sk)" - ], - "Estimated Cardinality": "57974" + "Conditions": "(sr_item_sk = i_item_sk)", + "Estimated Cardinality": "28576" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(9i64 <= $.d_moy <= 12i64)", + "($.d_year = 1999i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57974" + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "28576" } } ], "extra_info": { - "Expressions": [ - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#0", - "__internal_compress_integral_usmallint(#7, 2450815)" + "Join Type": "INNER", + "Conditions": [ + "(cs_item_sk = sr_item_sk)", + "(cs_bill_customer_sk = sr_customer_sk)" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "s_store_id", - "s_store_name" - ], - "Expressions": [ - "sum(ss_quantity)", - "sum(sr_return_quantity)", - "sum(cs_quantity)" + "Join Type": "INNER", + "Conditions": [ + "(ss_item_sk = i_item_sk)", + "(ss_customer_sk = cs_bill_customer_sk)", + "(ss_ticket_number = sr_ticket_number)" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1450163" } } ], "extra_info": { + "Groups": [ + "i_item_id", + "i_item_desc", + "s_store_id", + "s_store_name" + ], "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" + "sum(ss_quantity)", + "sum(sr_return_quantity)", + "sum(cs_quantity)" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1129739" } } ], @@ -861,7 +728,7 @@ logical_opt [ "store_returns_quantity", "catalog_sales_quantity" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1129739" } } ], @@ -882,8 +749,71 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_customer_sk", + "ss_store_sk", + "ss_ticket_number", + "ss_quantity" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_id", + "s_store_name" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 9i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + }, { "name": "HASH_JOIN", "children": [ @@ -904,118 +834,45 @@ physical_plan [ "Estimated Cardinality": "143657" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" + } + }, + { + "name": "HASH_JOIN", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_quantity" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=1999", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "5713" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id", - "i_item_desc" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "5713" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ss_item_sk = i_item_sk", - "ss_customer_sk = sr_customer_sk", - "ss_ticket_number = sr_ticket_number" - ], - "Estimated Cardinality": "57677" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1999", - "d_moy=9" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "11532" + "Function": "Vortex Scan", + "Projections": [ + "sr_returned_date_sk", + "sr_item_sk", + "sr_customer_sk", + "sr_ticket_number", + "sr_return_quantity" + ], + "Estimated Cardinality": "28576" } }, { @@ -1024,63 +881,60 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_store_id", - "s_store_name" + "i_item_sk", + "i_item_id", + "i_item_desc" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11532" + "Conditions": "sr_item_sk = i_item_sk", + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(9i64 <= $.d_moy <= 12i64)", + "($.d_year = 1999i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "cs_item_sk = ss_item_sk", - "cs_bill_customer_sk = ss_customer_sk" - ], - "Estimated Cardinality": "57974" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Conditions": "sr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57974" + "Conditions": [ + "cs_item_sk = sr_item_sk", + "cs_bill_customer_sk = sr_customer_sk" + ], + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Projections": [ - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#0", - "__internal_compress_integral_usmallint(#7, 2450815)" + "Join Type": "INNER", + "Conditions": [ + "ss_item_sk = i_item_sk", + "ss_customer_sk = cs_bill_customer_sk", + "ss_ticket_number = sr_ticket_number" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1450163" } } ], @@ -1094,7 +948,7 @@ physical_plan [ "sr_return_quantity", "cs_quantity" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1450163" } } ], @@ -1110,18 +964,19 @@ physical_plan [ "sum(#5)", "sum(#6)" ], - "Estimated Cardinality": "57974" + "Estimated Cardinality": "1129739" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "memory.main.store.s_store_id ASC", - "memory.main.store.s_store_name ASC" - ] + "i_item_id ASC", + "i_item_desc ASC", + "s_store_id ASC", + "s_store_name ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q3.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q3.slt.no index 9801d3a21ac..ecf243cf25c 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q3.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q3.slt.no @@ -211,9 +211,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "dt.d_year", - "sum(memory.main.store_sales.ss_ext_sales_price)", - "memory.main.item.i_brand_id" + "d_year", + "sum_agg", + "brand_id" ] } } @@ -246,56 +246,28 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "2921" + "Filters": "($.i_manufact_id = 128i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { @@ -305,37 +277,40 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.i_manufact_id = 128i64)", + "Filters": [ + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#1, 1900)", "#0", - "__internal_compress_integral_uinteger(#2, 1001001)", + "CAST(#1 AS INTEGER)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -346,7 +321,7 @@ logical_opt [ "i_brand_id" ], "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -354,10 +329,10 @@ logical_opt [ "Expressions": [ "__internal_decompress_integral_bigint(#0, 1900)", "#1", - "__internal_decompress_integral_bigint(#2, 1001001)", + "CAST(#2 AS BIGINT)", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -368,7 +343,7 @@ logical_opt [ "brand", "sum_agg" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -421,51 +396,67 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_moy=11", + "Filters": "($.i_manufact_id = 128i64)", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_brand_id", + "i_brand" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manufact_id=128", "Projections": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#1, 1900)", "#0", - "__internal_compress_integral_uinteger(#2, 1001001)", + "CAST(#1 AS INTEGER)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -476,7 +467,7 @@ physical_plan [ "i_brand_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -487,7 +478,7 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -495,10 +486,10 @@ physical_plan [ "Projections": [ "__internal_decompress_integral_bigint(#0, 1900)", "#1", - "__internal_decompress_integral_bigint(#2, 1001001)", + "CAST(#2 AS BIGINT)", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -509,17 +500,18 @@ physical_plan [ "brand", "sum_agg" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], "extra_info": { "Top": "100", "Order By": [ - "dt.d_year ASC", - "sum(memory.main.store_sales.ss_ext_sales_price) DESC", - "memory.main.item.i_brand_id ASC" - ] + "d_year ASC", + "sum_agg DESC", + "brand_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q30.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q30.slt.no index 2921fec29c0..d5325b131b1 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q30.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q30.slt.no @@ -362,8 +362,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -398,19 +397,19 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_customer_id", - "memory.main.customer.c_salutation", - "memory.main.customer.c_first_name", - "memory.main.customer.c_last_name", - "memory.main.customer.c_preferred_cust_flag", - "memory.main.customer.c_birth_day", - "memory.main.customer.c_birth_month", - "memory.main.customer.c_birth_year", - "memory.main.customer.c_birth_country", - "memory.main.customer.c_login", - "memory.main.customer.c_email_address", - "memory.main.customer.c_last_review_date_sk", - "ctr1.ctr_total_return" + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_day", + "c_birth_month", + "c_birth_year", + "c_birth_country", + "c_login", + "c_email_address", + "c_last_review_date_sk", + "ctr_total_return" ] } } @@ -446,95 +445,61 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" + "Filters": [ + "($.d_year = 2002i64)", + "(2450865i64 <= $.d_date_sk <= 2452974i64)" ], - "Estimated Cardinality": "5000" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "wr_returned_date_sk", - "wr_returning_customer_sk", - "wr_returning_addr_sk", - "wr_return_amt" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "7037" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "(2450865i64 <= $.d_date_sk <= 2452974i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(wr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "2921" + "Conditions": "(wr_returning_addr_sk = ca_address_sk)", + "Estimated Cardinality": "7037" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ca_address_sk = wr_returning_addr_sk)", - "Estimated Cardinality": "2921" + "Conditions": "(d_date_sk = wr_returned_date_sk)", + "Estimated Cardinality": "7037" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 2)", - "#2" + "CAST(#1 AS SMALLINT)", + "#2", + "#3" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "7037" } } ], @@ -544,17 +509,17 @@ logical_opt [ "ca_state" ], "Expressions": "sum(wr_return_amt)", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2)", + "CAST(#0 AS BIGINT)", "#1", "#2" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } } ], @@ -564,105 +529,129 @@ logical_opt [ "ctr_state", "ctr_total_return" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "CTE Index": "0", + "Estimated Cardinality": "7036" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_customer_id", - "c_current_addr_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_day", - "c_birth_month", - "c_birth_year", - "c_birth_country", - "c_login", - "c_email_address", - "c_last_review_date_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.c_customer_sk >= 2i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_state = \"GA\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": "ca_address_sk", + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Filters": "($.ca_state = \"GA\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Join Type": "INNER", + "Conditions": "(ctr_customer_sk = c_customer_sk)", + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2000" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ctr_customer_sk)", - "Estimated Cardinality": "829" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13" + ], + "Estimated Cardinality": "1407" } }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -671,76 +660,177 @@ logical_opt [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" + "CTE Index": "60", + "Estimated Cardinality": "1407" } }, { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "7036" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "1407" + } + } + ], + "extra_info": { + "Groups": "#[28.1]", + "Expressions": "", + "Estimated Cardinality": "703" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "703" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ctr_state = ctr_state)", + "Estimated Cardinality": "1407" + } + } + ], + "extra_info": { + "Groups": "ctr_state", + "Expressions": "avg(ctr_total_return)", + "Estimated Cardinality": "703" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "782" + "Expressions": [ + "(avg(ctr_total_return) * 1.2)", + "ctr_state" + ], + "Estimated Cardinality": "703" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ctr_state = ctr_state)", - "Estimated Cardinality": "324" + "Conditions": [ + "(ctr_state IS NOT DISTINCT FROM ctr_state)", + "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Groups": "ctr_state", - "Expressions": "avg(ctr_total_return)", - "Estimated Cardinality": "162" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { "Expressions": [ - "(avg(ctr_total_return) * 1.2)", - "ctr_state" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12" ], - "Estimated Cardinality": "162" + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(ctr_state IS NOT DISTINCT FROM ctr_state)" + "CTE Name": "__duckdb_delim_60", + "Table Index": "60", + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expressions": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "829" + "Expressions": [ + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_day", + "c_birth_month", + "c_birth_year", + "c_birth_country", + "c_login", + "c_email_address", + "c_last_review_date_sk", + "ctr_total_return" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expressions": [ - "c_customer_id", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_day", - "c_birth_month", - "c_birth_year", - "c_birth_country", - "c_login", - "c_email_address", - "c_last_review_date_sk", - "ctr_total_return" - ], - "Estimated Cardinality": "829" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12" + ], "Estimated Cardinality": "100" } } @@ -776,11 +866,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_state" + "Filters": [ + "($.d_year = 2002i64)", + "(2450865i64 <= $.d_date_sk <= 2452974i64)" ], - "Estimated Cardinality": "5000" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } }, { @@ -805,33 +896,36 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "wr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "2921" + "Conditions": "wr_returning_addr_sk = ca_address_sk", + "Estimated Cardinality": "7037" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ca_address_sk = wr_returning_addr_sk", - "Estimated Cardinality": "2921" + "Conditions": "d_date_sk = wr_returned_date_sk", + "Estimated Cardinality": "7037" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 2)", - "#2" + "CAST(#1 AS SMALLINT)", + "#2", + "#3" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "7037" } } ], @@ -841,7 +935,7 @@ physical_plan [ "ca_state", "wr_return_amt" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "7037" } } ], @@ -851,17 +945,17 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2)", + "CAST(#0 AS BIGINT)", "#1", "#2" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } }, { @@ -871,81 +965,83 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "7036" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_current_addr_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_day", - "c_birth_month", - "c_birth_year", - "c_birth_country", - "c_login", - "c_email_address", - "c_last_review_date_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_state='GA'", - "Projections": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "2000" + "Function": "Vortex Scan", + "Filters": "($.c_customer_sk >= 2i64)", + "Projections": [ + "c_customer_sk", + "c_customer_id", + "c_current_addr_sk", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_day", + "c_birth_month", + "c_birth_year", + "c_birth_country", + "c_login", + "c_email_address", + "c_last_review_date_sk" + ], + "Estimated Cardinality": "10000" } }, { - "name": "CTE_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" + "Function": "Vortex Scan", + "Filters": "($.ca_state = \"GA\")", + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = ctr_customer_sk", - "Estimated Cardinality": "829" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "2000" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ctr_customer_sk = c_customer_sk", + "Estimated Cardinality": "1407" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "CTE Index": "60", + "Estimated Cardinality": "1407" } }, { @@ -965,22 +1061,41 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "7036" } }, { - "name": "DELIM_SCAN", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "1407" + } + } + ], + "extra_info": { + "Projections": "#[28.1]", + "Estimated Cardinality": "1407" + } + } + ], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "782" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "703" } } ], "extra_info": { - "Join Type": "INNER", + "Join Type": "SEMI", "Conditions": "ctr_state = ctr_state", - "Estimated Cardinality": "324" + "Estimated Cardinality": "1407" } } ], @@ -989,14 +1104,14 @@ physical_plan [ "ctr_state", "ctr_total_return" ], - "Estimated Cardinality": "324" + "Estimated Cardinality": "1407" } } ], "extra_info": { "Groups": "#0", "Aggregates": "avg(#1)", - "Estimated Cardinality": "162" + "Estimated Cardinality": "703" } } ], @@ -1005,83 +1120,93 @@ physical_plan [ "(avg(ctr_total_return) * 1.2)", "ctr_state" ], - "Estimated Cardinality": "162" + "Estimated Cardinality": "703" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_state IS NOT DISTINCT FROM ctr_state", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#12", - "Aggregates": "", - "Estimated Cardinality": "782" + "Join Type": "INNER", + "Conditions": [ + "ctr_state IS NOT DISTINCT FROM ctr_state", + "CAST(ctr_total_return AS DOUBLE) > SUBQUERY" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_state IS NOT DISTINCT FROM ctr_state", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12" + ], + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expression": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "829" + "CTE Name": "__duckdb_delim_60", + "Table Index": "60", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1407" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11", - "#12" + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_day", + "c_birth_month", + "c_birth_year", + "c_birth_country", + "c_login", + "c_email_address", + "c_last_review_date_sk", + "ctr_total_return" ], - "Estimated Cardinality": "829" + "Estimated Cardinality": "1407" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer.c_customer_id ASC", - "memory.main.customer.c_salutation ASC", - "memory.main.customer.c_first_name ASC", - "memory.main.customer.c_last_name ASC", - "memory.main.customer.c_preferred_cust_flag ASC", - "memory.main.customer.c_birth_day ASC", - "memory.main.customer.c_birth_month ASC", - "memory.main.customer.c_birth_year ASC", - "memory.main.customer.c_birth_country ASC", - "memory.main.customer.c_login ASC", - "memory.main.customer.c_email_address ASC", - "memory.main.customer.c_last_review_date_sk ASC", - "ctr1.ctr_total_return ASC" - ] + "c_customer_id ASC", + "c_salutation ASC", + "c_first_name ASC", + "c_last_name ASC", + "c_preferred_cust_flag ASC", + "c_birth_day ASC", + "c_birth_month ASC", + "c_birth_year ASC", + "c_birth_country ASC", + "c_login ASC", + "c_email_address ASC", + "c_last_review_date_sk ASC", + "ctr_total_return ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "customer_total_return", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q31.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q31.slt.no index 002f57ff2af..bb71a27c8e6 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q31.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q31.slt.no @@ -558,7 +558,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "ss1.ca_county" + "Order By": "ca_county" } } ], @@ -585,13 +585,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -600,22 +600,67 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_addr_sk = ca_address_sk)", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_integral_usmallint(#0, 2450816)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Groups": [ + "#0", + "#2" + ], + "Expressions": "sum(ss_ext_sales_price) EXPORT_STATE", + "Estimated Cardinality": "277294" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_addr_sk", - "ss_ext_sales_price" + "__internal_decompress_integral_bigint(#0, 2450816)", + "#1", + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "277294" } }, { @@ -626,91 +671,74 @@ logical_opt [ "children": [], "extra_info": { "Filters": [ - "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", "($.d_year = 2000i64)", "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "d_date_sk", - "d_year", - "d_qoy" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_county" - ], - "Estimated Cardinality": "5000" + "Conditions": "(#0 = d_date_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "57677" + "Expressions": [ + "#0", + "#1", + "#3", + "CAST(#2 AS TINYINT)" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ + "Groups": [ "#0", - "__internal_compress_integral_utinyint(#1, 2000)", - "__internal_compress_integral_utinyint(#2, 1)", - "#3" + "d_qoy", + "d_year" ], - "Estimated Cardinality": "57677" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Groups": [ - "ca_county", - "d_qoy", - "d_year" + "Expressions": [ + "#0", + "CAST(#1 AS BIGINT)", + "__internal_decompress_integral_bigint(#2, 1900)", + "#3" ], - "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 2000)", - "#3" + "#1", + "#2", + "finalize(#3)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } } ], @@ -721,222 +749,260 @@ logical_opt [ "d_year", "store_sales" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } }, { - "name": "CTE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_bill_addr_sk = ca_address_sk)", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_integral_usmallint(#0, 2450816)", + "#1", + "#2" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#2" + ], + "Expressions": "sum(ws_ext_sales_price) EXPORT_STATE", + "Estimated Cardinality": "70929" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Expressions": [ + "__internal_decompress_integral_bigint(#0, 2450816)", + "#1", + "#2" + ], + "Estimated Cardinality": "70929" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_addr_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": [ - "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", - "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_qoy" - ], - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" + "Join Type": "INNER", + "Conditions": "(#0 = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "ca_address_sk", - "ca_county" + "#0", + "#1", + "#3", + "CAST(#2 AS TINYINT)" ], - "Estimated Cardinality": "5000" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "14322" + "Groups": [ + "#0", + "d_qoy", + "d_year" + ], + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "70929" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 2000)", - "__internal_compress_integral_utinyint(#2, 1)", + "CAST(#1 AS BIGINT)", + "__internal_decompress_integral_bigint(#2, 1900)", "#3" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "70929" } } ], "extra_info": { - "Groups": [ - "ca_county", - "d_qoy", - "d_year" + "Expressions": [ + "#0", + "#1", + "#2", + "finalize(#3)" ], - "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } } ], "extra_info": { "Expressions": [ - "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 2000)", - "#3" + "ca_county", + "d_qoy", + "d_year", + "web_sales" ], - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } - } - ], - "extra_info": { - "Expressions": [ - "ca_county", - "d_qoy", - "d_year", - "web_sales" - ], - "Estimated Cardinality": "14321" - } - }, - { - "name": "ORDER_BY", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "ORDER_BY", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], - "extra_info": { - "Expressions": [ - "(d_qoy = 3)", - "(d_year = 2000)" - ], - "Estimated Cardinality": "57676" - } - }, - { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], - "extra_info": { - "Expressions": [ - "(d_qoy = 1)", - "(d_year = 2000)" - ], - "Estimated Cardinality": "57676" - } - }, { "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "277294" + } + } + ], + "extra_info": { + "Expressions": [ + "(d_qoy = 3)", + "(d_year = 2000)" + ], + "Estimated Cardinality": "277294" + } + }, + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Expressions": [ + "(d_qoy = 3)", + "(d_year = 2000)" + ], + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ca_county = ca_county)", + "Estimated Cardinality": "3933637" + } + }, { "name": "FILTER", "children": [ @@ -945,7 +1011,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } } ], @@ -954,9 +1020,19 @@ logical_opt [ "(d_qoy = 2)", "(d_year = 2000)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ca_county = ca_county)", + "Estimated Cardinality": "218154800" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ { "name": "COMPARISON_JOIN", "children": [ @@ -968,7 +1044,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "1", - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } } ], @@ -977,136 +1053,171 @@ logical_opt [ "(d_qoy = 1)", "(d_year = 2000)" ], - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } }, { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "14321" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "(d_qoy = 2)", - "(d_year = 2000)" - ], - "Estimated Cardinality": "14321" + "CTE Index": "1", + "Estimated Cardinality": "70929" } - }, + } + ], + "extra_info": { + "Expressions": [ + "(d_qoy = 2)", + "(d_year = 2000)" + ], + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ca_county = ca_county)", + "Estimated Cardinality": "1006184" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "14321" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "(d_qoy = 3)", - "(d_year = 2000)" - ], - "Estimated Cardinality": "14321" + "CTE Index": "0", + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_county = ca_county)", - "Estimated Cardinality": "2863" + "Expressions": [ + "(d_qoy = 1)", + "(d_year = 2000)" + ], + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_county = ca_county)", - "Estimated Cardinality": "572" + "Expressions": [ + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 2000)" + ], + "Estimated Cardinality": "277294" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ca_county = ca_county)", - "Estimated Cardinality": "460" + "Estimated Cardinality": "55801790" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ca_county = ca_county)", - "Estimated Cardinality": "371" + "Conditions": [ + "(ca_county = ca_county)", + "((CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL::DOUBLE END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL::DOUBLE END) AND (CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL::DOUBLE END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL::DOUBLE END))" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL END)", - "Estimated Cardinality": "371" + "Expressions": [ + "ca_county", + "d_year", + "web_q1_q2_increase", + "store_q1_q2_increase", + "web_q2_q3_increase", + "store_q2_q3_increase", + "#8" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_county = ca_county)", - "Estimated Cardinality": "63672694431946" + "Expressions": [ + "#0", + "#6", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL END)", - "Estimated Cardinality": "63672694431946" + "Order By": "ca_county", + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "63672694431946" + "Expressions": [ + "#0", + "__internal_decompress_integral_bigint(#1, 2000)", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { "Expressions": [ - "ca_county", - "d_year", - "web_q1_q2_increase", - "store_q1_q2_increase", - "web_q2_q3_increase", - "store_q2_q3_increase" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "63672694431946" + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Order By": "ss1.ca_county", - "Estimated Cardinality": "63672694431946" + "CTE Name": "ws", + "Table Index": "1", + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "CTE Name": "ws", - "Table Index": "1", - "Estimated Cardinality": "63672694431946" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { "CTE Name": "ss", "Table Index": "0", - "Estimated Cardinality": "63672694431946" + "Estimated Cardinality": "20730882950675" } } ] @@ -1118,115 +1229,199 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_addr_sk", + "ss_ext_sales_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_county" + ], + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_addr_sk = ca_address_sk", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_integral_usmallint(#0, 2450816)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "ss_ext_sales_price" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "277294" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_addr_sk", - "ss_ext_sales_price" + "__internal_decompress_integral_bigint(#0, 2450816)", + "#1", + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "277294" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year", + "d_qoy" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", "Projections": [ - "d_date_sk", - "d_year", - "d_qoy" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_county" - ], - "Estimated Cardinality": "5000" + "Conditions": "#0 = d_date_sk", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "57677" + "Projections": [ + "#0", + "#1", + "#3", + "CAST(#2 AS TINYINT)" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 2000)", - "__internal_compress_integral_utinyint(#2, 1)", - "#3" + "d_qoy", + "d_year", + "#1" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "ca_county", - "d_qoy", - "d_year", - "ss_ext_sales_price" + "Groups": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "57677" + "Aggregates": "combine_aggr(#3)", + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", - "#1", - "#2" + "CAST(#1 AS BIGINT)", + "__internal_decompress_integral_bigint(#2, 1900)", + "#3" ], - "Aggregates": "sum(#3)", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 2000)", - "#3" + "#1", + "#2", + "finalize(#3)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } }, { @@ -1236,164 +1431,287 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_addr_sk", + "ws_ext_sales_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_county" + ], + "Estimated Cardinality": "5000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_bill_addr_sk = ca_address_sk", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_integral_usmallint(#0, 2450816)", + "#1", + "#2" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "ws_ext_sales_price" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "70929" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_bill_addr_sk", - "ws_ext_sales_price" + "__internal_decompress_integral_bigint(#0, 2450816)", + "#1", + "#2" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "70929" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "((($.d_qoy = 1i64) or ($.d_qoy = 2i64)) or ($.d_qoy = 3i64))", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year", + "d_qoy" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", "Projections": [ - "d_date_sk", - "d_year", - "d_qoy" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_county" - ], - "Estimated Cardinality": "5000" + "Conditions": "#0 = d_date_sk", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "14322" + "Projections": [ + "#0", + "#1", + "#3", + "CAST(#2 AS TINYINT)" + ], + "Estimated Cardinality": "71632" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 2000)", - "__internal_compress_integral_utinyint(#2, 1)", - "#3" + "d_qoy", + "d_year", + "#1" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ - "ca_county", - "d_qoy", - "d_year", - "ws_ext_sales_price" + "Groups": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "14322" + "Aggregates": "combine_aggr(#3)", + "Estimated Cardinality": "70929" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", - "#1", - "#2" + "CAST(#1 AS BIGINT)", + "__internal_decompress_integral_bigint(#2, 1900)", + "#3" ], - "Aggregates": "sum(#3)", - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 2000)", - "#3" + "#1", + "#2", + "finalize(#3)" ], - "Estimated Cardinality": "14321" + "Estimated Cardinality": "70929" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "277294" + } + } + ], + "extra_info": { + "Expression": "((d_qoy = 3) AND (d_year = 2000))", + "Estimated Cardinality": "277294" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#3" + ], + "Estimated Cardinality": "277294" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Expression": "((d_qoy = 3) AND (d_year = 2000))", + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#3" + ], + "Estimated Cardinality": "70929" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" + "Join Type": "INNER", + "Conditions": "ca_county = ca_county", + "Estimated Cardinality": "3933637" } - } - ], - "extra_info": { - "Expression": "((d_qoy = 3) AND (d_year = 2000))", - "Estimated Cardinality": "57676" - } - } - ], - "extra_info": { - "Projections": [ - "#0", - "#3" - ], - "Estimated Cardinality": "57676" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1405,25 +1723,34 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Expression": "((d_qoy = 1) AND (d_year = 2000))", - "Estimated Cardinality": "57676" + "Expression": "((d_qoy = 2) AND (d_year = 2000))", + "Estimated Cardinality": "277294" } } ], "extra_info": { "Projections": [ "#0", - "#2", "#3" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277294" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ca_county = ca_county", + "Estimated Cardinality": "218154800" + } + }, + { + "name": "HASH_JOIN", + "children": [ { "name": "HASH_JOIN", "children": [ @@ -1437,14 +1764,14 @@ physical_plan [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" + "CTE Index": "1", + "Estimated Cardinality": "70929" } } ], "extra_info": { - "Expression": "((d_qoy = 2) AND (d_year = 2000))", - "Estimated Cardinality": "57676" + "Expression": "((d_qoy = 1) AND (d_year = 2000))", + "Estimated Cardinality": "70929" } } ], @@ -1453,179 +1780,166 @@ physical_plan [ "#0", "#3" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "70929" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "14321" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expression": "((d_qoy = 1) AND (d_year = 2000))", - "Estimated Cardinality": "14321" + "CTE Index": "1", + "Estimated Cardinality": "70929" } } ], "extra_info": { - "Projections": [ - "#0", - "#3" - ], - "Estimated Cardinality": "14321" + "Expression": "((d_qoy = 2) AND (d_year = 2000))", + "Estimated Cardinality": "70929" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#3" + ], + "Estimated Cardinality": "70929" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ca_county = ca_county", + "Estimated Cardinality": "1006184" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "14321" - } - } - ], - "extra_info": { - "Expression": "((d_qoy = 2) AND (d_year = 2000))", - "Estimated Cardinality": "14321" - } - } - ], - "extra_info": { - "Projections": [ - "#0", - "#3" - ], - "Estimated Cardinality": "14321" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "14321" - } - } - ], - "extra_info": { - "Expression": "((d_qoy = 3) AND (d_year = 2000))", - "Estimated Cardinality": "14321" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "#0", - "#3" - ], - "Estimated Cardinality": "14321" + "CTE Index": "0", + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_county = ca_county", - "Estimated Cardinality": "2863" + "Expression": "((d_qoy = 1) AND (d_year = 2000))", + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_county = ca_county", - "Estimated Cardinality": "572" + "Projections": [ + "#0", + "#2", + "#3" + ], + "Estimated Cardinality": "277294" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_county = ca_county", - "Estimated Cardinality": "460" + "Projections": [ + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 2000)" + ], + "Estimated Cardinality": "277294" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ca_county = ca_county", - "Estimated Cardinality": "371" + "Estimated Cardinality": "55801790" } } ], "extra_info": { - "Expression": "(CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL END)", - "Estimated Cardinality": "371" + "Join Type": "INNER", + "Conditions": [ + "ca_county = ca_county", + "((CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL::DOUBLE END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL::DOUBLE END) AND (CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL::DOUBLE END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL::DOUBLE END))" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_county = ca_county", - "Estimated Cardinality": "63672694431946" + "Projections": [ + "ca_county", + "d_year", + "web_q1_q2_increase", + "store_q1_q2_increase", + "web_q2_q3_increase", + "store_q2_q3_increase", + "#8" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Expression": "(CASE WHEN ((web_sales > 0.00)) THEN ((CAST((web_sales * 1.0000) AS DOUBLE) / CAST(web_sales AS DOUBLE))) ELSE NULL END > CASE WHEN ((store_sales > 0.00)) THEN ((CAST((store_sales * 1.0000) AS DOUBLE) / CAST(store_sales AS DOUBLE))) ELSE NULL END)", - "Estimated Cardinality": "63672694431946" + "Projections": [ + "#0", + "#6", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Projections": [ - "ca_county", - "d_year", - "web_q1_q2_increase", - "store_q1_q2_increase", - "web_q2_q3_increase", - "store_q2_q3_increase" - ], - "Estimated Cardinality": "63672694431946" + "Order By": "ca_county ASC", + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { - "Order By": "ss1.ca_county ASC" + "Projections": [ + "#0", + "__internal_decompress_integral_bigint(#1, 2000)", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { "CTE Name": "ws", "Table Index": "1", - "Estimated Cardinality": "63672694431946" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "20730882950675" } } ], "extra_info": { "CTE Name": "ss", "Table Index": "0", - "Estimated Cardinality": "63672694431946" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "20730882950675" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q32.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q32.slt.no index f87efe167df..5724a69cf86 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q32.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q32.slt.no @@ -323,8 +323,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -361,16 +360,16 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "LIMIT", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -379,43 +378,21 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_discount_amt" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_manufact_id = 977i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "72" + "Filters": "($.i_manufact_id = 977i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], @@ -426,23 +403,14 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -452,27 +420,59 @@ logical_opt [ "Conditions": "(cs_sold_date_sk = d_date_sk)", "Estimated Cardinality": "28731" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#1", + "#0" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "28731" + } + }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -482,35 +482,62 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "143657" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Groups": "#[8.0]", + "Expressions": "", + "Estimated Cardinality": "14365" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "14365" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "14365" + } } ], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_discount_amt" - ], - "Estimated Cardinality": "143657" + "Join Type": "SEMI", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" } }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "26040" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "26040" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -525,74 +552,80 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "26040" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 2450815)" - ], - "Estimated Cardinality": "26040" + "Groups": "i_item_sk", + "Expressions": "avg(cs_ext_discount_amt)", + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Groups": "i_item_sk", - "Expressions": "avg(cs_ext_discount_amt)", - "Estimated Cardinality": "13020" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "14365" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "(1.3 * avg(cs_ext_discount_amt))", + "i_item_sk" ], - "Estimated Cardinality": "13020" + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Expressions": [ - "(1.3 * avg(cs_ext_discount_amt))", - "i_item_sk" + "Join Type": "INNER", + "Conditions": [ + "(i_item_sk IS NOT DISTINCT FROM i_item_sk)", + "(CAST(cs_ext_discount_amt AS DOUBLE) > SUBQUERY)" ], - "Estimated Cardinality": "13020" + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(i_item_sk IS NOT DISTINCT FROM i_item_sk)" + "Expressions": "#0", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": "(CAST(cs_ext_discount_amt AS DOUBLE) > SUBQUERY)", + "Expressions": "#0", "Estimated Cardinality": "28731" } } ], "extra_info": { - "Groups": "", - "Expressions": "sum(cs_ext_discount_amt)", - "Estimated Cardinality": "1" + "CTE Name": "__duckdb_delim_51", + "Table Index": "51", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": "" + "Groups": "", + "Expressions": "sum(cs_ext_discount_amt)", + "Estimated Cardinality": "1" } } ], @@ -604,228 +637,256 @@ logical_opt [ ] physical_plan [ { - "name": "STREAMING_LIMIT", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_discount_amt" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manufact_id=977", - "Projections": "i_item_sk", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "28731" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28731" + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_ext_discount_amt" + ], + "Estimated Cardinality": "143657" } }, { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_manufact_id = 977i64)", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#0" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, - { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_ext_discount_amt" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_discount_amt" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "DELIM_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "28731" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "28731" + } + } + ], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "26040" + "Projections": "#[8.0]", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "26040" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "26040" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 2450815)" + "Join Type": "SEMI", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "26040" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "i_item_sk", - "cs_ext_discount_amt" - ], - "Estimated Cardinality": "26040" + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "28731" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "i_item_sk", + "cs_ext_discount_amt" ], - "Estimated Cardinality": "13020" + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Projections": [ - "(1.3 * avg(cs_ext_discount_amt))", - "i_item_sk" - ], - "Estimated Cardinality": "13020" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_item_sk IS NOT DISTINCT FROM i_item_sk", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "26040" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_item_sk IS NOT DISTINCT FROM i_item_sk", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Projections": [ + "(1.3 * avg(cs_ext_discount_amt))", + "i_item_sk" + ], + "Estimated Cardinality": "14365" } } ], "extra_info": { - "Expression": "(CAST(cs_ext_discount_amt AS DOUBLE) > SUBQUERY)", + "Join Type": "INNER", + "Conditions": [ + "i_item_sk IS NOT DISTINCT FROM i_item_sk", + "CAST(cs_ext_discount_amt AS DOUBLE) > SUBQUERY" + ], "Estimated Cardinality": "28731" } } @@ -837,16 +898,22 @@ physical_plan [ } ], "extra_info": { - "Projections": "cs_ext_discount_amt", + "CTE Name": "__duckdb_delim_51", + "Table Index": "51", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "28731" } } ], "extra_info": { - "Aggregates": "sum(#0)" + "Projections": "cs_ext_discount_amt", + "Estimated Cardinality": "28731" } } ], - "extra_info": {} + "extra_info": { + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" + } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q33.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q33.slt.no index d78319e7d73..fab01da9e7b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q33.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q33.slt.no @@ -1026,7 +1026,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum(tmp1.total_sales)" + "Order By": "total_sales" } } ], @@ -1100,170 +1100,127 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_addr_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 5i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "(i_manufact_id = #0)", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": "i_manufact_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": "i_manufact_id", - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_manufact_id = #0)", - "Estimated Cardinality": "360" + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "2307" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "i_manufact_id", "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } } ], @@ -1272,7 +1229,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } } ], @@ -1281,7 +1238,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } } ], @@ -1290,7 +1247,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } }, { @@ -1315,93 +1272,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_addr_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 5i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "5744" + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1409,82 +1296,109 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Filters": "", "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_manufact_id", + "Join Type": "SEMI", + "Conditions": "(i_manufact_id = #0)", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_manufact_id", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_manufact_id = #0)", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(cs_bill_addr_sk = ca_address_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "1148" + "Conditions": "(d_date_sk = cs_sold_date_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "#1", + "CAST(#2 AS SMALLINT)" ], - "Estimated Cardinality": "1148" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "i_manufact_id", "Expressions": "sum(cs_ext_sales_price)", - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } } ], @@ -1493,7 +1407,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } } ], @@ -1502,7 +1416,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } } ], @@ -1511,7 +1425,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } }, { @@ -1536,93 +1450,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_addr_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 5i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2864" + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1630,82 +1474,109 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Filters": "", "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_manufact_id", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_manufact_id", + "Join Type": "SEMI", + "Conditions": "(i_manufact_id = #0)", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_manufact_id", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_manufact_id = #0)", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ws_bill_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "572" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "#1", + "CAST(#2 AS SMALLINT)" ], - "Estimated Cardinality": "572" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "i_manufact_id", "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], @@ -1714,7 +1585,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], @@ -1723,7 +1594,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], @@ -1732,38 +1603,38 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "4009" + "Estimated Cardinality": "2926" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "4009" + "Estimated Cardinality": "2926" } } ], "extra_info": { "Groups": "i_manufact_id", "Expressions": "sum(total_sales)", - "Estimated Cardinality": "3981" + "Estimated Cardinality": "943" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "3981" + "Estimated Cardinality": "943" } } ], @@ -1772,7 +1643,7 @@ logical_opt [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "3981" + "Estimated Cardinality": "943" } } ], @@ -1837,23 +1708,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_manufact_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Projections": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=5" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_manufact_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -1861,64 +1751,47 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", - "Projections": "i_manufact_id", - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_manufact_id = #0", - "Estimated Cardinality": "360" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "2307" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], @@ -1927,22 +1800,23 @@ physical_plan [ "i_manufact_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "sum(#1)" + "Aggregates": "sum(#1)", + "Estimated Cardinality": "995" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "995" } }, { @@ -1960,6 +1834,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1981,23 +1869,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_manufact_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Projections": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=5" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_manufact_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" } }, { @@ -2005,64 +1912,33 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "5744" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", - "Projections": "i_manufact_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_manufact_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "1148" + "Conditions": "d_date_sk = cs_sold_date_sk", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "#1", + "CAST(#2 AS SMALLINT)" ], - "Estimated Cardinality": "1148" + "Estimated Cardinality": "5746" } } ], @@ -2071,22 +1947,23 @@ physical_plan [ "i_manufact_id", "cs_ext_sales_price" ], - "Estimated Cardinality": "1148" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "sum(#1)" + "Aggregates": "sum(#1)", + "Estimated Cardinality": "992" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "992" } }, { @@ -2104,6 +1981,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 5i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -2125,23 +2016,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_manufact_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", + "Projections": "i_manufact_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=5" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_manufact_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" } }, { @@ -2149,64 +2059,33 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "2864" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Electronics\"], $.i_category, opts=sql_null_semantics)", - "Projections": "i_manufact_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_manufact_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "572" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "#1", + "CAST(#2 AS SMALLINT)" ], - "Estimated Cardinality": "572" + "Estimated Cardinality": "2865" } } ], @@ -2215,22 +2094,23 @@ physical_plan [ "i_manufact_id", "ws_ext_sales_price" ], - "Estimated Cardinality": "572" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "sum(#1)" + "Aggregates": "sum(#1)", + "Estimated Cardinality": "939" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "939" } } ], @@ -2239,10 +2119,10 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "4009" + "Estimated Cardinality": "2926" } } ], @@ -2251,28 +2131,30 @@ physical_plan [ "i_manufact_id", "total_sales" ], - "Estimated Cardinality": "4009" + "Estimated Cardinality": "2926" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "sum(#1)" + "Aggregates": "sum(#1)", + "Estimated Cardinality": "943" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "3981" + "Estimated Cardinality": "943" } } ], "extra_info": { "Top": "100", - "Order By": "sum(tmp1.total_sales) ASC" + "Order By": "total_sales ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q34.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q34.slt.no index 60d511f95c7..7e4f7752600 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q34.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q34.slt.no @@ -340,11 +340,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name", - "memory.main.customer.c_first_name", - "memory.main.customer.c_salutation", - "memory.main.customer.c_preferred_cust_flag", - "dn.ss_ticket_number" + "c_last_name", + "c_first_name", + "c_salutation", + "c_preferred_cust_flag", + "ss_ticket_number" ] } } @@ -363,25 +363,34 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -390,7 +399,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -400,51 +409,35 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_store_sk", - "ss_ticket_number" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "FILTER", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.hd_buy_potential = \">10000\") or ($.hd_buy_potential = \"Unknown\"))", + "($.hd_vehicle_count > 0i32)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "1440" + } + } + ], "extra_info": { - "Filters": [ - "((($.d_dom >= 1i64) and ($.d_dom <= 3i64)) or (($.d_dom >= 25i64) and ($.d_dom <= 28i64)))", - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Expressions": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL::DOUBLE END > 1.2)", + "Estimated Cardinality": "288" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -456,133 +449,98 @@ logical_opt [ } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "FILTER", - "children": [ + }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.hd_buy_potential = \">10000\") or ($.hd_buy_potential = \"Unknown\"))", - "($.hd_vehicle_count > 0i32)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "1440" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_dep_count", - "hd_vehicle_count" + "Filters": [ + "((($.d_dom >= 1i64) and ($.d_dom <= 3i64)) or (($.d_dom >= 25i64) and ($.d_dom <= 28i64)))", + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1440" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL END > 1.2)", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "Groups": [ + "ss_ticket_number", + "ss_customer_sk" ], - "Estimated Cardinality": "288464" + "Expressions": "count_star()", + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Groups": [ - "ss_ticket_number", - "ss_customer_sk" + "Expressions": [ + "CAST(#1 AS BIGINT)", + "#2", + "#0" ], - "Expressions": "count_star()", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" - ], - "Estimated Cardinality": "288463" + "Expressions": "(cnt BETWEEN 15 AND 20)", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Expressions": "(cnt BETWEEN 15 AND 20)", - "Estimated Cardinality": "57692" + "Join Type": "INNER", + "Conditions": "(c_customer_sk = ss_customer_sk)", + "Estimated Cardinality": "2307" } } ], "extra_info": { "Expressions": [ - "ss_ticket_number", - "ss_customer_sk", - "cnt" + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS BIGINT)" ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag" - ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57692" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#5", + "#4" + ], + "Estimated Cardinality": "2307" } } ], @@ -595,7 +553,7 @@ logical_opt [ "ss_ticket_number", "cnt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], @@ -605,21 +563,22 @@ logical_opt [ "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name", - "memory.main.customer.c_first_name", - "memory.main.customer.c_salutation", - "memory.main.customer.c_preferred_cust_flag", - "dn.ss_ticket_number" - ] + "c_last_name", + "c_first_name", + "c_salutation", + "c_preferred_cust_flag", + "ss_ticket_number" + ], + "Estimated Cardinality": "2307" } } ], @@ -629,9 +588,10 @@ logical_opt [ "#1", "#2", "#3", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" - ] + ], + "Estimated Cardinality": "2307" } } ] @@ -649,45 +609,125 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_GROUP_BY", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag" + ], + "Estimated Cardinality": "10000" + } + }, + { + "name": "FILTER", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_hdemo_sk", + "ss_store_sk", + "ss_ticket_number" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.hd_buy_potential = \">10000\") or ($.hd_buy_potential = \"Unknown\"))", + "($.hd_vehicle_count > 0i32)" + ], + "Projections": [ + "hd_demo_sk", + "hd_dep_count", + "hd_vehicle_count" + ], + "Estimated Cardinality": "1440" + } + } + ], + "extra_info": { + "Expression": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL::DOUBLE END > 1.2)", + "Estimated Cardinality": "288" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "288" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_county = \"Williamson County\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_store_sk", - "ss_ticket_number" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "11538" } }, { @@ -708,133 +748,85 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "s_county='Williamson County'", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(($.hd_buy_potential = \">10000\") or ($.hd_buy_potential = \"Unknown\"))", - "($.hd_vehicle_count > 0i32)" - ], - "Projections": [ - "hd_demo_sk", - "hd_dep_count", - "hd_vehicle_count" - ], - "Estimated Cardinality": "1440" - } - } - ], - "extra_info": { - "Expression": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL END > 1.2)", - "Estimated Cardinality": "1440" - } - } - ], - "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1440" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "288464" + "Projections": [ + "ss_ticket_number", + "ss_customer_sk" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "288464" + "Aggregates": "count_star()", + "Estimated Cardinality": "11537" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk" + "CAST(#1 AS BIGINT)", + "#2", + "#0" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "count_star()", - "Estimated Cardinality": "288463" + "Expression": "(cnt BETWEEN 15 AND 20)", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" - ], - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "c_customer_sk = ss_customer_sk", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Expression": "(cnt BETWEEN 15 AND 20)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "c_customer_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag" + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS BIGINT)" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57692" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#5", + "#4" + ], + "Estimated Cardinality": "2307" } } ], @@ -847,7 +839,7 @@ physical_plan [ "ss_ticket_number", "cnt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], @@ -857,21 +849,22 @@ physical_plan [ "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name ASC", - "memory.main.customer.c_first_name ASC", - "memory.main.customer.c_salutation ASC", - "memory.main.customer.c_preferred_cust_flag DESC", - "dn.ss_ticket_number ASC" - ] + "c_last_name ASC", + "c_first_name ASC", + "c_salutation ASC", + "c_preferred_cust_flag DESC", + "ss_ticket_number ASC" + ], + "Estimated Cardinality": "2307" } } ], @@ -881,10 +874,10 @@ physical_plan [ "#1", "#2", "#3", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "2307" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q35.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q35.slt.no index 7932c5a6ed5..d32b56e98f6 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q35.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q35.slt.no @@ -364,8 +364,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -558,8 +557,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -752,8 +750,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -817,12 +814,12 @@ logical_plan [ ], "extra_info": { "Order By": [ - "ca.ca_state", - "memory.main.customer_demographics.cd_gender", - "memory.main.customer_demographics.cd_marital_status", - "memory.main.customer_demographics.cd_dep_count", - "memory.main.customer_demographics.cd_dep_employed_count", - "memory.main.customer_demographics.cd_dep_college_count" + "ca_state", + "cd_gender", + "cd_marital_status", + "cd_dep_count", + "cd_dep_employed_count", + "cd_dep_college_count" ] } } @@ -846,40 +843,33 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_dep_count", - "cd_dep_employed_count", - "cd_dep_college_count" - ], - "Estimated Cardinality": "192080" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" } }, { @@ -889,92 +879,17 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "192080" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "is_not_null($.ss_customer_sk)", "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -985,48 +900,50 @@ logical_opt [ "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Expressions": "c_customer_sk", + "Estimated Cardinality": "57692" } }, { - "name": "DELIM_GET", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9999" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57671" + "Join Type": "RIGHT_SEMI", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "57671" + "Join Type": "INNER", + "Conditions": "(ca_address_sk = c_current_addr_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "38416" + "Join Type": "INNER", + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", + "Estimated Cardinality": "2000" } }, { @@ -1036,84 +953,45 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "($.d_qoy < 4i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Filters": "is_not_null($.ws_bill_customer_sk)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14326" } }, { - "name": "DELIM_GET", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9785" + "Filters": [ + "($.d_year = 2002i64)", + "($.d_qoy < 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "14014" + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Expressions": "c_customer_sk", - "Estimated Cardinality": "14014" + "Estimated Cardinality": "14326" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "38416" + "Estimated Cardinality": "2000" } }, { @@ -1123,89 +1001,51 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ship_customer_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2002i64)", - "($.d_qoy < 4i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Filters": "is_not_null($.cs_ship_customer_sk)", + "Function": "Vortex Scan", + "Estimated Cardinality": "28731" } }, { - "name": "DELIM_GET", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9785" + "Filters": [ + "($.d_year = 2002i64)", + "($.d_qoy < 4i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_ship_customer_sk = c_customer_sk)", - "Estimated Cardinality": "28105" + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { "Expressions": "c_customer_sk", - "Estimated Cardinality": "28105" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Join Type": "MARK", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)" + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { "Expressions": "(SUBQUERY OR SUBQUERY)", - "Estimated Cardinality": "38416" + "Estimated Cardinality": "400" } } ], @@ -1230,7 +1070,7 @@ logical_opt [ "max(cd_dep_college_count)", "avg(cd_dep_college_count)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "399" } } ], @@ -1255,7 +1095,7 @@ logical_opt [ "max(cd_dep_college_count)", "avg(cd_dep_college_count)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "399" } } ], @@ -1285,73 +1125,28 @@ physical_plan [ "name": "FILTER", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Projections": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_dep_count", - "cd_dep_employed_count", - "cd_dep_college_count" - ], - "Estimated Cardinality": "192080" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Function": "Vortex Scan", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Projections": [ + "cd_demo_sk", + "cd_gender", + "cd_marital_status", + "cd_dep_count", + "cd_dep_employed_count", + "cd_dep_college_count" + ], "Estimated Cardinality": "192080" } }, @@ -1359,17 +1154,22 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Estimated Cardinality": "38416" + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "5000" } }, { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", @@ -1379,11 +1179,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "is_not_null($.ss_customer_sk)", "Projections": [ "ss_sold_date_sk", "ss_customer_sk" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } }, { @@ -1391,164 +1192,60 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2002", + "Filters": [ + "($.d_year = 2002i64)", + "($.d_qoy < 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "9999" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57671" - } - } - ], - "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "57671" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "9999" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416", - "Delim Index": "1" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "38416" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Projections": "c_customer_sk", + "Estimated Cardinality": "57692" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "9785" + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_current_cdemo_sk", + "c_current_addr_sk" + ], + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "14014" + "Join Type": "RIGHT_SEMI", + "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "14014" + "Join Type": "INNER", + "Conditions": "ca_address_sk = c_current_addr_sk", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "9785" - } - } - ], - "extra_info": { - "Join Type": "MARK", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416", - "Delim Index": "2" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" + "Join Type": "INNER", + "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Estimated Cardinality": "2000" } }, { @@ -1558,86 +1255,109 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_ship_customer_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2002", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Function": "Vortex Scan", + "Filters": "is_not_null($.ws_bill_customer_sk)", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk" + ], + "Estimated Cardinality": "14326" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "3", - "Estimated Cardinality": "9785" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2002i64)", + "($.d_qoy < 4i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_ship_customer_sk = c_customer_sk", - "Estimated Cardinality": "28105" + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Projections": "c_customer_sk", - "Estimated Cardinality": "28105" + "Estimated Cardinality": "14326" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "0" + "Estimated Cardinality": "2000" } }, { - "name": "HASH_GROUP_BY", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "is_not_null($.cs_ship_customer_sk)", + "Projections": [ + "cs_sold_date_sk", + "cs_ship_customer_sk" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2002i64)", + "($.d_qoy < 4i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" + } + } + ], "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "9785" + "Projections": "c_customer_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "0", - "Delim Index": "3" + "Estimated Cardinality": "2000" } } ], "extra_info": { "Expression": "(SUBQUERY OR SUBQUERY)", - "Estimated Cardinality": "38416" + "Estimated Cardinality": "400" } } ], @@ -1650,7 +1370,7 @@ physical_plan [ "#4", "#5" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "400" } } ], @@ -1672,7 +1392,7 @@ physical_plan [ "cd_dep_college_count", "cd_dep_college_count" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "400" } } ], @@ -1697,7 +1417,7 @@ physical_plan [ "max(#13)", "avg(#14)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "399" } } ], @@ -1722,20 +1442,21 @@ physical_plan [ "max(cd_dep_college_count)", "avg(cd_dep_college_count)" ], - "Estimated Cardinality": "38416" + "Estimated Cardinality": "399" } } ], "extra_info": { "Top": "100", "Order By": [ - "ca.ca_state ASC", - "memory.main.customer_demographics.cd_gender ASC", - "memory.main.customer_demographics.cd_marital_status ASC", - "memory.main.customer_demographics.cd_dep_count ASC", - "memory.main.customer_demographics.cd_dep_employed_count ASC", - "memory.main.customer_demographics.cd_dep_college_count ASC" - ] + "ca_state ASC", + "cd_gender ASC", + "cd_marital_status ASC", + "cd_dep_count ASC", + "cd_dep_employed_count ASC", + "cd_dep_college_count ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q36.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q36.slt.no index 59f4b12c273..84d76bb7bf3 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q36.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q36.slt.no @@ -446,7 +446,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = CAST(0 AS INTEGER))) THEN (i_category) ELSE CAST(NULL AS VARCHAR) END ORDER BY gross_margin ASC NULLS LAST)" + "Expressions": "rank() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = CAST(0 AS INTEGER))) THEN (i_category) ELSE CAST(NULL AS VARCHAR) END ORDER BY gross_margin ASC NULLS LAST)" } } ], @@ -464,9 +464,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "results_rollup.lochierarchy", + "lochierarchy", "#[59.5]", - "rank() OVER (PARTITION BY results_rollup.lochierarchy, CASE WHEN ((results_rollup.t_class = 0)) THEN (results_rollup.i_category) ELSE NULL END ORDER BY results_rollup.gross_margin ASC)" + "rank_within_parent" ] } } @@ -510,119 +510,32 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_class", - "i_category" - ], - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "57677" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.s_state = \"TN\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "s_store_sk", + "Filters": "($.s_state = \"TN\")", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } @@ -630,43 +543,55 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "__internal_compress_integral_utinyint(#4, 1)" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "57677" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "i_category", - "i_class" - ], - "Expressions": [ - "sum(ss_net_profit)", - "sum(ss_ext_sales_price)" - ], - "Estimated Cardinality": "57676" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { + "Groups": [ + "i_category", + "i_class" + ], "Expressions": [ - "#0", - "#1", - "#2", - "#3" + "sum(ss_net_profit)", + "sum(ss_ext_sales_price)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "275359" } } ], @@ -678,7 +603,7 @@ logical_opt [ "i_category", "i_class" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "275359" } } ], @@ -689,7 +614,8 @@ logical_opt [ "#2", "#3", "#4" - ] + ], + "Estimated Cardinality": "275359" } }, { @@ -717,110 +643,126 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], - "extra_info": { - "Expressions": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" - ], - "Estimated Cardinality": "57676" - } - }, - { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "CTE_SCAN", "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "275359" } } ], "extra_info": { - "Groups": "i_category", "Expressions": [ - "sum(ss_net_profit)", - "sum(ss_ext_sales_price)" + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" ], - "Estimated Cardinality": "52275" + "Estimated Cardinality": "275359" } - } - ], - "extra_info": { - "Expressions": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" - ], - "Estimated Cardinality": "52275" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "275359" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" + "Groups": "i_category", + "Expressions": [ + "sum(ss_net_profit)", + "sum(ss_ext_sales_price)" + ], + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "sum(ss_net_profit)", - "sum(ss_ext_sales_price)" + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "275359" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ss_net_profit)", + "sum(ss_ext_sales_price)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" - ], - "Estimated Cardinality": "1" + "Expressions": "", + "Estimated Cardinality": "277160" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "57676" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "277160" } } ], @@ -829,17 +771,17 @@ logical_opt [ "#0", "#1", "#2", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)", - "__internal_compress_integral_utinyint(#5, 0)" + "CAST(#3 AS TINYINT)", + "CAST(#4 AS TINYINT)", + "CAST(#5 AS TINYINT)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277160" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "57676", + "Estimated Cardinality": "277159", "Distinct Targets": [ "gross_margin", "i_category", @@ -856,11 +798,11 @@ logical_opt [ "#0", "#1", "#2", - "__internal_decompress_integral_integer(#3, 0)", - "__internal_decompress_integral_integer(#4, 0)", - "__internal_decompress_integral_integer(#5, 0)" + "CAST(#3 AS INTEGER)", + "CAST(#4 AS INTEGER)", + "CAST(#5 AS INTEGER)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], @@ -872,13 +814,13 @@ logical_opt [ "#4", "#5" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = 0)) THEN (i_category) ELSE NULL END ORDER BY gross_margin ASC NULLS LAST)", - "Estimated Cardinality": "57676" + "Expressions": "rank() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = 0)) THEN (i_category) ELSE NULL::VARCHAR END ORDER BY gross_margin ASC NULLS LAST)", + "Estimated Cardinality": "277159" } } ], @@ -889,9 +831,9 @@ logical_opt [ "i_class", "lochierarchy", "rank_within_parent", - "CASE WHEN ((lochierarchy = 0)) THEN (i_category) ELSE NULL END" + "CASE WHEN ((lochierarchy = 0)) THEN (i_category) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], @@ -934,7 +876,7 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -943,38 +885,18 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_store_sk", + "ss_ext_sales_price", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" } }, { @@ -982,19 +904,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_class", - "i_category" - ], - "Estimated Cardinality": "1800" + "Filters": "($.s_state = \"TN\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" } }, { @@ -1002,28 +921,39 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "s_state='TN'", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Projections": [ + "i_item_sk", + "i_class", + "i_category" + ], + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "__internal_compress_integral_utinyint(#4, 1)" - ], - "Estimated Cardinality": "57677" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" } } ], @@ -1034,7 +964,7 @@ physical_plan [ "ss_net_profit", "ss_ext_sales_price" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -1047,7 +977,7 @@ physical_plan [ "sum(#2)", "sum(#3)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "275359" } } ], @@ -1059,7 +989,7 @@ physical_plan [ "i_category", "i_class" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "275359" } }, { @@ -1093,148 +1023,132 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "UNION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" - ], - "Estimated Cardinality": "57676" + "CTE Index": "0", + "Estimated Cardinality": "275359" } - }, + } + ], + "extra_info": { + "Projections": [ + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" + ], + "Estimated Cardinality": "275359" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "i_category", - "ss_net_profit", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "57676" + "CTE Index": "0", + "Estimated Cardinality": "275359" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" + "Projections": [ + "i_category", + "ss_net_profit", + "ss_ext_sales_price" ], - "Estimated Cardinality": "52275" + "Estimated Cardinality": "275359" } } ], "extra_info": { - "Projections": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" ], - "Estimated Cardinality": "52275" + "Estimated Cardinality": "1800" } - }, + } + ], + "extra_info": { + "Projections": [ + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57676" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "ss_net_profit", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "57676" + "CTE Index": "0", + "Estimated Cardinality": "275359" } } ], "extra_info": { - "Aggregates": [ - "sum(#0)", - "sum(#1)" - ] + "Projections": [ + "ss_net_profit", + "ss_ext_sales_price" + ], + "Estimated Cardinality": "275359" } } ], "extra_info": { - "Projections": [ - "gross_margin", - "i_category", - "i_class", - "t_category", - "t_class", - "lochierarchy" + "Aggregates": [ + "sum(#0)", + "sum(#1)" ], "Estimated Cardinality": "1" } } ], - "extra_info": {} + "extra_info": { + "Projections": [ + "gross_margin", + "i_category", + "i_class", + "t_category", + "t_class", + "lochierarchy" + ], + "Estimated Cardinality": "1" + } } ], - "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" - ], - "Aggregates": "", - "Estimated Cardinality": "57676" - } + "extra_info": {} } ], "extra_info": { @@ -1242,11 +1156,11 @@ physical_plan [ "#0", "#1", "#2", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)", - "__internal_compress_integral_utinyint(#5, 0)" + "CAST(#3 AS TINYINT)", + "CAST(#4 AS TINYINT)", + "CAST(#5 AS TINYINT)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277160" } } ], @@ -1259,7 +1173,7 @@ physical_plan [ "t_class", "lochierarchy" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277160" } } ], @@ -1273,7 +1187,7 @@ physical_plan [ "#5" ], "Aggregates": "", - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277160" } } ], @@ -1282,11 +1196,11 @@ physical_plan [ "#0", "#1", "#2", - "__internal_decompress_integral_integer(#3, 0)", - "__internal_decompress_integral_integer(#4, 0)", - "__internal_decompress_integral_integer(#5, 0)" + "CAST(#3 AS INTEGER)", + "CAST(#4 AS INTEGER)", + "CAST(#5 AS INTEGER)" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], @@ -1298,12 +1212,13 @@ physical_plan [ "#4", "#5" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = 0)) THEN (i_category) ELSE NULL END ORDER BY gross_margin ASC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY lochierarchy, CASE WHEN ((t_class = 0)) THEN (i_category) ELSE NULL::VARCHAR END ORDER BY gross_margin ASC NULLS LAST)", + "Estimated Cardinality": "277159" } } ], @@ -1316,7 +1231,7 @@ physical_plan [ "#4", "#5" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], @@ -1327,19 +1242,20 @@ physical_plan [ "i_class", "lochierarchy", "rank_within_parent", - "CASE WHEN ((lochierarchy = 0)) THEN (i_category) ELSE NULL END" + "CASE WHEN ((lochierarchy = 0)) THEN (i_category) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "57676" + "Estimated Cardinality": "277159" } } ], "extra_info": { "Top": "100", "Order By": [ - "results_rollup.lochierarchy DESC", + "lochierarchy DESC", "#5 ASC", - "rank() OVER (PARTITION BY results_rollup.lochierarchy, CASE WHEN ((results_rollup.t_class = 0)) THEN (results_rollup.i_category) ELSE NULL END ORDER BY results_rollup.gross_margin ASC) ASC" - ] + "rank_within_parent ASC" + ], + "Estimated Cardinality": "100" } } ], @@ -1358,6 +1274,7 @@ physical_plan [ "extra_info": { "CTE Name": "results", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q37.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q37.slt.no index e8f28d31eff..edaa7ecc255 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q37.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q37.slt.no @@ -259,7 +259,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.item.i_item_id" + "Order By": "i_item_id" } } ], @@ -276,160 +276,89 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "cs_item_sk", - "Estimated Cardinality": "143657" + "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", + "Function": "Vortex Scan", + "Estimated Cardinality": "46980" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", - "Function": "Vortex Scan", - "Estimated Cardinality": "46980" - } - } - ], - "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk" - ], - "Estimated Cardinality": "46980" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-02-01 <= $.d_date <= 2000-04-01)", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "46980" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([677i64, 940i64, 694i64, 808i64], $.i_manufact_id, opts=sql_null_semantics)", - "(decimal128(6800, precision=7, scale=2) <= $.i_current_price <= decimal128(9800, precision=7, scale=2))" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price" - ], - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_item_sk = i_item_sk)", - "Estimated Cardinality": "46980" + "Filters": [ + "vortex.list.contains([677i64, 940i64, 694i64, 808i64], $.i_manufact_id, opts=sql_null_semantics)", + "(decimal128(6800, precision=7, scale=2) <= $.i_current_price <= decimal128(9800, precision=7, scale=2))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "18747238" + "Conditions": "(inv_item_sk = i_item_sk)", + "Estimated Cardinality": "9396" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-02-01 <= $.d_date <= 2000-04-01)", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "18747238" + "Join Type": "INNER", + "Conditions": "(inv_date_sk = d_date_sk)", + "Estimated Cardinality": "9396" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "i_current_price" - ], - "Expressions": "", - "Estimated Cardinality": "15129981" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "749889" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" + "Groups": [ + "i_item_id", + "i_item_desc", + "i_current_price" ], - "Estimated Cardinality": "15129981" + "Expressions": "", + "Estimated Cardinality": "743251" } } ], @@ -439,7 +368,7 @@ logical_opt [ "i_item_desc", "i_current_price" ], - "Estimated Cardinality": "15129981" + "Estimated Cardinality": "743251" } } ], @@ -460,56 +389,33 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "cs_item_sk", + "Estimated Cardinality": "143657" + } + }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "cs_item_sk", - "Estimated Cardinality": "143657" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", - "Projections": [ - "inv_date_sk", - "inv_item_sk" - ], - "Estimated Cardinality": "46980" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-02-01 <= $.d_date <= 2000-04-01)", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "inv_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", + "Projections": [ + "inv_date_sk", + "inv_item_sk" + ], "Estimated Cardinality": "46980" } }, @@ -535,25 +441,34 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "inv_item_sk = i_item_sk", - "Estimated Cardinality": "46980" + "Estimated Cardinality": "9396" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-02-01 <= $.d_date <= 2000-04-01)", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "18747238" + "Conditions": "inv_date_sk = d_date_sk", + "Estimated Cardinality": "9396" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "18747238" + "Join Type": "INNER", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "749889" } } ], @@ -563,7 +478,7 @@ physical_plan [ "i_item_desc", "i_current_price" ], - "Estimated Cardinality": "18747238" + "Estimated Cardinality": "749889" } } ], @@ -574,13 +489,14 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "15129981" + "Estimated Cardinality": "743251" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.item.i_item_id ASC" + "Order By": "i_item_id ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q38.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q38.slt.no index fb3a9058423..c4f123ac825 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q38.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q38.slt.no @@ -650,282 +650,260 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "LIMIT", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "DISTINCT", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { "name": "INTERSECT", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { - "name": "INTERSECT", + "name": "DISTINCT", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "INTERSECT", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_customer_sk = c_customer_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", + "c_last_name", + "c_first_name", "d_date" ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Expressions": "", + "Estimated Cardinality": "288463", + "Distinct Targets": [ + "c_last_name", "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" + "d_date" + ] } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "288463" } - } - ], - "extra_info": { - "Expressions": [ - "c_last_name", - "c_first_name", - "d_date" - ], - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "288464", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] - } - }, - { - "name": "DISTINCT", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", + "c_last_name", + "c_first_name", "d_date" ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Expressions": "", + "Estimated Cardinality": "143656", + "Distinct Targets": [ + "c_last_name", "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" + "d_date" + ] } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "143657" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "143656" } } ], "extra_info": { - "Expressions": [ - "c_last_name", - "c_first_name", - "d_date" - ], - "Estimated Cardinality": "143657" + "Expressions": "", + "Estimated Cardinality": "143656" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "143657", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "143656" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655", + "Distinct Targets": [ + "c_last_name", + "c_first_name", + "d_date" + ] } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "143657", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "143655" } }, { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -935,124 +913,105 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Expressions": [ + "c_last_name", + "c_first_name", + "d_date" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ + "Expressions": "", + "Estimated Cardinality": "71631", + "Distinct Targets": [ "c_last_name", "c_first_name", "d_date" - ], - "Estimated Cardinality": "71632" + ] } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "71632", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "71631" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "71632", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "", + "Estimated Cardinality": "71630", + "Distinct Targets": [ + "c_last_name", + "c_first_name", + "d_date" + ] } } ], "extra_info": { - "Expressions": "" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -1064,82 +1023,56 @@ logical_opt [ ] physical_plan [ { - "name": "STREAMING_LIMIT", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk" + ], "Estimated Cardinality": "288464" } }, @@ -1162,14 +1095,27 @@ physical_plan [ "Conditions": "ss_customer_sk = c_customer_sk", "Estimated Cardinality": "288464" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_date" + ], + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "c_last_name", - "c_first_name", - "d_date" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } } @@ -1185,62 +1131,49 @@ physical_plan [ } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Projections": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Aggregates": "", "Estimated Cardinality": "288464" } - }, + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "", + "Estimated Cardinality": "288464" + } + }, + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk" + ], "Estimated Cardinality": "143657" } }, @@ -1263,14 +1196,27 @@ physical_plan [ "Conditions": "cs_bill_customer_sk = c_customer_sk", "Estimated Cardinality": "143657" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": [ + "d_date_sk", + "d_date" + ], + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "c_last_name", - "c_first_name", - "d_date" - ], + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", "Estimated Cardinality": "143657" } } @@ -1286,105 +1232,92 @@ physical_plan [ } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Projections": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Aggregates": "", "Estimated Cardinality": "143657" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": [ - "#0 IS NOT DISTINCT FROM #0", - "#1 IS NOT DISTINCT FROM #1", - "#2 IS NOT DISTINCT FROM #2" + "Groups": [ + "#0", + "#1", + "#2" ], + "Aggregates": "", "Estimated Cardinality": "143657" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Join Type": "SEMI", + "Conditions": [ + "#0 IS NOT DISTINCT FROM #0", + "#1 IS NOT DISTINCT FROM #1", + "#2 IS NOT DISTINCT FROM #2" ], - "Aggregates": "", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143656" } } ], "extra_info": { - "Projections": [ - "c_last_name", - "c_first_name", - "d_date" + "Groups": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "143657" + "Aggregates": "", + "Estimated Cardinality": "143656" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Projections": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Aggregates": "", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143656" } - }, + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "", + "Estimated Cardinality": "143656" + } + }, + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk" + ], "Estimated Cardinality": "71632" } }, @@ -1407,14 +1340,27 @@ physical_plan [ "Conditions": "ws_bill_customer_sk = c_customer_sk", "Estimated Cardinality": "71632" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_date" + ], + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "c_last_name", - "c_first_name", - "d_date" - ], + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", "Estimated Cardinality": "71632" } } @@ -1430,64 +1376,72 @@ physical_plan [ } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Projections": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Aggregates": "", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": [ - "#0 IS NOT DISTINCT FROM #0", - "#1 IS NOT DISTINCT FROM #1", - "#2 IS NOT DISTINCT FROM #2" + "Groups": [ + "#0", + "#1", + "#2" ], + "Aggregates": "", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Join Type": "SEMI", + "Conditions": [ + "#0 IS NOT DISTINCT FROM #0", + "#1 IS NOT DISTINCT FROM #1", + "#2 IS NOT DISTINCT FROM #2" ], - "Aggregates": "", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Projections": [ - "c_last_name", - "c_first_name", - "d_date" + "Groups": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "71632" + "Aggregates": "", + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2" + "Projections": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Aggregates": "", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Aggregates": "count_star()" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "", + "Estimated Cardinality": "71631" } } ], - "extra_info": {} + "extra_info": { + "Aggregates": "count_star()", + "Estimated Cardinality": "1" + } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q39.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q39.slt.no index 0b0bd9ab9a0..3cdbfa58d33 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q39.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q39.slt.no @@ -355,14 +355,14 @@ logical_plan [ ], "extra_info": { "Order By": [ - "inv1.w_warehouse_sk", - "inv1.i_item_sk", - "inv1.d_moy", - "inv1.mean", - "inv1.cov", - "inv2.d_moy", - "inv2.mean", - "inv2.cov" + "wsk1", + "isk1", + "dmoy1", + "mean1", + "cov1", + "d_moy", + "mean", + "cov" ] } } @@ -408,75 +408,36 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "234900" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk", - "inv_warehouse_sk", - "inv_quantity_on_hand" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "234900" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(($.d_moy = 1i64) or ($.d_moy = 2i64))", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_moy" - ], - "Estimated Cardinality": "2921" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "46967" + "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "234900" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "i_item_sk", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -484,47 +445,39 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(inv_item_sk = i_item_sk)", - "Estimated Cardinality": "46967" + "Estimated Cardinality": "234900" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name" + "Filters": [ + "($.d_year = 2001i64)", + "(($.d_moy = 1i64) or ($.d_moy = 2i64))", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" ], - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", - "Estimated Cardinality": "46967" + "Conditions": "(inv_date_sk = d_date_sk)", + "Estimated Cardinality": "234900" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_utinyint(#3, 1)", - "#4" + "#3", + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "46967" + "Estimated Cardinality": "234900" } } ], @@ -539,20 +492,20 @@ logical_opt [ "stddev_samp(CAST(inv_quantity_on_hand AS DOUBLE))", "avg(inv_quantity_on_hand)" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4", "#5" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], @@ -564,13 +517,13 @@ logical_opt [ "stdev", "mean" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], "extra_info": { "Expressions": "(CASE WHEN ((mean = 0.0)) THEN (0.0) ELSE (stdev / mean) END > 1.0)", - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], @@ -582,7 +535,7 @@ logical_opt [ "mean", "cov" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], @@ -593,99 +546,160 @@ logical_opt [ "#2", "#3", "#4" - ] + ], + "Estimated Cardinality": "18519" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "ORDER_BY", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "46636" - } - } - ], - "extra_info": { - "Expressions": "(d_moy = 1)", - "Estimated Cardinality": "46636" - } - }, - { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "18519" + } + } + ], + "extra_info": { + "Expressions": "(d_moy = 1)", + "Estimated Cardinality": "18519" + } + }, + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "18519" + } + } + ], + "extra_info": { + "Expressions": "(d_moy = 2)", + "Estimated Cardinality": "18519" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(i_item_sk = i_item_sk)", + "(w_warehouse_sk = w_warehouse_sk)" + ], + "Estimated Cardinality": "190529" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "46636" + "Expressions": [ + "wsk1", + "isk1", + "dmoy1", + "mean1", + "cov1", + "w_warehouse_sk", + "i_item_sk", + "d_moy", + "mean", + "cov" + ], + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Expressions": "(d_moy = 2)", - "Estimated Cardinality": "46636" + "Expressions": [ + "CAST(#0 AS TINYINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS TINYINT)", + "#3", + "#4", + "CAST(#5 AS TINYINT)", + "CAST(#6 AS SMALLINT)", + "CAST(#7 AS TINYINT)", + "#8", + "#9" + ], + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_item_sk = i_item_sk)", - "(w_warehouse_sk = w_warehouse_sk)" + "Order By": [ + "wsk1", + "isk1", + "dmoy1", + "mean1", + "cov1", + "d_moy", + "mean", + "cov" ], - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ], "extra_info": { "Expressions": [ - "wsk1", - "isk1", - "dmoy1", - "mean1", - "cov1", - "w_warehouse_sk", - "i_item_sk", - "d_moy", - "mean", - "cov" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "CAST(#7 AS BIGINT)", + "#8", + "#9" ], - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Order By": [ - "inv1.w_warehouse_sk", - "inv1.i_item_sk", - "inv1.d_moy", - "inv1.mean", - "inv1.cov", - "inv2.d_moy", - "inv2.mean", - "inv2.cov" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" ], - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ], "extra_info": { "CTE Name": "inv", "Table Index": "0", - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ] @@ -742,19 +756,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", "Projections": [ - "d_date_sk", - "d_moy" + "w_warehouse_sk", + "w_warehouse_name" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "inv_date_sk = d_date_sk", - "Estimated Cardinality": "46967" + "Conditions": "inv_warehouse_sk = w_warehouse_sk", + "Estimated Cardinality": "234900" } }, { @@ -770,7 +783,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "inv_item_sk = i_item_sk", - "Estimated Cardinality": "46967" + "Estimated Cardinality": "234900" } }, { @@ -778,30 +791,35 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "(($.d_moy = 1i64) or ($.d_moy = 2i64))", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], "Projections": [ - "w_warehouse_sk", - "w_warehouse_name" + "d_date_sk", + "d_moy" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "inv_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "46967" + "Conditions": "inv_date_sk = d_date_sk", + "Estimated Cardinality": "234900" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_utinyint(#3, 1)", - "#4" + "#3", + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "46967" + "Estimated Cardinality": "234900" } } ], @@ -814,7 +832,7 @@ physical_plan [ "CAST(inv_quantity_on_hand AS DOUBLE)", "inv_quantity_on_hand" ], - "Estimated Cardinality": "46967" + "Estimated Cardinality": "234900" } } ], @@ -829,20 +847,20 @@ physical_plan [ "stddev_samp(#4)", "avg(#5)" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4", "#5" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], @@ -854,13 +872,13 @@ physical_plan [ "stdev", "mean" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], "extra_info": { "Expression": "(CASE WHEN ((mean = 0.0)) THEN (0.0) ELSE (stdev / mean) END > 1.0)", - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } } ], @@ -872,98 +890,140 @@ physical_plan [ "mean", "cov" ], - "Estimated Cardinality": "46636" + "Estimated Cardinality": "18519" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "46636" - } - } - ], - "extra_info": { - "Expression": "(d_moy = 1)", - "Estimated Cardinality": "46636" - } - }, - { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "18519" + } + } + ], + "extra_info": { + "Expression": "(d_moy = 1)", + "Estimated Cardinality": "18519" + } + }, + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "18519" + } + } + ], + "extra_info": { + "Expression": "(d_moy = 2)", + "Estimated Cardinality": "18519" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "46636" + "Join Type": "INNER", + "Conditions": [ + "i_item_sk = i_item_sk", + "w_warehouse_sk = w_warehouse_sk" + ], + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Expression": "(d_moy = 2)", - "Estimated Cardinality": "46636" + "Projections": [ + "wsk1", + "isk1", + "dmoy1", + "mean1", + "cov1", + "w_warehouse_sk", + "i_item_sk", + "d_moy", + "mean", + "cov" + ], + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_item_sk = i_item_sk", - "w_warehouse_sk = w_warehouse_sk" + "Projections": [ + "CAST(#0 AS TINYINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS TINYINT)", + "#3", + "#4", + "CAST(#5 AS TINYINT)", + "CAST(#6 AS SMALLINT)", + "CAST(#7 AS TINYINT)", + "#8", + "#9" ], - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Projections": [ - "wsk1", - "isk1", - "dmoy1", - "mean1", - "cov1", - "w_warehouse_sk", - "i_item_sk", - "d_moy", - "mean", - "cov" + "Order By": [ + "wsk1 ASC", + "isk1 ASC", + "dmoy1 ASC", + "mean1 ASC", + "cov1 ASC", + "d_moy ASC", + "mean ASC", + "cov ASC" ], - "Estimated Cardinality": "9258" + "Estimated Cardinality": "190529" } } ], "extra_info": { - "Order By": [ - "inv1.w_warehouse_sk ASC", - "inv1.i_item_sk ASC", - "inv1.d_moy ASC", - "inv1.mean ASC", - "inv1.cov ASC", - "inv2.d_moy ASC", - "inv2.mean ASC", - "inv2.cov ASC" - ] + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "CAST(#7 AS BIGINT)", + "#8", + "#9" + ], + "Estimated Cardinality": "190529" } } ], "extra_info": { "CTE Name": "inv", "Table Index": "0", - "Estimated Cardinality": "9258" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "190529" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q4.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q4.slt.no index 02c7d53aef0..64b699118ca 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q4.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q4.slt.no @@ -844,10 +844,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "t_s_secyear.customer_id", - "t_s_secyear.customer_first_name", - "t_s_secyear.customer_last_name", - "t_s_secyear.customer_preferred_cust_flag" + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ] } } @@ -871,119 +871,181 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#5" + ], + "Expressions": "sum((CAST((CAST(((ss_ext_list_price - ss_ext_wholesale_cost) - ss_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ss_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_discount_amt", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_ext_list_price" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], "Estimated Cardinality": "288464" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Groups": [ "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", - "c_email_address" + "c_email_address", + "#0" ], - "Estimated Cardinality": "10000" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" + ], "Estimated Cardinality": "288464" } } @@ -994,195 +1056,233 @@ logical_opt [ "#1", "#2", "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#4", + "finalize(#5)" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year" + "Expressions": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Expressions": "sum((CAST((CAST(((ss_ext_list_price - ss_ext_wholesale_cost) - ss_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ss_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0))", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "(sale_type = 's')", + "(((dyear = 2002) AND (sale_type = 's')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 's'))))" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "57692" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag", + "dyear", + "year_total", + "sale_type" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag", - "dyear", - "year_total", - "sale_type" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#5" + ], + "Expressions": "sum((CAST((CAST(((cs_ext_list_price - cs_ext_wholesale_cost) - cs_ext_discount_amt) AS DECIMAL(10,2)) + CAST(cs_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)) EXPORT_STATE", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_ext_discount_amt", - "cs_ext_sales_price", - "cs_ext_wholesale_cost", - "cs_ext_list_price" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], "Estimated Cardinality": "143657" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Groups": [ "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", - "c_email_address" + "c_email_address", + "#0" ], - "Estimated Cardinality": "10000" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" + ], "Estimated Cardinality": "143657" } } @@ -1193,195 +1293,233 @@ logical_opt [ "#1", "#2", "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#4", + "finalize(#5)" ], "Estimated Cardinality": "143657" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year" + "Expressions": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Expressions": "sum((CAST((CAST(((cs_ext_list_price - cs_ext_wholesale_cost) - cs_ext_discount_amt) AS DECIMAL(10,2)) + CAST(cs_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0))", "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "(sale_type = 'c')", + "(((dyear = 2002) AND (sale_type = 'c')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 'c'))))" ], "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "28731" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag", + "dyear", + "year_total", + "sale_type" + ], + "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag", - "dyear", - "year_total", - "sale_type" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "28731" + "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#5" + ], + "Expressions": "sum((CAST((CAST(((ws_ext_list_price - ws_ext_wholesale_cost) - ws_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ws_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)) EXPORT_STATE", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_ext_discount_amt", - "ws_ext_sales_price", - "ws_ext_wholesale_cost", - "ws_ext_list_price" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], "Estimated Cardinality": "71632" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Expressions": [ - "c_customer_sk", + "Groups": [ "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", - "c_email_address" + "c_email_address", + "#0" ], - "Estimated Cardinality": "10000" + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" + ], "Estimated Cardinality": "71632" } } @@ -1392,88 +1530,81 @@ logical_opt [ "#1", "#2", "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#4", + "finalize(#5)" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year" + "Expressions": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" ], - "Expressions": "sum((CAST((CAST(((ws_ext_list_price - ws_ext_wholesale_cost) - ws_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ws_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0))", "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "(sale_type = 'w')", + "(((dyear = 2002) AND (sale_type = 'w')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 'w'))))" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "14326" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag", + "dyear", + "year_total", + "sale_type" + ], + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag", - "dyear", - "year_total", - "sale_type" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "14326" + "Expressions": "", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "100749" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Estimated Cardinality": "503753" } } ], @@ -1486,20 +1617,21 @@ logical_opt [ "#4", "#5", "#6" - ] + ], + "Estimated Cardinality": "503753" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -1508,113 +1640,84 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expressions": [ - "(dyear = 2002)", - "(sale_type = 's')" - ], - "Estimated Cardinality": "100749" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "(dyear = 2002)", - "(sale_type = 'c')" - ], - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "1015036" + "Expressions": [ + "(dyear = 2002)", + "(sale_type = 's')" + ], + "Estimated Cardinality": "503753" } }, { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "(dyear = 2001)", - "(year_total > 0.0)", - "(sale_type = 'w')" - ], - "Estimated Cardinality": "100749" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expressions": [ - "(dyear = 2002)", - "(sale_type = 'w')" - ], - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "1015036" + "Expressions": [ + "(dyear = 2001)", + "(year_total > 0.0)", + "(sale_type = 'c')" + ], + "Estimated Cardinality": "503753" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "103029828" + "Estimated Cardinality": "25376708" } }, + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Expressions": [ + "(dyear = 2001)", + "(year_total > 0.0)", + "(sale_type = 's')" + ], + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(customer_id = customer_id)", + "Estimated Cardinality": "1278359303" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ { "name": "COMPARISON_JOIN", "children": [ @@ -1626,7 +1729,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "100749" + "Estimated Cardinality": "503753" } } ], @@ -1634,9 +1737,9 @@ logical_opt [ "Expressions": [ "(dyear = 2001)", "(year_total > 0.0)", - "(sale_type = 's')" + "(sale_type = 'w')" ], - "Estimated Cardinality": "100749" + "Estimated Cardinality": "503753" } }, { @@ -1647,62 +1750,87 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "100749" + "Estimated Cardinality": "503753" } } ], "extra_info": { "Expressions": [ - "(dyear = 2001)", - "(year_total > 0.0)", - "(sale_type = 'c')" + "(dyear = 2002)", + "(sale_type = 'w')" ], - "Estimated Cardinality": "100749" + "Estimated Cardinality": "503753" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "1015036" + "Estimated Cardinality": "25376708" + } + }, + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Expressions": [ + "(dyear = 2002)", + "(sale_type = 'c')" + ], + "Estimated Cardinality": "503753" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "18446744073709551615" + "Estimated Cardinality": "1278359303" } } ], "extra_info": { - "Expressions": [ - "(CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END)", - "(CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END)" + "Join Type": "INNER", + "Conditions": [ + "(customer_id = customer_id)", + "((CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END) AND (CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END))" ], - "Estimated Cardinality": "18446744073709551615" + "Estimated Cardinality": "857400458107306" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "18446744073709551615" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "857400458107306" } } ], "extra_info": { - "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name", - "customer_preferred_cust_flag" - ], - "Estimated Cardinality": "18446744073709551615" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "100" } } @@ -1725,41 +1853,134 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_ext_discount_amt", + "ss_ext_sales_price", + "ss_ext_wholesale_cost", + "ss_ext_list_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5", + "(CAST((CAST(((ss_ext_list_price - ss_ext_wholesale_cost) - ss_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ss_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_discount_amt", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_ext_list_price" + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" ], "Estimated Cardinality": "288464" } @@ -1769,97 +1990,84 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_year" + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address" - ], - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", + "Projections": [ + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address", "#0", - "#1", - "#2", - "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#1" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year", - "(CAST((CAST(((ss_ext_list_price - ss_ext_wholesale_cost) - ss_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ss_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], + "Aggregates": "combine_aggr(#8)", "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", "#3", - "#4", - "#5", - "#6", - "#7" + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" ], - "Aggregates": "sum(#8)", "Estimated Cardinality": "288464" } } @@ -1871,31 +2079,29 @@ physical_plan [ "#2", "#3", "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "finalize(#5)" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expression": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "57692" + "Projections": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#7", - "#8" - ], - "Estimated Cardinality": "57692" + "Expression": "((sale_type = 's') AND (((dyear = 2002) AND (sale_type = 's')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 's')))))", + "Estimated Cardinality": "288464" } } ], @@ -1909,48 +2115,141 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_ext_discount_amt", + "cs_ext_sales_price", + "cs_ext_wholesale_cost", + "cs_ext_list_price" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5", + "(CAST((CAST(((cs_ext_list_price - cs_ext_wholesale_cost) - cs_ext_discount_amt) AS DECIMAL(10,2)) + CAST(cs_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + ], + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_ext_discount_amt", - "cs_ext_sales_price", - "cs_ext_wholesale_cost", - "cs_ext_list_price" + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" ], "Estimated Cardinality": "143657" } @@ -1960,97 +2259,84 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], "Projections": [ - "d_date_sk", - "d_year" + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "143657" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address" - ], - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_bill_customer_sk = c_customer_sk", + "Projections": [ + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], "Estimated Cardinality": "143657" } } ], "extra_info": { "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address", "#0", - "#1", - "#2", - "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#1" ], "Estimated Cardinality": "143657" } } ], "extra_info": { - "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year", - "(CAST((CAST(((cs_ext_list_price - cs_ext_wholesale_cost) - cs_ext_discount_amt) AS DECIMAL(10,2)) + CAST(cs_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], + "Aggregates": "combine_aggr(#8)", "Estimated Cardinality": "143657" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", "#3", - "#4", - "#5", - "#6", - "#7" + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" ], - "Aggregates": "sum(#8)", "Estimated Cardinality": "143657" } } @@ -2062,31 +2348,29 @@ physical_plan [ "#2", "#3", "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "finalize(#5)" ], "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expression": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "28731" + "Projections": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#7", - "#8" - ], - "Estimated Cardinality": "28731" + "Expression": "((sale_type = 'c') AND (((dyear = 2002) AND (sale_type = 'c')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 'c')))))", + "Estimated Cardinality": "143657" } } ], @@ -2100,48 +2384,141 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "28731" + "Estimated Cardinality": "143657" } }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk", + "ws_ext_discount_amt", + "ws_ext_sales_price", + "ws_ext_wholesale_cost", + "ws_ext_list_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5", + "(CAST((CAST(((ws_ext_list_price - ws_ext_wholesale_cost) - ws_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ws_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_ext_discount_amt", - "ws_ext_sales_price", - "ws_ext_wholesale_cost", - "ws_ext_list_price" + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" ], "Estimated Cardinality": "71632" } @@ -2151,97 +2528,84 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_year" + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address" - ], - "Estimated Cardinality": "10000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Projections": [ + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag", + "c_birth_country", + "c_login", + "c_email_address", "#0", - "#1", - "#2", - "#3", - "__internal_compress_integral_utinyint(#4, 1900)", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11" + "#1" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag", - "c_birth_country", - "c_login", - "c_email_address", - "d_year", - "(CAST((CAST(((ws_ext_list_price - ws_ext_wholesale_cost) - ws_ext_discount_amt) AS DECIMAL(10,2)) + CAST(ws_ext_sales_price AS DECIMAL(10,2))) AS DOUBLE) / 2.0)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], + "Aggregates": "combine_aggr(#8)", "Estimated Cardinality": "71632" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", "#3", - "#4", - "#5", - "#6", - "#7" + "__internal_decompress_integral_bigint(#7, 1900)", + "#8" ], - "Aggregates": "sum(#8)", "Estimated Cardinality": "71632" } } @@ -2253,31 +2617,29 @@ physical_plan [ "#2", "#3", "#4", - "#5", - "#6", - "__internal_decompress_integral_bigint(#7, 1900)", - "#8" + "finalize(#5)" ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expression": "((dyear = 2002) OR ((dyear = 2001) AND (year_total > 0.0)))", - "Estimated Cardinality": "14326" + "Projections": [ + "dyear", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name", + "customer_preferred_cust_flag" + ], + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#7", - "#8" - ], - "Estimated Cardinality": "14326" + "Expression": "((sale_type = 'w') AND (((dyear = 2002) AND (sale_type = 'w')) OR ((year_total > 0.0) AND ((dyear = 2001) AND (sale_type = 'w')))))", + "Estimated Cardinality": "71632" } } ], @@ -2291,7 +2653,7 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71632" } } ], @@ -2304,253 +2666,233 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expression": "((dyear = 2002) AND (sale_type = 's'))", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#5" - ], - "Estimated Cardinality": "100749" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expression": "((dyear = 2002) AND (sale_type = 'c'))", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "#0", - "#5" - ], - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "1015036" + "Expression": "((dyear = 2002) AND (sale_type = 's'))", + "Estimated Cardinality": "503753" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#5" + ], + "Estimated Cardinality": "503753" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 'w'))", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Projections": [ - "#0", - "#5" - ], - "Estimated Cardinality": "100749" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], - "extra_info": { - "Expression": "((dyear = 2002) AND (sale_type = 'w'))", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "#0", - "#5" - ], - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "1015036" + "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 'c'))", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "103029828" + "Projections": [ + "#0", + "#5" + ], + "Estimated Cardinality": "503753" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "customer_id = customer_id", + "Estimated Cardinality": "25376708" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 's'))", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5" + ], + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "customer_id = customer_id", + "Estimated Cardinality": "1278359303" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 's'))", - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Projections": [ - "#0", - "#5" - ], - "Estimated Cardinality": "100749" + "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 'w'))", + "Estimated Cardinality": "503753" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5" + ], + "Estimated Cardinality": "503753" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "100749" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expression": "((dyear = 2001) AND (year_total > 0.0) AND (sale_type = 'c'))", - "Estimated Cardinality": "100749" + "CTE Index": "0", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Projections": [ - "#0", - "#5" - ], - "Estimated Cardinality": "100749" + "Expression": "((dyear = 2002) AND (sale_type = 'w'))", + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "1015036" + "Projections": [ + "#0", + "#5" + ], + "Estimated Cardinality": "503753" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "18446744073709551615" + "Estimated Cardinality": "25376708" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Expression": "((dyear = 2002) AND (sale_type = 'c'))", + "Estimated Cardinality": "503753" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#5" + ], + "Estimated Cardinality": "503753" } } ], "extra_info": { - "Expression": "((CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END) AND (CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL END))", - "Estimated Cardinality": "18446744073709551615" + "Join Type": "INNER", + "Conditions": "customer_id = customer_id", + "Estimated Cardinality": "1278359303" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#7" + "Join Type": "INNER", + "Conditions": [ + "customer_id = customer_id", + "((CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END) AND (CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END > CASE WHEN ((year_total > 0.0)) THEN ((year_total / year_total)) ELSE NULL::DOUBLE END))" ], - "Estimated Cardinality": "18446744073709551615" + "Estimated Cardinality": "857400458107306" } } ], @@ -2561,24 +2903,26 @@ physical_plan [ "customer_last_name", "customer_preferred_cust_flag" ], - "Estimated Cardinality": "18446744073709551615" + "Estimated Cardinality": "857400458107306" } } ], "extra_info": { "Top": "100", "Order By": [ - "t_s_secyear.customer_id ASC", - "t_s_secyear.customer_first_name ASC", - "t_s_secyear.customer_last_name ASC", - "t_s_secyear.customer_preferred_cust_flag ASC" - ] + "customer_id ASC", + "customer_first_name ASC", + "customer_last_name ASC", + "customer_preferred_cust_flag ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "year_total", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q40.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q40.slt.no index 9caa861c0af..d7e52f0fe72 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q40.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q40.slt.no @@ -329,8 +329,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.warehouse.w_state", - "memory.main.item.i_item_id" + "w_state", + "i_item_id" ] } } @@ -363,138 +363,74 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_warehouse_sk", - "cs_item_sk", - "cs_order_number", - "cs_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number", - "cr_refunded_cash" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(cs_order_number = cr_order_number)", - "(cs_item_sk = cr_item_sk)" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_state" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_warehouse_sk = w_warehouse_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "360" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(cs_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(2000-02-10 <= $.d_date <= 2000-04-10)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" + "Join Type": "LEFT", + "Conditions": [ + "(cs_order_number = cr_order_number)", + "(cs_item_sk = cr_item_sk)" ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-02-10 <= $.d_date <= 2000-04-10)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -502,7 +438,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28731" } } ], @@ -515,7 +451,7 @@ logical_opt [ "sum(CASE WHEN ((d_date < '2000-03-11'::DATE)) THEN ((CAST(cs_sales_price AS DECIMAL(13,2)) - COALESCE(CAST(cr_refunded_cash AS DECIMAL(12,2)), 0.00))) ELSE 0.00 END)", "sum(CASE WHEN ((d_date >= '2000-03-11'::DATE)) THEN ((CAST(cs_sales_price AS DECIMAL(13,2)) - COALESCE(CAST(cr_refunded_cash AS DECIMAL(12,2)), 0.00))) ELSE 0.00 END)" ], - "Estimated Cardinality": "143656" + "Estimated Cardinality": "342" } } ], @@ -526,7 +462,7 @@ logical_opt [ "sales_before", "sales_after" ], - "Estimated Cardinality": "143656" + "Estimated Cardinality": "342" } } ], @@ -578,22 +514,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", "Projections": [ - "cr_item_sk", - "cr_order_number", - "cr_refunded_cash" + "i_item_sk", + "i_item_id" ], - "Estimated Cardinality": "14275" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "cs_order_number = cr_order_number", - "cs_item_sk = cr_item_sk" - ], - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" } }, { @@ -612,7 +545,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "cs_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28731" } }, { @@ -620,19 +553,22 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(decimal128(99, precision=7, scale=2) <= $.i_current_price <= decimal128(149, precision=7, scale=2))", "Projections": [ - "i_item_sk", - "i_item_id" + "cr_item_sk", + "cr_order_number", + "cr_refunded_cash" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "143657" + "Join Type": "LEFT", + "Conditions": [ + "cs_order_number = cr_order_number", + "cs_item_sk = cr_item_sk" + ], + "Estimated Cardinality": "28731" } }, { @@ -655,7 +591,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28731" } } ], @@ -666,7 +602,7 @@ physical_plan [ "CASE WHEN ((d_date < '2000-03-11'::DATE)) THEN ((CAST(cs_sales_price AS DECIMAL(13,2)) - COALESCE(CAST(cr_refunded_cash AS DECIMAL(12,2)), 0.00))) ELSE 0.00 END", "CASE WHEN ((d_date >= '2000-03-11'::DATE)) THEN ((CAST(cs_sales_price AS DECIMAL(13,2)) - COALESCE(CAST(cr_refunded_cash AS DECIMAL(12,2)), 0.00))) ELSE 0.00 END" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "28731" } } ], @@ -679,16 +615,17 @@ physical_plan [ "sum(#2)", "sum(#3)" ], - "Estimated Cardinality": "143656" + "Estimated Cardinality": "342" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.warehouse.w_state ASC", - "memory.main.item.i_item_id ASC" - ] + "w_state ASC", + "i_item_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q41.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q41.slt.no index 86b3e4cb1d0..3f0a3b7bbda 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q41.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q41.slt.no @@ -194,8 +194,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -220,7 +219,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "i1.i_product_name" + "Order By": "i_product_name" } } ], @@ -240,128 +239,260 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(738i64 <= $.i_manufact_id <= 778i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Filters": "(738i64 <= $.i_manufact_id <= 778i64)", - "Function": "Vortex Scan", + "Expressions": [ + "i_manufact", + "i_product_name" + ], "Estimated Cardinality": "360" } } ], "extra_info": { "Expressions": [ - "i_manufact", - "i_product_name" + "#0", + "#1" ], "Estimated Cardinality": "360" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "360" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "DELIM_GET", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { + "Groups": "#[1.14]", "Expressions": "", - "Estimated Cardinality": "227" + "Estimated Cardinality": "180" } - }, + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "180" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "AGGREGATE", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "360" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "31", + "Estimated Cardinality": "180" + } + }, + { + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((((($.i_category = \"Women\") and (($.i_color = \"powder\") or ($.i_color = \"khaki\"))) and ((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) and ((($.i_units = \"Bunch\") or ($.i_units = \"Ton\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"floral\") or ($.i_color = \"deep\"))) and ((($.i_units = \"N/A\") or ($.i_units = \"Dozen\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) and ((($.i_units = \"Box\") or ($.i_units = \"Pound\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))) or ((((($.i_category = \"Women\") and (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) and ((($.i_units = \"Pallet\") or ($.i_units = \"Gross\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) and ((($.i_units = \"Cup\") or ($.i_units = \"Dram\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) and ((($.i_units = \"Each\") or ($.i_units = \"Tbl\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"forest\") or ($.i_color = \"ghost\"))) and ((($.i_units = \"Lb\") or ($.i_units = \"Bundle\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))))", + "(($.i_category = \"Women\") or ($.i_category = \"Men\"))", + "(((($.i_size = \"medium\") or ($.i_size = \"extra large\")) or (($.i_size = \"N/A\") or ($.i_size = \"small\"))) or ($.i_size = \"petite\"))", + "((((((((($.i_color = \"powder\") or ($.i_color = \"khaki\")) or (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) or (($.i_color = \"floral\") or ($.i_color = \"deep\"))) or (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) or (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) or (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) or (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) or (($.i_color = \"forest\") or ($.i_color = \"ghost\")))", + "((((((((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) or (($.i_units = \"Bunch\") or ($.i_units = \"Ton\"))) or (($.i_units = \"N/A\") or ($.i_units = \"Dozen\"))) or (($.i_units = \"Box\") or ($.i_units = \"Pound\"))) or (($.i_units = \"Pallet\") or ($.i_units = \"Gross\"))) or (($.i_units = \"Cup\") or ($.i_units = \"Dram\"))) or (($.i_units = \"Each\") or ($.i_units = \"Tbl\"))) or (($.i_units = \"Lb\") or ($.i_units = \"Bundle\")))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "31", + "Estimated Cardinality": "180" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(i_manufact = i_manufact)", + "Estimated Cardinality": "180" + } + } + ], + "extra_info": { + "Groups": "i_manufact", + "Expressions": "count_star()", + "Estimated Cardinality": "90" + } + } + ], + "extra_info": { + "Join Type": "LEFT", + "Conditions": "(i_manufact IS NOT DISTINCT FROM #0)", + "Estimated Cardinality": "180" + } + }, + { + "name": "AGGREGATE", + "children": [ + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "0" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "(((((($.i_category = \"Women\") and (($.i_color = \"powder\") or ($.i_color = \"khaki\"))) and ((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) and ((($.i_units = \"Bunch\") or ($.i_units = \"Ton\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"floral\") or ($.i_color = \"deep\"))) and ((($.i_units = \"N/A\") or ($.i_units = \"Dozen\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) and ((($.i_units = \"Box\") or ($.i_units = \"Pound\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))) or ((((($.i_category = \"Women\") and (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) and ((($.i_units = \"Pallet\") or ($.i_units = \"Gross\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) and ((($.i_units = \"Cup\") or ($.i_units = \"Dram\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) and ((($.i_units = \"Each\") or ($.i_units = \"Tbl\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"forest\") or ($.i_color = \"ghost\"))) and ((($.i_units = \"Lb\") or ($.i_units = \"Bundle\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))))", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" + "Join Type": "LEFT", + "Conditions": "", + "Estimated Cardinality": "180" } } ], "extra_info": { - "Expressions": "(i_manufact IS NOT NULL)", - "Estimated Cardinality": "72" + "Expressions": [ + "CASE WHEN ((#2 IS NULL)) THEN (#3) ELSE item_cnt END", + "i_manufact" + ], + "Estimated Cardinality": "180" } } ], "extra_info": { - "Expressions": "i_manufact", - "Estimated Cardinality": "72" + "Join Type": "SINGLE", + "Conditions": "(i_manufact IS NOT DISTINCT FROM i_manufact)", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Groups": "i_manufact", - "Expressions": "count_star()", - "Estimated Cardinality": "36" + "Expressions": "(SUBQUERY > 0)", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(i_manufact IS NOT DISTINCT FROM #0)", - "Estimated Cardinality": "227" + "Expressions": "#0", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((item_cnt IS NULL)) THEN (0) ELSE item_cnt END", - "i_manufact" - ], - "Estimated Cardinality": "227" + "CTE Name": "__duckdb_delim_dedup_31", + "Table Index": "31", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "(i_manufact IS NOT DISTINCT FROM i_manufact)" + "Expressions": "#0", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Expressions": "(SUBQUERY > 0)", - "Estimated Cardinality": "360" + "CTE Name": "__duckdb_delim_33", + "Table Index": "33", + "Estimated Cardinality": "72" } } ], "extra_info": { "Expressions": "i_product_name", - "Estimated Cardinality": "360" + "Estimated Cardinality": "72" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "360", + "Estimated Cardinality": "72", "Distinct Targets": "i_product_name" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "72" } } ] @@ -376,158 +507,224 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(738i64 <= $.i_manufact_id <= 778i64)", + "Projections": [ + "i_manufact", + "i_product_name" + ], + "Estimated Cardinality": "360" + } + }, + { + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(738i64 <= $.i_manufact_id <= 778i64)", - "Projections": [ - "i_manufact", - "i_product_name" - ], - "Estimated Cardinality": "360" - } - }, - { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "CTE Index": "33", + "Estimated Cardinality": "360" } - }, + } + ], + "extra_info": { + "Projections": "#[1.14]", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "180" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "360" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "227" - } - }, - { - "name": "HASH_GROUP_BY", + "name": "CROSS_PRODUCT", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "31", + "Estimated Cardinality": "180" + } + }, + { + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((((($.i_category = \"Women\") and (($.i_color = \"powder\") or ($.i_color = \"khaki\"))) and ((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) and ((($.i_units = \"Bunch\") or ($.i_units = \"Ton\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"floral\") or ($.i_color = \"deep\"))) and ((($.i_units = \"N/A\") or ($.i_units = \"Dozen\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) and ((($.i_units = \"Box\") or ($.i_units = \"Pound\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))) or ((((($.i_category = \"Women\") and (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) and ((($.i_units = \"Pallet\") or ($.i_units = \"Gross\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) and ((($.i_units = \"Cup\") or ($.i_units = \"Dram\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) and ((($.i_units = \"Each\") or ($.i_units = \"Tbl\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"forest\") or ($.i_color = \"ghost\"))) and ((($.i_units = \"Lb\") or ($.i_units = \"Bundle\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))))", + "(($.i_category = \"Women\") or ($.i_category = \"Men\"))", + "(((($.i_size = \"medium\") or ($.i_size = \"extra large\")) or (($.i_size = \"N/A\") or ($.i_size = \"small\"))) or ($.i_size = \"petite\"))", + "((((((((($.i_color = \"powder\") or ($.i_color = \"khaki\")) or (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) or (($.i_color = \"floral\") or ($.i_color = \"deep\"))) or (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) or (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) or (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) or (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) or (($.i_color = \"forest\") or ($.i_color = \"ghost\")))", + "((((((((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) or (($.i_units = \"Bunch\") or ($.i_units = \"Ton\"))) or (($.i_units = \"N/A\") or ($.i_units = \"Dozen\"))) or (($.i_units = \"Box\") or ($.i_units = \"Pound\"))) or (($.i_units = \"Pallet\") or ($.i_units = \"Gross\"))) or (($.i_units = \"Cup\") or ($.i_units = \"Dram\"))) or (($.i_units = \"Each\") or ($.i_units = \"Tbl\"))) or (($.i_units = \"Lb\") or ($.i_units = \"Bundle\")))" + ], + "Projections": "i_manufact", + "Estimated Cardinality": "360" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "31", + "Estimated Cardinality": "180" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "i_manufact = i_manufact", + "Estimated Cardinality": "180" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "(((((($.i_category = \"Women\") and (($.i_color = \"powder\") or ($.i_color = \"khaki\"))) and ((($.i_units = \"Ounce\") or ($.i_units = \"Oz\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"brown\") or ($.i_color = \"honeydew\"))) and ((($.i_units = \"Bunch\") or ($.i_units = \"Ton\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"floral\") or ($.i_color = \"deep\"))) and ((($.i_units = \"N/A\") or ($.i_units = \"Dozen\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"light\") or ($.i_color = \"cornflower\"))) and ((($.i_units = \"Box\") or ($.i_units = \"Pound\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))) or ((((($.i_category = \"Women\") and (($.i_color = \"midnight\") or ($.i_color = \"snow\"))) and ((($.i_units = \"Pallet\") or ($.i_units = \"Gross\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))) or ((($.i_category = \"Women\") and (($.i_color = \"cyan\") or ($.i_color = \"papaya\"))) and ((($.i_units = \"Cup\") or ($.i_units = \"Dram\")) and (($.i_size = \"N/A\") or ($.i_size = \"small\"))))) or (((($.i_category = \"Men\") and (($.i_color = \"orange\") or ($.i_color = \"frosted\"))) and ((($.i_units = \"Each\") or ($.i_units = \"Tbl\")) and ($.i_size = \"petite\"))) or ((($.i_category = \"Men\") and (($.i_color = \"forest\") or ($.i_color = \"ghost\"))) and ((($.i_units = \"Lb\") or ($.i_units = \"Bundle\")) and (($.i_size = \"medium\") or ($.i_size = \"extra large\")))))))", "Projections": "i_manufact", - "Estimated Cardinality": "360" + "Estimated Cardinality": "180" } } ], "extra_info": { - "Expression": "(i_manufact IS NOT NULL)", - "Estimated Cardinality": "72" + "Groups": "#0", + "Aggregates": "count_star()", + "Estimated Cardinality": "90" } } ], "extra_info": { - "Projections": "i_manufact", - "Estimated Cardinality": "72" + "Join Type": "LEFT", + "Conditions": "i_manufact IS NOT DISTINCT FROM #0", + "Estimated Cardinality": "180" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": {} + } + ], + "extra_info": { + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], - "extra_info": { - "Groups": "#0", - "Aggregates": "count_star()", - "Estimated Cardinality": "36" - } + "extra_info": {} } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_manufact IS NOT DISTINCT FROM #0", - "Estimated Cardinality": "227" + "Projections": [ + "CASE WHEN ((#2 IS NULL)) THEN (#3) ELSE item_cnt END", + "i_manufact" + ], + "Estimated Cardinality": "180" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((item_cnt IS NULL)) THEN (0) ELSE item_cnt END", - "i_manufact" - ], - "Estimated Cardinality": "227" + "Join Type": "SINGLE", + "Conditions": "i_manufact IS NOT DISTINCT FROM i_manufact", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "i_manufact IS NOT DISTINCT FROM i_manufact", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "227" + "Expression": "(SUBQUERY > 0)", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "i_manufact IS NOT DISTINCT FROM i_manufact", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Projections": "#0", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Expression": "(SUBQUERY > 0)", - "Estimated Cardinality": "360" + "CTE Name": "__duckdb_delim_dedup_31", + "Table Index": "31", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "360" + "CTE Name": "__duckdb_delim_33", + "Table Index": "33", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "72" } } ], "extra_info": { "Projections": "i_product_name", - "Estimated Cardinality": "360" + "Estimated Cardinality": "72" } } ], "extra_info": { "Groups": "#0", "Aggregates": "", - "Estimated Cardinality": "360" + "Estimated Cardinality": "72" } } ], "extra_info": { "Top": "100", - "Order By": "i1.i_product_name ASC" + "Order By": "i_product_name ASC", + "Estimated Cardinality": "72" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q42.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q42.slt.no index cf2d5ea108c..27b8d4b74a5 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q42.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q42.slt.no @@ -213,10 +213,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price)", - "dt.d_year", - "memory.main.item.i_category_id", - "memory.main.item.i_category" + "sum(ss_ext_sales_price)", + "d_year", + "i_category_id", + "i_category" ] } } @@ -249,57 +249,28 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "2921" + "Filters": "($.i_manager_id = 1i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { @@ -309,37 +280,41 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.i_manager_id = 1i64)", + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "i_item_sk", - "i_category_id", - "i_category" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#1, 2000)", "#0", - "__internal_compress_integral_utinyint(#2, 1)", + "CAST(#1 AS TINYINT)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -350,18 +325,18 @@ logical_opt [ "i_category" ], "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "55217" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "55217" } } ], @@ -372,7 +347,7 @@ logical_opt [ "i_category", "sum(ss_ext_sales_price)" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "55217" } } ], @@ -422,54 +397,68 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=2000", - "d_moy=11" - ], + "Filters": "($.i_manager_id = 1i64)", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_category_id", + "i_category" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manager_id=1", "Projections": [ - "i_item_sk", - "i_category_id", - "i_category" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#1, 2000)", "#0", - "__internal_compress_integral_utinyint(#2, 1)", + "CAST(#1 AS TINYINT)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -480,7 +469,7 @@ physical_plan [ "i_category", "ss_ext_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -491,29 +480,30 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "55217" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", "#2", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "55217" } } ], "extra_info": { "Top": "100", "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price) DESC", - "dt.d_year ASC", - "memory.main.item.i_category_id ASC", - "memory.main.item.i_category ASC" - ] + "sum(ss_ext_sales_price) DESC", + "d_year ASC", + "i_category_id ASC", + "i_category ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q43.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q43.slt.no index f51df314388..19f692626b6 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q43.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q43.slt.no @@ -261,15 +261,15 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.store.s_store_name", - "memory.main.store.s_store_id", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Sunday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Monday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Tuesday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Wednesday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Thursday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Friday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Saturday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END)" + "s_store_name", + "s_store_id", + "sun_sales", + "mon_sales", + "tue_sales", + "wed_sales", + "thu_sales", + "fri_sales", + "sat_sales" ] } } @@ -296,61 +296,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_day_name" - ], - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -362,19 +315,28 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id", - "s_store_name" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } } ], @@ -384,15 +346,15 @@ logical_opt [ "s_store_id" ], "Expressions": [ - "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL END)" + "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)" ], - "Estimated Cardinality": "57668" + "Estimated Cardinality": "1" } } ], @@ -408,13 +370,13 @@ logical_opt [ "fri_sales", "sat_sales" ], - "Estimated Cardinality": "57668" + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "1" } } ] @@ -452,19 +414,20 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2000", + "Filters": "($.s_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": [ - "d_date_sk", - "d_day_name" + "s_store_sk", + "s_store_id", + "s_store_name" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" } }, { @@ -472,20 +435,22 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "s_gmt_offset=-5.00", + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "s_store_sk", - "s_store_id", - "s_store_name" + "d_date_sk", + "d_day_name" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" } } ], @@ -493,15 +458,15 @@ physical_plan [ "Projections": [ "s_store_name", "s_store_id", - "CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL END" + "CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -519,23 +484,17 @@ physical_plan [ "sum(#7)", "sum(#8)" ], - "Estimated Cardinality": "57668" + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.store.s_store_name ASC", - "memory.main.store.s_store_id ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Sunday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Monday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Tuesday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Wednesday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Thursday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Friday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC", - "sum(CASE WHEN ((memory.main.date_dim.d_day_name = 'Saturday')) THEN (memory.main.store_sales.ss_sales_price) ELSE NULL END) ASC" - ] + "s_store_name ASC", + "s_store_id ASC" + ], + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q44.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q44.slt.no index f390453071c..4f73bace2ca 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q44.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q44.slt.no @@ -262,7 +262,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (ORDER BY rank_col ASC NULLS LAST)" + "Expressions": "rank() OVER (ORDER BY rank_col ASC NULLS LAST)" } } ], @@ -475,7 +475,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (ORDER BY rank_col DESC NULLS LAST)" + "Expressions": "rank() OVER (ORDER BY rank_col DESC NULLS LAST)" } } ], @@ -612,7 +612,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "asceding.rnk" + "Order By": "rnk" } } ], @@ -632,23 +632,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_product_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } }, @@ -656,23 +644,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_product_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } }, @@ -680,288 +656,402 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "EMPTY_RESULT", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ss_store_sk = 4i64)", + "Function": "Vortex Scan", + "SELECT projections": "ss_item_sk: cast($.ss_item_sk as i16?)", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Expressions": "" + "Expressions": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "ss_item_sk", - "Expressions": "avg(ss_net_profit)", - "Estimated Cardinality": "10457" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Groups": "ss_item_sk", + "Expressions": "avg(ss_net_profit)", + "Estimated Cardinality": "1799" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1799" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "EMPTY_RESULT", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.is_null($.ss_addr_sk)", + "($.ss_store_sk = 4i64)" + ], + "Function": "Vortex Scan", + "SELECT projections": "ss_store_sk: cast($.ss_store_sk as i8?)", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Expressions": "" + "Expressions": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "ss_store_sk", - "Expressions": "avg(ss_net_profit)", - "Estimated Cardinality": "10457" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "rank_col", - "Estimated Cardinality": "10457" + "Groups": "ss_store_sk", + "Expressions": "avg(ss_net_profit)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "CAST(#0 AS BIGINT)", + "#1" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "rank_col", "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(avg(ss_net_profit) > (0.9 * SUBQUERY))", - "Estimated Cardinality": "21" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "item_sk", - "rank_col" + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "RANK() OVER (ORDER BY rank_col ASC NULLS LAST)", - "Estimated Cardinality": "21" + "Join Type": "INNER", + "Conditions": "(avg(ss_net_profit) > (0.9 * SUBQUERY))", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": "(rnk < 11)", - "Estimated Cardinality": "4" + "Expressions": [ + "item_sk", + "rank_col" + ], + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": [ - "item_sk", - "rnk" - ], - "Estimated Cardinality": "4" + "Expressions": "rank() OVER (ORDER BY rank_col ASC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": [ - "item_sk", - "rnk" - ], - "Estimated Cardinality": "4" + "Expressions": "(rnk < 11)", + "Estimated Cardinality": "359" } }, { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "EMPTY_RESULT", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ss_store_sk = 4i64)", + "Function": "Vortex Scan", + "SELECT projections": "ss_item_sk: cast($.ss_item_sk as i16?)", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Expressions": "" + "Expressions": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "ss_item_sk", - "Expressions": "avg(ss_net_profit)", - "Estimated Cardinality": "10457" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Groups": "ss_item_sk", + "Expressions": "avg(ss_net_profit)", + "Estimated Cardinality": "1799" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1799" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "EMPTY_RESULT", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.is_null($.ss_addr_sk)", + "($.ss_store_sk = 4i64)" + ], + "Function": "Vortex Scan", + "SELECT projections": "ss_store_sk: cast($.ss_store_sk as i8?)", + "Estimated Cardinality": "57692" + } + } + ], "extra_info": { - "Expressions": "" + "Expressions": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "ss_store_sk", - "Expressions": "avg(ss_net_profit)", - "Estimated Cardinality": "10457" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "rank_col", - "Estimated Cardinality": "10457" + "Groups": "ss_store_sk", + "Expressions": "avg(ss_net_profit)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "CAST(#0 AS BIGINT)", + "#1" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "rank_col", "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(avg(ss_net_profit) > (0.9 * SUBQUERY))", - "Estimated Cardinality": "21" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "item_sk", - "rank_col" + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "RANK() OVER (ORDER BY rank_col DESC NULLS LAST)", - "Estimated Cardinality": "21" + "Join Type": "INNER", + "Conditions": "(avg(ss_net_profit) > (0.9 * SUBQUERY))", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": "(rnk < 11)", - "Estimated Cardinality": "4" + "Expressions": [ + "item_sk", + "rank_col" + ], + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": [ - "item_sk", - "rnk" - ], - "Estimated Cardinality": "4" + "Expressions": "rank() OVER (ORDER BY rank_col DESC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": [ - "item_sk", - "rnk" - ], - "Estimated Cardinality": "4" + "Expressions": "(rnk < 11)", + "Estimated Cardinality": "359" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(rnk = rnk)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(i_item_sk = item_sk)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(i_item_sk = item_sk)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], @@ -971,13 +1061,13 @@ logical_opt [ "best_performing", "worst_performing" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ] @@ -1040,30 +1130,51 @@ physical_plan [ "name": "NESTED_LOOP_JOIN", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.ss_store_sk = 4i64)", + "SELECT projections": "ss_item_sk: cast($.ss_item_sk as i16?)", + "Projections": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } } ], "extra_info": { - "Projections": [ - "ss_item_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "10457" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1799" } }, { @@ -1079,42 +1190,66 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.is_null($.ss_addr_sk)", + "($.ss_store_sk = 4i64)" + ], + "SELECT projections": "ss_store_sk: cast($.ss_store_sk as i8?)", + "Projections": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } } ], "extra_info": { - "Projections": [ - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "10457" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": "rank_col", - "Estimated Cardinality": "10457" + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "10457" + "Estimated Cardinality": "1" } } ], @@ -1122,7 +1257,8 @@ physical_plan [ "Aggregates": [ "\"first\"(#0)", "count_star()" - ] + ], + "Estimated Cardinality": "1" } } ], @@ -1138,7 +1274,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "avg(ss_net_profit) > (0.9 * SUBQUERY)", - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], @@ -1147,12 +1283,13 @@ physical_plan [ "item_sk", "rank_col" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY rank_col ASC NULLS LAST)" + "Projections": "rank() OVER (ORDER BY rank_col ASC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], @@ -1162,13 +1299,13 @@ physical_plan [ "#1", "#2" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], "extra_info": { "Expression": "(rnk < 11)", - "Estimated Cardinality": "4" + "Estimated Cardinality": "359" } } ], @@ -1177,7 +1314,7 @@ physical_plan [ "#0", "#2" ], - "Estimated Cardinality": "4" + "Estimated Cardinality": "359" } }, { @@ -1199,30 +1336,51 @@ physical_plan [ "name": "NESTED_LOOP_JOIN", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.ss_store_sk = 4i64)", + "SELECT projections": "ss_item_sk: cast($.ss_item_sk as i16?)", + "Projections": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_item_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } } ], "extra_info": { - "Projections": [ - "ss_item_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "10457" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1799" } }, { @@ -1238,42 +1396,66 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.is_null($.ss_addr_sk)", + "($.ss_store_sk = 4i64)" + ], + "SELECT projections": "ss_store_sk: cast($.ss_store_sk as i8?)", + "Projections": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": [ + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } } ], "extra_info": { - "Projections": [ - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "10457" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": "rank_col", - "Estimated Cardinality": "10457" + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "10457" + "Estimated Cardinality": "1" } } ], @@ -1281,7 +1463,8 @@ physical_plan [ "Aggregates": [ "\"first\"(#0)", "count_star()" - ] + ], + "Estimated Cardinality": "1" } } ], @@ -1297,7 +1480,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "avg(ss_net_profit) > (0.9 * SUBQUERY)", - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], @@ -1306,12 +1489,13 @@ physical_plan [ "item_sk", "rank_col" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY rank_col DESC NULLS LAST)" + "Projections": "rank() OVER (ORDER BY rank_col DESC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], @@ -1321,13 +1505,13 @@ physical_plan [ "#1", "#2" ], - "Estimated Cardinality": "21" + "Estimated Cardinality": "1799" } } ], "extra_info": { "Expression": "(rnk < 11)", - "Estimated Cardinality": "4" + "Estimated Cardinality": "359" } } ], @@ -1336,28 +1520,28 @@ physical_plan [ "#0", "#2" ], - "Estimated Cardinality": "4" + "Estimated Cardinality": "359" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "rnk = rnk", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "i_item_sk = item_sk", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "i_item_sk = item_sk", - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], @@ -1367,13 +1551,14 @@ physical_plan [ "best_performing", "worst_performing" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "71" } } ], "extra_info": { "Top": "100", - "Order By": "asceding.rnk ASC" + "Order By": "rnk ASC", + "Estimated Cardinality": "71" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q45.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q45.slt.no index 1128ebf4408..e412dc21aee 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q45.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q45.slt.no @@ -391,8 +391,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer_address.ca_zip", - "memory.main.customer_address.ca_city" + "ca_zip", + "ca_city" ] } } @@ -431,60 +431,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk", - "ws_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_qoy = 2i64)", - "($.d_year = 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -496,25 +450,13 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -524,19 +466,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "10000" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -548,26 +478,36 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" + "Conditions": "(ws_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "14322" + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } }, { @@ -601,7 +541,7 @@ logical_opt [ "extra_info": { "Join Type": "MARK", "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } }, { @@ -609,20 +549,20 @@ logical_opt [ "children": [], "extra_info": { "Expressions": "", - "Estimated Cardinality": "0" + "Estimated Cardinality": "9" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "(\"substring\"(ca_zip, 1, 5) = #0)", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": "(IN (...) OR SUBQUERY)", - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -632,7 +572,7 @@ logical_opt [ "ca_city" ], "Expressions": "sum(ws_sales_price)", - "Estimated Cardinality": "2863" + "Estimated Cardinality": "14321" } } ], @@ -642,7 +582,7 @@ logical_opt [ "ca_city", "sum(ws_sales_price)" ], - "Estimated Cardinality": "2863" + "Estimated Cardinality": "14321" } } ], @@ -702,80 +642,81 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_qoy=2" + "Projections": [ + "i_item_sk", + "i_item_id" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "71632" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_current_addr_sk" + ], + "Estimated Cardinality": "10000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_city", + "ca_zip" + ], + "Estimated Cardinality": "5000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Estimated Cardinality": "71632" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" + "Function": "Vortex Scan", + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" } }, { @@ -792,27 +733,27 @@ physical_plan [ "extra_info": { "Join Type": "MARK", "Conditions": "i_item_id = #0", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } }, { "name": "COLUMN_DATA_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "Estimated Cardinality": "9" } } ], "extra_info": { "Join Type": "MARK", "Conditions": "\"substring\"(ca_zip, 1, 5) = #0", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expression": "(IN (...) OR SUBQUERY)", - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -822,7 +763,7 @@ physical_plan [ "#1", "#2" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -832,7 +773,7 @@ physical_plan [ "ca_city", "ws_sales_price" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -842,16 +783,17 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "2863" + "Estimated Cardinality": "14321" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer_address.ca_zip ASC", - "memory.main.customer_address.ca_city ASC" - ] + "ca_zip ASC", + "ca_city ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q46.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q46.slt.no index d23f62d91c0..abd33282ae8 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q46.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q46.slt.no @@ -432,11 +432,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name", - "memory.main.customer.c_first_name", - "current_addr.ca_city", - "dn.bought_city", - "dn.ss_ticket_number" + "c_last_name", + "c_first_name", + "ca_city", + "bought_city", + "ss_ticket_number" ] } } @@ -460,13 +460,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -478,92 +478,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_coupon_amt", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([6i64, 0i64], $.d_dow, opts=sql_null_semantics)", - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -575,35 +497,33 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", "Function": "Vortex Scan", - "Estimated Cardinality": "5000" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_city" - ], + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "5000" } } @@ -611,106 +531,89 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([6i64, 0i64], $.d_dow, opts=sql_null_semantics)", + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "ca_city" - ], "Expressions": [ - "sum(ss_coupon_amt)", - "sum(ss_net_profit)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { + "Groups": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "ca_city" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "sum(ss_coupon_amt)", + "sum(ss_net_profit)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": [ - "ss_ticket_number", - "ss_customer_sk", - "bought_city", - "amt", - "profit" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk", - "c_first_name", - "c_last_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_city" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "5000" } } @@ -728,7 +631,7 @@ logical_opt [ "(ss_customer_sk = c_customer_sk)", "(bought_city != ca_city)" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -742,7 +645,7 @@ logical_opt [ "amt", "profit" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -766,16 +669,16 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -787,44 +690,20 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_coupon_amt", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([6i64, 0i64], $.d_dow, opts=sql_null_semantics)", - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_ticket_number", + "ss_coupon_amt", + "ss_net_profit" + ], "Estimated Cardinality": "288464" } }, @@ -833,16 +712,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Filters": "(($.hd_dep_count = 4i64) or ($.hd_vehicle_count = 3i32))", + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "57692" } }, { @@ -850,16 +729,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(($.hd_dep_count = 4i64) or ($.hd_vehicle_count = 3i32))", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "57692" } }, { @@ -878,73 +757,83 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([6i64, 0i64], $.d_dow, opts=sql_null_semantics)", + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "ca_city", - "ss_coupon_amt", - "ss_net_profit" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": [ - "sum(#4)", - "sum(#5)" + "Projections": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "ca_city", + "ss_coupon_amt", + "ss_net_profit" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "Groups": [ + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "288464" + "Aggregates": [ + "sum(#4)", + "sum(#5)" + ], + "Estimated Cardinality": "57691" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "bought_city", - "amt", - "profit" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } }, { @@ -990,7 +879,7 @@ physical_plan [ "ss_customer_sk = c_customer_sk", "bought_city != ca_city" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -1004,19 +893,20 @@ physical_plan [ "amt", "profit" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer.c_last_name ASC", - "memory.main.customer.c_first_name ASC", - "current_addr.ca_city ASC", - "dn.bought_city ASC", - "dn.ss_ticket_number ASC" - ] + "c_last_name ASC", + "c_first_name ASC", + "ca_city ASC", + "bought_city ASC", + "ss_ticket_number ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q47.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q47.slt.no index d57d23fb301..2298549cb0b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q47.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q47.slt.no @@ -312,7 +312,7 @@ logical_plan [ "extra_info": { "Expressions": [ "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name, d_year)", - "RANK() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "rank() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" ] } } @@ -537,58 +537,27 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "((($.d_year = 1999i64) or (($.d_year = 1998i64) and ($.d_moy = 12i64))) or (($.d_year = 2000i64) and ($.d_moy = 1i64)))", - "((($.d_year = 1999i64) or ($.d_year = 1998i64)) or ($.d_year = 2000i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "14609" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Conditions": "(ss_store_sk = s_store_sk)", "Estimated Cardinality": "288464" } }, @@ -599,47 +568,39 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "((($.d_year = 1999i64) or (($.d_year = 1998i64) and ($.d_moy = 12i64))) or (($.d_year = 2000i64) and ($.d_moy = 1i64)))", + "((($.d_year = 1999i64) or ($.d_year = 1998i64)) or ($.d_year = 2000i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "s_store_sk", - "s_store_name", - "s_company_name" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand", - "i_category" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -654,10 +615,10 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", - "__internal_compress_integral_utinyint(#2, 1)", - "#3", + "#1", + "#2", "#4", + "CAST(#3 AS TINYINT)", "#5", "#6" ], @@ -675,7 +636,7 @@ logical_opt [ "d_moy" ], "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } } ], @@ -686,19 +647,19 @@ logical_opt [ "#2", "#3", "__internal_decompress_integral_bigint(#4, 1900)", - "__internal_decompress_integral_bigint(#5, 1)", + "CAST(#5 AS BIGINT)", "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } } ], "extra_info": { "Expressions": [ "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name, d_year)", - "RANK() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "rank() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } } ], @@ -714,7 +675,7 @@ logical_opt [ "avg_monthly_sales", "rn" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } }, { @@ -730,118 +691,79 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_category = i_category)", - "(i_brand = i_brand)", - "(s_store_name = s_store_name)", - "(s_company_name = s_company_name)", - "((rn + 1) = (rn - 1))" - ], - "Estimated Cardinality": "46228599" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "(d_year = 1999)", - "(avg_monthly_sales > 0.0)" - ], - "Estimated Cardinality": "288464" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_category = i_category)", - "(i_brand = i_brand)", - "(s_store_name = s_store_name)", - "(s_company_name = s_company_name)", - "((rn - 1) = rn)", - "((rn + 1) = rn)" - ], - "Estimated Cardinality": "7408492643" + "CTE Index": "0", + "Estimated Cardinality": "288457" } } ], "extra_info": { "Expressions": [ - "i_category", - "i_brand", - "s_store_name", - "s_company_name", - "d_year", - "d_moy", - "avg_monthly_sales", - "sum_sales", - "psum", - "nsum" + "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "(d_year = 1999)", + "(avg_monthly_sales > 0.0)" + ], + "Estimated Cardinality": "288457" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "288457" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "288457" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(i_category = i_category)", + "(i_brand = i_brand)", + "(s_store_name = s_store_name)", + "(s_company_name = s_company_name)", + "((rn + 1) = (rn - 1))" ], - "Estimated Cardinality": "7408492643" + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8", - "#9" + "Join Type": "INNER", + "Conditions": [ + "(i_category = i_category)", + "(i_brand = i_brand)", + "(s_store_name = s_store_name)", + "(s_company_name = s_company_name)", + "(rn = (rn - 1))", + "(rn = (rn + 1))" ], - "Estimated Cardinality": "7408492643" + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "7408492643" + "Expressions": "", + "Estimated Cardinality": "288457" } } ], @@ -859,7 +781,7 @@ logical_opt [ "nsum", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "7408492643" + "Estimated Cardinality": "288457" } } ], @@ -941,6 +863,29 @@ physical_plan [ "Estimated Cardinality": "288464" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_name", + "s_company_name" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "READ_VORTEX", "children": [], @@ -961,28 +906,19 @@ physical_plan [ } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_store_name", - "s_company_name" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } }, @@ -1010,10 +946,10 @@ physical_plan [ "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", - "__internal_compress_integral_utinyint(#2, 1)", - "#3", + "#1", + "#2", "#4", + "CAST(#3 AS TINYINT)", "#5", "#6" ], @@ -1045,7 +981,7 @@ physical_plan [ "#5" ], "Aggregates": "sum(#6)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } } ], @@ -1056,20 +992,22 @@ physical_plan [ "#2", "#3", "__internal_decompress_integral_bigint(#4, 1900)", - "__internal_decompress_integral_bigint(#5, 1)", + "CAST(#5 AS BIGINT)", "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name, d_year)" + "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name, d_year)", + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)", + "Estimated Cardinality": "288457" } } ], @@ -1085,7 +1023,7 @@ physical_plan [ "#7", "#8" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288457" } }, { @@ -1098,98 +1036,69 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_category = i_category", - "i_brand = i_brand", - "s_store_name = s_store_name", - "s_company_name = s_company_name", - "(rn + 1) = (rn - 1)" - ], - "Estimated Cardinality": "46228599" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expression": "((d_year = 1999) AND (avg_monthly_sales > 0.0))", - "Estimated Cardinality": "288464" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_category = i_category", - "i_brand = i_brand", - "s_store_name = s_store_name", - "s_company_name = s_company_name", - "(rn - 1) = rn", - "(rn + 1) = rn" - ], - "Estimated Cardinality": "7408492643" + "CTE Index": "0", + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Projections": [ - "i_category", - "i_brand", - "s_store_name", - "s_company_name", - "d_year", - "d_moy", - "avg_monthly_sales", - "sum_sales", - "psum", - "nsum" + "Expression": "((CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1) AND (d_year = 1999) AND (avg_monthly_sales > 0.0))", + "Estimated Cardinality": "288457" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "288457" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "288457" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "i_category = i_category", + "i_brand = i_brand", + "s_store_name = s_store_name", + "s_company_name = s_company_name", + "(rn + 1) = (rn - 1)" ], - "Estimated Cardinality": "7408492643" + "Estimated Cardinality": "288457" } } ], "extra_info": { - "Expression": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "7408492643" + "Join Type": "INNER", + "Conditions": [ + "i_category = i_category", + "i_brand = i_brand", + "s_store_name = s_store_name", + "s_company_name = s_company_name", + "rn = (rn - 1)", + "rn = (rn + 1)" + ], + "Estimated Cardinality": "288457" } } ], @@ -1207,7 +1116,7 @@ physical_plan [ "nsum", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "7408492643" + "Estimated Cardinality": "288457" } } ], @@ -1225,7 +1134,8 @@ physical_plan [ "sum_sales ASC", "psum ASC", "nsum ASC" - ] + ], + "Estimated Cardinality": "100" } } ], @@ -1249,6 +1159,7 @@ physical_plan [ "extra_info": { "CTE Name": "v1", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q48.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q48.slt.no index 3d865a4b15f..916c61b1ccf 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q48.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q48.slt.no @@ -303,169 +303,108 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"4 yr Degree\")) or (($.cd_marital_status = \"D\") and ($.cd_education_status = \"2 yr Degree\"))) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"D\")) or ($.cd_marital_status = \"S\"))", + "((($.cd_education_status = \"4 yr Degree\") or ($.cd_education_status = \"2 yr Degree\")) or ($.cd_education_status = \"College\"))", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "192080" + "Estimated Cardinality": "38416" } - } - ], - "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" - ], - "Estimated Cardinality": "192080" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_cdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_country = \"United States\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "11535" + "Filters": [ + "(((($.ss_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ss_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ss_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(20000, precision=7, scale=2))))", + "(((($.ss_net_profit >= decimal128(0, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(200000, precision=7, scale=2))) or (($.ss_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(300000, precision=7, scale=2)))) or (($.ss_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(2500000, precision=7, scale=2))))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": "((((ss_net_profit >= 0.00) AND (ss_net_profit <= 2000.00)) AND ((ca_state = 'CO') OR (ca_state = 'OH') OR (ca_state = 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 3000.00)) AND ((ca_state = 'OR') OR (ca_state = 'MN') OR (ca_state = 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 25000.00)) AND ((ca_state = 'VA') OR (ca_state = 'CA') OR (ca_state = 'MS'))))", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "((vortex.list.contains([\"CO\", \"OH\", \"TX\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"OR\", \"MN\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"VA\", \"CA\", \"MS\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": [ + "(ss_addr_sk = ca_address_sk)", + "((((ss_net_profit >= 0.00) AND (ss_net_profit <= 2000.00)) AND (ca_state IN ('CO', 'OH', 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 3000.00)) AND (ca_state IN ('OR', 'MN', 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 25000.00)) AND (ca_state IN ('VA', 'CA', 'MS'))))" + ], + "Estimated Cardinality": "2307" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11535" + "Conditions": [ + "(cd_demo_sk = ss_cdemo_sk)", + "((((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = '4 yr Degree')) OR (((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'D') AND (cd_education_status = '2 yr Degree')) OR (((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')))" + ], + "Estimated Cardinality": "307" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cd_demo_sk = ss_cdemo_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "307" } } ], "extra_info": { - "Expressions": "((((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = '4 yr Degree')) OR (((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'D') AND (cd_education_status = '2 yr Degree')) OR (((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')))", - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "(d_date_sk = ss_sold_date_sk)", + "Estimated Cardinality": "307" } } ], @@ -490,10 +429,23 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, + { + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -503,99 +455,42 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"4 yr Degree\")) or (($.cd_marital_status = \"D\") and ($.cd_education_status = \"2 yr Degree\"))) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"D\")) or ($.cd_marital_status = \"S\"))", + "((($.cd_education_status = \"4 yr Degree\") or ($.cd_education_status = \"2 yr Degree\")) or ($.cd_education_status = \"College\"))", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], "Projections": [ "cd_demo_sk", "cd_marital_status", "cd_education_status" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "38416" } }, { "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_cdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_country='United States'", - "Projections": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "11535" - } - } - ], - "extra_info": { - "Expression": "((((ss_net_profit >= 0.00) AND (ss_net_profit <= 2000.00)) AND ((ca_state = 'CO') OR (ca_state = 'OH') OR (ca_state = 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 3000.00)) AND ((ca_state = 'OR') OR (ca_state = 'MN') OR (ca_state = 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 25000.00)) AND ((ca_state = 'VA') OR (ca_state = 'CA') OR (ca_state = 'MS'))))", - "Estimated Cardinality": "11535" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ss_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ss_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ss_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ss_sales_price <= decimal128(20000, precision=7, scale=2))))", + "(((($.ss_net_profit >= decimal128(0, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(200000, precision=7, scale=2))) or (($.ss_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(300000, precision=7, scale=2)))) or (($.ss_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ss_net_profit <= decimal128(2500000, precision=7, scale=2))))" + ], "Projections": [ - "#0", - "#1", - "#2", - "#3" + "ss_sold_date_sk", + "ss_cdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_quantity", + "ss_sales_price", + "ss_net_profit" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } }, { @@ -603,45 +498,70 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Filters": [ + "((vortex.list.contains([\"CO\", \"OH\", \"TX\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"OR\", \"MN\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"VA\", \"CA\", \"MS\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" + ], + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11535" + "Conditions": [ + "ss_addr_sk = ca_address_sk", + "((((ss_net_profit >= 0.00) AND (ss_net_profit <= 2000.00)) AND (ca_state IN ('CO', 'OH', 'TX'))) OR (((ss_net_profit >= 150.00) AND (ss_net_profit <= 3000.00)) AND (ca_state IN ('OR', 'MN', 'KY'))) OR (((ss_net_profit >= 50.00) AND (ss_net_profit <= 25000.00)) AND (ca_state IN ('VA', 'CA', 'MS'))))" + ], + "Estimated Cardinality": "2307" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cd_demo_sk = ss_cdemo_sk", - "Estimated Cardinality": "11535" + "Conditions": [ + "cd_demo_sk = ss_cdemo_sk", + "((((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = '4 yr Degree')) OR (((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'D') AND (cd_education_status = '2 yr Degree')) OR (((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')))" + ], + "Estimated Cardinality": "307" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expression": "((((ss_sales_price >= 100.00) AND (ss_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = '4 yr Degree')) OR (((ss_sales_price >= 50.00) AND (ss_sales_price <= 100.00)) AND (cd_marital_status = 'D') AND (cd_education_status = '2 yr Degree')) OR (((ss_sales_price >= 150.00) AND (ss_sales_price <= 200.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')))", - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "307" } } ], "extra_info": { - "Projections": "#2", - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "d_date_sk = ss_sold_date_sk", + "Estimated Cardinality": "307" } } ], "extra_info": { "Projections": "ss_quantity", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "307" } } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q49.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q49.slt.no index 3a29aa994f2..d3d6db467e1 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q49.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q49.slt.no @@ -335,8 +335,8 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ] } } @@ -584,8 +584,8 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ] } } @@ -815,8 +815,8 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ] } } @@ -908,40 +908,53 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -955,197 +968,160 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_order_number", - "ws_quantity", - "ws_net_paid" - ], - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 12i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "($.wr_return_amt > decimal128(1000000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": [ + "(ws_order_number = wr_order_number)", + "(ws_item_sk = wr_item_sk)" + ], + "Estimated Cardinality": "3359" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "2921" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.wr_return_amt > decimal128(1000000, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "1407" - } - } - ], - "extra_info": { - "Expressions": [ - "wr_item_sk", - "wr_order_number", - "wr_return_quantity", - "wr_return_amt" - ], - "Estimated Cardinality": "1407" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "3359" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ws_order_number = wr_order_number)", - "(ws_item_sk = wr_item_sk)" + "Expressions": [ + "#0", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "3359" } } ], "extra_info": { + "Groups": "ws_item_sk", "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "sum(COALESCE(wr_return_quantity, 0))", + "sum(COALESCE(ws_quantity, 0))", + "sum(COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00))", + "sum(COALESCE(CAST(ws_net_paid AS DECIMAL(12,2)), 0.00))" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Groups": "ws_item_sk", "Expressions": [ - "sum(COALESCE(wr_return_quantity, 0))", - "sum(COALESCE(ws_quantity, 0))", - "sum(COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00))", - "sum(COALESCE(CAST(ws_net_paid AS DECIMAL(12,2)), 0.00))" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "2642" + "Estimated Cardinality": "1521" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "item", + "return_ratio", + "currency_ratio" ], - "Estimated Cardinality": "2642" + "Estimated Cardinality": "1521" } } ], "extra_info": { "Expressions": [ - "item", - "return_ratio", - "currency_ratio" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ], - "Estimated Cardinality": "2642" + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" - ], - "Estimated Cardinality": "2642" + "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "304" } } ], "extra_info": { - "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "528" + "Expressions": [ + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "304" } } ], "extra_info": { "Expressions": [ + "channel", "item", "return_ratio", "return_rank", "currency_rank" ], - "Estimated Cardinality": "528" + "Estimated Cardinality": "304" } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" - ], - "Estimated Cardinality": "528" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1160,197 +1136,147 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_net_paid" - ], - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 12i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "($.cr_return_amount > decimal128(1000000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "2855" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": [ + "(cs_order_number = cr_order_number)", + "(cs_item_sk = cr_item_sk)" + ], + "Estimated Cardinality": "5126" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "5744" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.cr_return_amount > decimal128(1000000, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "2855" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number", - "cr_return_quantity", - "cr_return_amount" - ], - "Estimated Cardinality": "2855" + "Conditions": "(d_date_sk = cs_sold_date_sk)", + "Estimated Cardinality": "5126" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(cs_order_number = cr_order_number)", - "(cs_item_sk = cr_item_sk)" + "Expressions": [ + "#0", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "5126" } } ], "extra_info": { + "Groups": "cs_item_sk", "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "sum(COALESCE(cr_return_quantity, 0))", + "sum(COALESCE(cs_quantity, 0))", + "sum(COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00))", + "sum(COALESCE(CAST(cs_net_paid AS DECIMAL(12,2)), 0.00))" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Groups": "cs_item_sk", "Expressions": [ - "sum(COALESCE(cr_return_quantity, 0))", - "sum(COALESCE(cs_quantity, 0))", - "sum(COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00))", - "sum(COALESCE(CAST(cs_net_paid AS DECIMAL(12,2)), 0.00))" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "5206" + "Estimated Cardinality": "1695" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "item", + "return_ratio", + "currency_ratio" ], - "Estimated Cardinality": "5206" + "Estimated Cardinality": "1695" } } ], "extra_info": { "Expressions": [ - "item", - "return_ratio", - "currency_ratio" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ], - "Estimated Cardinality": "5206" + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" - ], - "Estimated Cardinality": "5206" + "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "339" } } ], "extra_info": { - "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "1041" + "Expressions": [ + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "339" } } ], "extra_info": { "Expressions": [ + "channel", "item", "return_ratio", "return_rank", "currency_rank" ], - "Estimated Cardinality": "1041" + "Estimated Cardinality": "339" } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" - ], - "Estimated Cardinality": "1041" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1364,187 +1290,165 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ticket_number", - "ss_quantity", - "ss_net_paid" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 12i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "($.sr_return_amt > decimal128(1000000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "5715" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": [ + "(ss_ticket_number = sr_ticket_number)", + "(ss_item_sk = sr_item_sk)" + ], + "Estimated Cardinality": "13737" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.sr_return_amt > decimal128(1000000, precision=7, scale=2))", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "5715" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number", - "sr_return_quantity", - "sr_return_amt" - ], - "Estimated Cardinality": "5715" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "13737" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ss_ticket_number = sr_ticket_number)", - "(ss_item_sk = sr_item_sk)" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "13737" } } ], "extra_info": { + "Groups": "ss_item_sk", "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "sum(COALESCE(sr_return_quantity, 0))", + "sum(COALESCE(ss_quantity, 0))", + "sum(COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00))", + "sum(COALESCE(CAST(ss_net_paid AS DECIMAL(12,2)), 0.00))" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Groups": "ss_item_sk", "Expressions": [ - "sum(COALESCE(sr_return_quantity, 0))", - "sum(COALESCE(ss_quantity, 0))", - "sum(COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00))", - "sum(COALESCE(CAST(ss_net_paid AS DECIMAL(12,2)), 0.00))" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10455" + "Estimated Cardinality": "1799" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "item", + "return_ratio", + "currency_ratio" ], - "Estimated Cardinality": "10455" + "Estimated Cardinality": "1799" } } ], "extra_info": { "Expressions": [ - "item", - "return_ratio", - "currency_ratio" + "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)" ], - "Estimated Cardinality": "10455" + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expressions": [ - "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)", - "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" - ], - "Estimated Cardinality": "10455" + "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "359" } } ], "extra_info": { - "Expressions": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "2091" + "Expressions": [ + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "359" } } ], "extra_info": { "Expressions": [ + "channel", "item", "return_ratio", "return_rank", "currency_rank" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "359" } } ], "extra_info": { - "Expressions": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" - ], - "Estimated Cardinality": "2091" + "Expressions": "", + "Estimated Cardinality": "1002" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2091" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1002" } } ], "extra_info": { "Expressions": [ "__internal_compress_string_ubigint(#0)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#1 AS SMALLINT)", "#2", "#3", "#4" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "2091", + "Estimated Cardinality": "1002", "Distinct Targets": [ "channel", "item", @@ -1558,12 +1462,12 @@ logical_opt [ "extra_info": { "Expressions": [ "__internal_decompress_string(#0)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], @@ -1575,7 +1479,7 @@ logical_opt [ "return_rank", "currency_rank" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], @@ -1602,88 +1506,79 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "UNION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "($.ws_net_profit > decimal128(100, precision=7, scale=2))", - "($.ws_net_paid > decimal128(0, precision=7, scale=2))", - "($.ws_quantity > 0i64)" - ], - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_order_number", - "ws_quantity", - "ws_net_paid" - ], - "Estimated Cardinality": "14326" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=12" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "2921" + "Function": "Vortex Scan", + "Filters": [ + "($.ws_net_profit > decimal128(100, precision=7, scale=2))", + "($.ws_net_paid > decimal128(0, precision=7, scale=2))", + "($.ws_quantity > 0i64)" + ], + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_order_number", + "ws_quantity", + "ws_net_paid" + ], + "Estimated Cardinality": "14326" } }, { @@ -1708,195 +1603,200 @@ physical_plan [ "ws_order_number = wr_order_number", "ws_item_sk = wr_item_sk" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "3359" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "3359" } } ], "extra_info": { "Projections": [ - "ws_item_sk", - "COALESCE(wr_return_quantity, 0)", - "COALESCE(ws_quantity, 0)", - "COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00)", - "COALESCE(CAST(ws_net_paid AS DECIMAL(12,2)), 0.00)" + "#0", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "3359" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" - ] + "Projections": [ + "ws_item_sk", + "COALESCE(wr_return_quantity, 0)", + "COALESCE(ws_quantity, 0)", + "COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00)", + "COALESCE(CAST(ws_net_paid AS DECIMAL(12,2)), 0.00)" + ], + "Estimated Cardinality": "3359" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], - "Estimated Cardinality": "2642" + "Estimated Cardinality": "1521" } } ], "extra_info": { "Projections": [ - "item", - "return_ratio", - "currency_ratio" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "2642" + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)" + "Projections": [ + "item", + "return_ratio", + "currency_ratio" + ], + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "Projections": "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "2642" + "Projections": "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "528" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1521" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#3", - "#4" - ], - "Estimated Cardinality": "528" + "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "304" } } ], "extra_info": { "Projections": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" + "#0", + "#1", + "#3", + "#4" ], - "Estimated Cardinality": "528" + "Estimated Cardinality": "304" } - }, + } + ], + "extra_info": { + "Projections": [ + "channel", + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "304" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "($.cs_net_profit > decimal128(100, precision=7, scale=2))", - "($.cs_net_paid > decimal128(0, precision=7, scale=2))", - "($.cs_quantity > 0i64)", - "(2i64 <= $.cs_order_number <= 15999i64)" - ], - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_net_paid" - ], - "Estimated Cardinality": "28731" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=12" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "5744" + "Function": "Vortex Scan", + "Filters": [ + "($.cs_net_profit > decimal128(100, precision=7, scale=2))", + "($.cs_net_paid > decimal128(0, precision=7, scale=2))", + "($.cs_quantity > 0i64)", + "(2i64 <= $.cs_order_number <= 15999i64)" + ], + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_order_number", + "cs_quantity", + "cs_net_paid" + ], + "Estimated Cardinality": "28731" } }, { @@ -1921,194 +1821,185 @@ physical_plan [ "cs_order_number = cr_order_number", "cs_item_sk = cr_item_sk" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "5126" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "5744" + "Join Type": "INNER", + "Conditions": "d_date_sk = cs_sold_date_sk", + "Estimated Cardinality": "5126" } } ], "extra_info": { "Projections": [ - "cs_item_sk", - "COALESCE(cr_return_quantity, 0)", - "COALESCE(cs_quantity, 0)", - "COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00)", - "COALESCE(CAST(cs_net_paid AS DECIMAL(12,2)), 0.00)" + "#0", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "5126" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" - ] + "Projections": [ + "cs_item_sk", + "COALESCE(cr_return_quantity, 0)", + "COALESCE(cs_quantity, 0)", + "COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00)", + "COALESCE(CAST(cs_net_paid AS DECIMAL(12,2)), 0.00)" + ], + "Estimated Cardinality": "5126" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], - "Estimated Cardinality": "5206" + "Estimated Cardinality": "1695" } } ], "extra_info": { "Projections": [ - "item", - "return_ratio", - "currency_ratio" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "5206" + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)" + "Projections": [ + "item", + "return_ratio", + "currency_ratio" + ], + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "Projections": "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "5206" + "Projections": "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "1041" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1695" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#3", - "#4" - ], - "Estimated Cardinality": "1041" + "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "339" } } ], "extra_info": { "Projections": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" + "#0", + "#1", + "#3", + "#4" ], - "Estimated Cardinality": "1041" + "Estimated Cardinality": "339" } - }, + } + ], + "extra_info": { + "Projections": [ + "channel", + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "339" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "($.ss_net_profit > decimal128(100, precision=7, scale=2))", - "($.ss_net_paid > decimal128(0, precision=7, scale=2))", - "($.ss_quantity > 0i64)" - ], - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ticket_number", - "ss_quantity", - "ss_net_paid" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=12" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "11535" + "Function": "Vortex Scan", + "Filters": [ + "($.ss_net_profit > decimal128(100, precision=7, scale=2))", + "($.ss_net_paid > decimal128(0, precision=7, scale=2))", + "($.ss_quantity > 0i64)" + ], + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_ticket_number", + "ss_quantity", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } }, { @@ -2133,143 +2024,155 @@ physical_plan [ "ss_ticket_number = sr_ticket_number", "ss_item_sk = sr_item_sk" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "13737" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 12i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "13737" } } ], "extra_info": { "Projections": [ - "ss_item_sk", - "COALESCE(sr_return_quantity, 0)", - "COALESCE(ss_quantity, 0)", - "COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00)", - "COALESCE(CAST(ss_net_paid AS DECIMAL(12,2)), 0.00)" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "13737" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" - ] + "Projections": [ + "ss_item_sk", + "COALESCE(sr_return_quantity, 0)", + "COALESCE(ss_quantity, 0)", + "COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00)", + "COALESCE(CAST(ss_net_paid AS DECIMAL(12,2)), 0.00)" + ], + "Estimated Cardinality": "13737" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2", - "#3", - "#4" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], - "Estimated Cardinality": "10455" + "Estimated Cardinality": "1799" } } ], "extra_info": { "Projections": [ - "item", - "return_ratio", - "currency_ratio" + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10455" + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY return_ratio ASC NULLS LAST)" + "Projections": [ + "item", + "return_ratio", + "currency_ratio" + ], + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": "RANK() OVER (ORDER BY currency_ratio ASC NULLS LAST)" + "Projections": "rank() OVER (ORDER BY return_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "10455" + "Projections": "rank() OVER (ORDER BY currency_ratio ASC NULLS LAST)", + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", - "Estimated Cardinality": "2091" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1799" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#3", - "#4" - ], - "Estimated Cardinality": "2091" + "Expression": "((return_rank <= 10) OR (currency_rank <= 10))", + "Estimated Cardinality": "359" } } ], "extra_info": { "Projections": [ - "channel", - "item", - "return_ratio", - "return_rank", - "currency_rank" + "#0", + "#1", + "#3", + "#4" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "359" } } ], - "extra_info": {} + "extra_info": { + "Projections": [ + "channel", + "item", + "return_ratio", + "return_rank", + "currency_rank" + ], + "Estimated Cardinality": "359" + } } ], - "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3", - "#4" - ], - "Aggregates": "", - "Estimated Cardinality": "2091" - } + "extra_info": {} } ], "extra_info": { "Projections": [ "__internal_compress_string_ubigint(#0)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#1 AS SMALLINT)", "#2", "#3", "#4" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], @@ -2281,7 +2184,7 @@ physical_plan [ "return_rank", "currency_rank" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], @@ -2294,19 +2197,19 @@ physical_plan [ "#4" ], "Aggregates": "", - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], "extra_info": { "Projections": [ "__internal_decompress_string(#0)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4" ], - "Estimated Cardinality": "2091" + "Estimated Cardinality": "1002" } } ], @@ -2317,7 +2220,8 @@ physical_plan [ "return_rank ASC", "currency_rank ASC", "item ASC" - ] + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q5.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q5.slt.no index ca9661e6e93..75007702559 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q5.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q5.slt.no @@ -1098,8 +1098,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "x.channel", - "x.id" + "channel", + "id" ] } } @@ -1135,222 +1135,656 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "UNION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "ss_sold_date_sk", + "ss_store_sk", + "ss_ext_sales_price", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "store_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Expressions": [ + "sr_returned_date_sk", + "sr_store_sk", + "sr_return_amt", + "sr_net_loss" + ], + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Expressions": [ + "store_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "317040" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(store_sk = s_store_sk)", + "Estimated Cardinality": "317040" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450816i64 <= $.d_date_sk <= 2452820i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(date_sk = d_date_sk)", + "Estimated Cardinality": "317040" } } ], "extra_info": { + "Groups": "s_store_id", "Expressions": [ - "store_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" + "sum(sales_price)", + "sum(profit)", + "sum(return_amt)", + "sum(net_loss)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "1" } - }, + } + ], + "extra_info": { + "Expressions": [ + "s_store_id", + "sales", + "profit", + "returns_", + "profit_loss" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "cs_sold_date_sk", + "cs_catalog_page_sk", + "cs_ext_sales_price", + "cs_net_profit" + ], + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "page_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Expressions": [ + "cr_returned_date_sk", + "cr_catalog_page_sk", + "cr_return_amount", + "cr_net_loss" + ], + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Expressions": [ + "page_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "157932" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.cp_catalog_page_sk <= 9827i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "11718" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(page_sk = cp_catalog_page_sk)", + "Estimated Cardinality": "157932" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450815i64 <= $.d_date_sk <= 2452907i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "28576" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_store_sk", - "sr_return_amt", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" + "Join Type": "INNER", + "Conditions": "(date_sk = d_date_sk)", + "Estimated Cardinality": "157932" } } ], "extra_info": { + "Groups": "cp_catalog_page_id", "Expressions": [ - "store_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" + "sum(sales_price)", + "sum(profit)", + "sum(return_amt)", + "sum(net_loss)" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "11717" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "317040" + "Expressions": [ + "cp_catalog_page_id", + "sales", + "profit", + "returns_", + "profit_loss" + ], + "Estimated Cardinality": "11717" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "11717" + } + } + ], + "extra_info": { + "Expressions": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "11717" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "ws_sold_date_sk", + "ws_web_site_sk", + "ws_ext_sales_price", + "ws_net_profit" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "wsr_web_site_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + } + ], + "extra_info": { + "Join Type": "RIGHT", + "Conditions": [ + "(ws_item_sk = wr_item_sk)", + "(ws_order_number = wr_order_number)" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "wsr_web_site_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "143264" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "3" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(wsr_web_site_sk = web_site_sk)", + "Estimated Cardinality": "143264" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450816i64 <= $.d_date_sk <= 2452974i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(date_sk = d_date_sk)", + "Estimated Cardinality": "143264" + } + } + ], "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450816i64 <= $.d_date_sk <= 2452820i64)" + "Groups": "web_site_id", + "Expressions": [ + "sum(sales_price)", + "sum(profit)", + "sum(return_amt)", + "sum(net_loss)" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(date_sk = d_date_sk)", - "Estimated Cardinality": "317040" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Expressions": [ + "web_site_id", + "sales", + "profit", + "returns_", + "profit_loss" + ], + "Estimated Cardinality": "3" } } ], "extra_info": { "Expressions": [ - "s_store_sk", - "s_store_id" + "#0", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(store_sk = s_store_sk)", - "Estimated Cardinality": "317040" + "Expressions": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "3" } } ], "extra_info": { - "Groups": "s_store_id", - "Expressions": [ - "sum(sales_price)", - "sum(profit)", - "sum(return_amt)", - "sum(net_loss)" - ], - "Estimated Cardinality": "192352" + "Expressions": "", + "Estimated Cardinality": "11721" } } ], "extra_info": { "Expressions": [ - "s_store_id", - "sales", - "profit", - "returns_", - "profit_loss" + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "192352" + "Estimated Cardinality": "11721" } } ], "extra_info": { + "Groups": [ + "channel", + "id" + ], "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4" + "sum(sales) EXPORT_STATE", + "sum(returns_) EXPORT_STATE", + "sum(profit) EXPORT_STATE" ], - "Estimated Cardinality": "192352" + "Estimated Cardinality": "5860" } } ], "extra_info": { "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "192352" + "Estimated Cardinality": "5860" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "5860" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { "name": "PROJECTION", @@ -1362,176 +1796,48 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "UNION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_catalog_page_sk", - "cs_ext_sales_price", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "page_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_returned_date_sk", - "cr_catalog_page_sk", - "cr_return_amount", - "cr_net_loss" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "page_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "157932" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450815i64 <= $.d_date_sk <= 2452907i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(date_sk = d_date_sk)", - "Estimated Cardinality": "157932" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.cp_catalog_page_sk <= 9827i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "11718" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "cp_catalog_page_sk", - "cp_catalog_page_id" - ], - "Estimated Cardinality": "11718" + "CTE Index": "181", + "Estimated Cardinality": "5860" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(page_sk = cp_catalog_page_sk)", - "Estimated Cardinality": "157932" + "Expressions": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "5860" } } ], "extra_info": { - "Groups": "cp_catalog_page_id", + "Groups": "#0", "Expressions": [ - "sum(sales_price)", - "sum(profit)", - "sum(return_amt)", - "sum(net_loss)" + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)" ], - "Estimated Cardinality": "95807" + "Estimated Cardinality": "2930" } } ], "extra_info": { "Expressions": [ - "cp_catalog_page_id", - "sales", - "profit", - "returns_", - "profit_loss" + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "95807" + "Estimated Cardinality": "2930" } } ], @@ -1540,243 +1846,104 @@ logical_opt [ "#0", "#1", "#2", - "#3", - "#4" + "#3" ], - "Estimated Cardinality": "95807" + "Estimated Cardinality": "2930" } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "95807" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "UNION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_web_site_sk", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "wsr_web_site_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_item_sk", - "ws_web_site_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Expressions": [ - "wr_returned_date_sk", - "wr_item_sk", - "wr_order_number", - "wr_return_amt", - "wr_net_loss" - ], - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Join Type": "RIGHT", - "Conditions": [ - "(ws_item_sk = wr_item_sk)", - "(ws_order_number = wr_order_number)" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "wsr_web_site_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "143264" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450816i64 <= $.d_date_sk <= 2452974i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(date_sk = d_date_sk)", - "Estimated Cardinality": "143264" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "3" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": [ - "web_site_sk", - "web_site_id" - ], - "Estimated Cardinality": "3" + "CTE Index": "185", + "Estimated Cardinality": "2930" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(wsr_web_site_sk = web_site_sk)", - "Estimated Cardinality": "143264" + "Groups": "", + "Expressions": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "185", + "Estimated Cardinality": "2930" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "2930" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "5860" } } ], "extra_info": { - "Groups": "web_site_id", "Expressions": [ - "sum(sales_price)", - "sum(profit)", - "sum(return_amt)", - "sum(net_loss)" + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" ], - "Estimated Cardinality": "61937" + "Estimated Cardinality": "5860" } } ], "extra_info": { - "Expressions": [ - "web_site_id", - "sales", - "profit", - "returns_", - "profit_loss" - ], - "Estimated Cardinality": "61937" + "Expressions": "", + "Estimated Cardinality": "8791" } } ], @@ -1788,39 +1955,33 @@ logical_opt [ "#3", "#4" ], - "Estimated Cardinality": "61937" + "Estimated Cardinality": "8791" } } ], "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "61937" + "CTE Name": "__grouping_sets_cte_185", + "Table Index": "185", + "Estimated Cardinality": "8791" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "350096" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "8791" } } ], "extra_info": { - "Groups": [ - "channel", - "id" - ], - "Expressions": [ - "sum(sales)", - "sum(returns_)", - "sum(profit)" - ], - "Estimated Cardinality": "197658" + "CTE Name": "__grouping_sets_cte_181", + "Table Index": "181", + "Estimated Cardinality": "8791" } } ], @@ -1832,7 +1993,7 @@ logical_opt [ "returns_", "profit" ], - "Estimated Cardinality": "197658" + "Estimated Cardinality": "8791" } } ], @@ -1847,393 +2008,443 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_store_sk", + "ss_ext_sales_price", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "store_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_returned_date_sk", + "sr_store_sk", + "sr_return_amt", + "sr_net_loss" + ], + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Projections": [ + "store_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": {} + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_id" + ], + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "store_sk = s_store_sk", + "Estimated Cardinality": "317040" } - } - ], - "extra_info": { - "Projections": [ - "store_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "sr_returned_date_sk", - "sr_store_sk", - "sr_return_amt", - "sr_net_loss" + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450816i64 <= $.d_date_sk <= 2452820i64)" ], - "Estimated Cardinality": "28576" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "store_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "28576" + "Join Type": "INNER", + "Conditions": "date_sk = d_date_sk", + "Estimated Cardinality": "317040" } } ], - "extra_info": {} - }, - { - "name": "READ_VORTEX", - "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450816i64 <= $.d_date_sk <= 2452820i64)" + "Projections": [ + "s_store_id", + "sales_price", + "profit", + "return_amt", + "net_loss" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "317040" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "date_sk = d_date_sk", - "Estimated Cardinality": "317040" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_id" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "store_sk = s_store_sk", - "Estimated Cardinality": "317040" + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Projections": [ - "s_store_id", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "317040" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" - ], - "Estimated Cardinality": "192352" - } - } - ], - "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "192352" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_catalog_page_sk", + "cs_ext_sales_price", + "cs_net_profit" + ], + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Projections": [ + "page_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cr_returned_date_sk", + "cr_catalog_page_sk", + "cr_return_amount", + "cr_net_loss" + ], + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Projections": [ + "page_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": {} + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.cp_catalog_page_sk <= 9827i64)", + "Projections": [ + "cp_catalog_page_sk", + "cp_catalog_page_id" + ], + "Estimated Cardinality": "11718" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_catalog_page_sk", - "cs_ext_sales_price", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "page_sk = cp_catalog_page_sk", + "Estimated Cardinality": "157932" } - } - ], - "extra_info": { - "Projections": [ - "page_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "cr_returned_date_sk", - "cr_catalog_page_sk", - "cr_return_amount", - "cr_net_loss" + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450815i64 <= $.d_date_sk <= 2452907i64)" ], - "Estimated Cardinality": "14275" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "page_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "14275" + "Join Type": "INNER", + "Conditions": "date_sk = d_date_sk", + "Estimated Cardinality": "157932" } } ], - "extra_info": {} - }, - { - "name": "READ_VORTEX", - "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450815i64 <= $.d_date_sk <= 2452907i64)" + "Projections": [ + "cp_catalog_page_id", + "sales_price", + "profit", + "return_amt", + "net_loss" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "157932" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "date_sk = d_date_sk", - "Estimated Cardinality": "157932" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.cp_catalog_page_sk <= 9827i64)", - "Projections": [ - "cp_catalog_page_sk", - "cp_catalog_page_id" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], - "Estimated Cardinality": "11718" + "Estimated Cardinality": "11717" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "page_sk = cp_catalog_page_sk", - "Estimated Cardinality": "157932" + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "11717" } - } - ], - "extra_info": { - "Projections": [ - "cp_catalog_page_id", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "157932" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" - ], - "Estimated Cardinality": "95807" - } - } - ], - "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "95807" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_web_site_sk", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Projections": [ - "wsr_web_site_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_item_sk", - "ws_web_site_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_web_site_sk", + "ws_ext_sales_price", + "ws_net_profit" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "wsr_web_site_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_item_sk", + "ws_web_site_sk", + "ws_order_number" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "wr_returned_date_sk", + "wr_item_sk", + "wr_order_number", + "wr_return_amt", + "wr_net_loss" + ], + "Estimated Cardinality": "7037" + } + } + ], + "extra_info": { + "Join Type": "RIGHT", + "Conditions": [ + "ws_item_sk = wr_item_sk", + "ws_order_number = wr_order_number" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "wsr_web_site_sk", + "date_sk", + "sales_price", + "profit", + "return_amt", + "net_loss" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": {} }, { "name": "READ_VORTEX", @@ -2241,102 +2452,88 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "wr_returned_date_sk", - "wr_item_sk", - "wr_order_number", - "wr_return_amt", - "wr_net_loss" + "web_site_sk", + "web_site_id" ], - "Estimated Cardinality": "7037" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Join Type": "RIGHT", - "Conditions": [ - "ws_item_sk = wr_item_sk", - "ws_order_number = wr_order_number" + "Join Type": "INNER", + "Conditions": "wsr_web_site_sk = web_site_sk", + "Estimated Cardinality": "143264" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-06)", + "(2450816i64 <= $.d_date_sk <= 2452974i64)" ], - "Estimated Cardinality": "71632" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "wsr_web_site_sk", - "date_sk", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "date_sk = d_date_sk", + "Estimated Cardinality": "143264" } } ], - "extra_info": {} - }, - { - "name": "READ_VORTEX", - "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-06)", - "(2450816i64 <= $.d_date_sk <= 2452974i64)" + "Projections": [ + "web_site_id", + "sales_price", + "profit", + "return_amt", + "net_loss" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "143264" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "date_sk = d_date_sk", - "Estimated Cardinality": "143264" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "web_site_sk", - "web_site_id" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)", + "sum(#4)" ], "Estimated Cardinality": "3" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "wsr_web_site_sk = web_site_sk", - "Estimated Cardinality": "143264" + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "3" } } ], - "extra_info": { - "Projections": [ - "web_site_id", - "sales_price", - "profit", - "return_amt", - "net_loss" - ], - "Estimated Cardinality": "143264" - } + "extra_info": {} } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)", - "sum(#4)" + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "61937" + "Estimated Cardinality": "11721" } } ], @@ -2348,45 +2545,228 @@ physical_plan [ "returns_", "profit" ], - "Estimated Cardinality": "61937" + "Estimated Cardinality": "11721" } } ], - "extra_info": {} + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "sum(#2) EXPORT_STATE", + "sum(#3) EXPORT_STATE", + "sum(#4) EXPORT_STATE" + ], + "Estimated Cardinality": "5860" + } } ], "extra_info": { "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "350096" + "Estimated Cardinality": "5860" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "5860" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "5860" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "5860" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "2930" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2930" + } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "185", + "Estimated Cardinality": "2930" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2930" + } + } + ], + "extra_info": { + "Aggregates": [ + "combine_aggr(#0)", + "combine_aggr(#1)", + "combine_aggr(#2)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "185", + "Estimated Cardinality": "2930" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "2930" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "5860" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "5860" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_185", + "Table Index": "185", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "8791" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": [ - "sum(#2)", - "sum(#3)", - "sum(#4)" - ], - "Estimated Cardinality": "197658" + "CTE Name": "__grouping_sets_cte_181", + "Table Index": "181", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "8791" } } ], "extra_info": { "Top": "100", "Order By": [ - "x.channel ASC", - "x.id ASC" - ] + "channel ASC", + "id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q50.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q50.slt.no index 6987a0faa55..e3aa12cd239 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q50.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q50.slt.no @@ -393,16 +393,16 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.store.s_store_name", - "memory.main.store.s_company_id", - "memory.main.store.s_street_number", - "memory.main.store.s_street_name", - "memory.main.store.s_street_type", - "memory.main.store.s_suite_number", - "memory.main.store.s_city", - "memory.main.store.s_county", - "memory.main.store.s_state", - "memory.main.store.s_zip" + "s_store_name", + "s_company_id", + "s_street_number", + "s_street_name", + "s_street_type", + "s_suite_number", + "s_city", + "s_county", + "s_state", + "s_zip" ] } } @@ -441,97 +441,32 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ticket_number" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 8i64)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "5713" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(ss_ticket_number = sr_ticket_number)", - "(ss_item_sk = sr_item_sk)", - "(ss_customer_sk = sr_customer_sk)" - ], - "Estimated Cardinality": "57677" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -539,49 +474,46 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 8i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_name", - "s_company_id", - "s_street_number", - "s_street_name", - "s_street_type", - "s_suite_number", - "s_city", - "s_county", - "s_state", - "s_zip" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" + "Conditions": [ + "(ss_ticket_number = sr_ticket_number)", + "(ss_item_sk = sr_item_sk)", + "(ss_customer_sk = sr_customer_sk)" + ], + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } } @@ -589,7 +521,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -607,14 +539,14 @@ logical_opt [ "s_zip", "(sr_returned_date_sk - ss_sold_date_sk)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#1 AS TINYINT)", "#2", "#3", "#4", @@ -625,7 +557,7 @@ logical_opt [ "#9", "#10" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -649,14 +581,14 @@ logical_opt [ "sum(CASE WHEN (((#10 > 90) AND (#10 <= 120))) THEN (1) ELSE 0 END)", "sum(CASE WHEN ((#10 > 120)) THEN (1) ELSE 0 END)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -671,7 +603,7 @@ logical_opt [ "#13", "#14" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1" } } ], @@ -693,13 +625,13 @@ logical_opt [ "91-120 days", ">120 days" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "1" } } ] @@ -747,79 +679,80 @@ physical_plan [ } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_customer_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=8" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "5713" + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_name", + "s_company_id", + "s_street_number", + "s_street_name", + "s_street_type", + "s_suite_number", + "s_city", + "s_county", + "s_state", + "s_zip" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "ss_ticket_number = sr_ticket_number", - "ss_item_sk = sr_item_sk", - "ss_customer_sk = sr_customer_sk" - ], - "Estimated Cardinality": "57677" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_returned_date_sk", + "sr_item_sk", + "sr_customer_sk", + "sr_ticket_number" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 8i64)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_name", - "s_company_id", - "s_street_number", - "s_street_name", - "s_street_type", - "s_suite_number", - "s_city", - "s_county", - "s_state", - "s_zip" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "sr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Conditions": [ + "ss_ticket_number = sr_ticket_number", + "ss_item_sk = sr_item_sk", + "ss_customer_sk = sr_customer_sk" + ], + "Estimated Cardinality": "288464" } }, { @@ -836,7 +769,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -854,14 +787,14 @@ physical_plan [ "s_zip", "(sr_returned_date_sk - ss_sold_date_sk)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#1 AS TINYINT)", "#2", "#3", "#4", @@ -872,7 +805,7 @@ physical_plan [ "#9", "#10" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -894,7 +827,7 @@ physical_plan [ "CASE WHEN (((#10 > 90) AND (#10 <= 120))) THEN (1) ELSE 0 END", "CASE WHEN ((#10 > 120)) THEN (1) ELSE 0 END" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -918,14 +851,14 @@ physical_plan [ "sum(#13)", "sum(#14)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -940,24 +873,25 @@ physical_plan [ "#13", "#14" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.store.s_store_name ASC", - "memory.main.store.s_company_id ASC", - "memory.main.store.s_street_number ASC", - "memory.main.store.s_street_name ASC", - "memory.main.store.s_street_type ASC", - "memory.main.store.s_suite_number ASC", - "memory.main.store.s_city ASC", - "memory.main.store.s_county ASC", - "memory.main.store.s_state ASC", - "memory.main.store.s_zip ASC" - ] + "s_store_name ASC", + "s_company_id ASC", + "s_street_number ASC", + "s_street_name ASC", + "s_street_type ASC", + "s_suite_number ASC", + "s_city ASC", + "s_county ASC", + "s_state ASC", + "s_zip ASC" + ], + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q51.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q51.slt.no index 5dd6ba5aa99..1b6c33dd7fc 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q51.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q51.slt.no @@ -447,8 +447,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "y.item_sk", - "y.d_date" + "item_sk", + "d_date" ] } } @@ -493,263 +493,161 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "is_not_null($.ss_item_sk)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2" - ], + "Filters": "is_not_null($.ss_item_sk)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Groups": [ - "ss_item_sk", - "d_date" - ], - "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "57691" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "sum(sum(ss_sales_price)) OVER (PARTITION BY ss_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", - "Estimated Cardinality": "57691" + "Groups": [ + "ss_item_sk", + "d_date" + ], + "Expressions": "sum(ss_sales_price)", + "Estimated Cardinality": "57625" } } ], "extra_info": { "Expressions": [ - "item_sk", - "d_date", - "cume_sales" + "CAST(#0 AS BIGINT)", + "#1", + "#2" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "57691" + "Expressions": "sum(sum(ss_sales_price)) OVER (PARTITION BY ss_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", + "Estimated Cardinality": "57625" } }, { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "is_not_null($.ws_item_sk)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14326" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_sales_price" - ], - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "is_not_null($.ws_item_sk)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2" + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "ws_item_sk", - "d_date" - ], - "Expressions": "sum(ws_sales_price)", - "Estimated Cardinality": "14608" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2" ], - "Estimated Cardinality": "14608" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": "sum(sum(ws_sales_price)) OVER (PARTITION BY ws_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", - "Estimated Cardinality": "14608" + "Groups": [ + "ws_item_sk", + "d_date" + ], + "Expressions": "sum(ws_sales_price)", + "Estimated Cardinality": "14321" } } ], "extra_info": { "Expressions": [ - "item_sk", - "d_date", - "cume_sales" + "CAST(#0 AS BIGINT)", + "#1", + "#2" ], - "Estimated Cardinality": "14608" + "Estimated Cardinality": "14321" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "14608" + "Expressions": "sum(sum(ws_sales_price)) OVER (PARTITION BY ws_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", + "Estimated Cardinality": "14321" } } ], @@ -759,7 +657,7 @@ logical_opt [ "(item_sk = item_sk)", "(d_date = d_date)" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], @@ -770,7 +668,7 @@ logical_opt [ "web_sales", "store_sales" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], @@ -779,13 +677,13 @@ logical_opt [ "max(web_sales) OVER (PARTITION BY item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", "max(store_sales) OVER (PARTITION BY item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], "extra_info": { "Expressions": "(web_cumulative > store_cumulative)", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "11525" } } ], @@ -798,7 +696,7 @@ logical_opt [ "web_cumulative", "store_cumulative" ], - "Estimated Cardinality": "11538" + "Estimated Cardinality": "11525" } } ], @@ -811,7 +709,7 @@ logical_opt [ "web_cumulative", "store_cumulative" ], - "Estimated Cardinality": "11538" + "Estimated Cardinality": "11525" } } ], @@ -844,254 +742,230 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "is_not_null($.ss_item_sk)", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Filters": "is_not_null($.ss_item_sk)", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_sales_price" + ], "Estimated Cardinality": "57692" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_date" + ], + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "ss_item_sk", - "d_date", - "ss_sales_price" + "CAST(#0 AS SMALLINT)", + "#1", + "#2" ], "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" + "Projections": [ + "ss_item_sk", + "d_date", + "ss_sales_price" ], - "Aggregates": "sum(#2)", - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "57691" + "Aggregates": "sum(#2)", + "Estimated Cardinality": "57625" } } ], "extra_info": { - "Projections": "sum(sum(ss_sales_price)) OVER (PARTITION BY ss_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "57625" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "57691" + "Projections": "sum(sum(ss_sales_price)) OVER (PARTITION BY ss_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", + "Estimated Cardinality": "57625" } } ], "extra_info": { "Projections": [ - "item_sk", - "d_date", - "cume_sales" + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "is_not_null($.ws_item_sk)", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_sales_price" - ], - "Estimated Cardinality": "14326" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "is_not_null($.ws_item_sk)", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_sales_price" + ], + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_date" + ], "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Projections": [ - "ws_item_sk", - "d_date", - "ws_sales_price" + "CAST(#0 AS SMALLINT)", + "#1", + "#2" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" + "Projections": [ + "ws_item_sk", + "d_date", + "ws_sales_price" ], - "Aggregates": "sum(#2)", - "Estimated Cardinality": "14608" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "14608" + "Aggregates": "sum(#2)", + "Estimated Cardinality": "14321" } } ], "extra_info": { - "Projections": "sum(sum(ws_sales_price)) OVER (PARTITION BY ws_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "14321" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "14608" + "Projections": "sum(sum(ws_sales_price)) OVER (PARTITION BY ws_item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", + "Estimated Cardinality": "14321" } } ], "extra_info": { "Projections": [ - "item_sk", - "d_date", - "cume_sales" + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "14608" + "Estimated Cardinality": "14321" } } ], @@ -1101,7 +975,7 @@ physical_plan [ "item_sk = item_sk", "d_date = d_date" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], @@ -1112,7 +986,7 @@ physical_plan [ "web_sales", "store_sales" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], @@ -1120,7 +994,8 @@ physical_plan [ "Projections": [ "max(web_sales) OVER (PARTITION BY item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)", "max(store_sales) OVER (PARTITION BY item_sk ORDER BY d_date ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)" - ] + ], + "Estimated Cardinality": "57625" } } ], @@ -1133,22 +1008,23 @@ physical_plan [ "#4", "#5" ], - "Estimated Cardinality": "57691" + "Estimated Cardinality": "57625" } } ], "extra_info": { "Expression": "(web_cumulative > store_cumulative)", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "11525" } } ], "extra_info": { "Top": "100", "Order By": [ - "y.item_sk ASC", - "y.d_date ASC" - ] + "item_sk ASC", + "d_date ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q52.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q52.slt.no index 347dd9f3347..dab233e7322 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q52.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q52.slt.no @@ -213,9 +213,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "dt.d_year", - "sum(memory.main.store_sales.ss_ext_sales_price)", - "memory.main.item.i_brand_id" + "d_year", + "ext_price", + "brand_id" ] } } @@ -248,57 +248,28 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "2921" + "Filters": "($.i_manager_id = 1i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { @@ -308,37 +279,41 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.i_manager_id = 1i64)", + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#1, 2000)", "#0", - "__internal_compress_integral_uinteger(#2, 1001001)", + "CAST(#1 AS INTEGER)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -349,18 +324,18 @@ logical_opt [ "i_brand_id" ], "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2000)", + "__internal_decompress_integral_bigint(#0, 1900)", "#1", - "__internal_decompress_integral_bigint(#2, 1001001)", + "CAST(#2 AS BIGINT)", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -371,7 +346,7 @@ logical_opt [ "brand", "ext_price" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -424,54 +399,68 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=2000", - "d_moy=11" - ], + "Filters": "($.i_manager_id = 1i64)", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_brand_id", + "i_brand" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manager_id=1", "Projections": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#1, 2000)", "#0", - "__internal_compress_integral_uinteger(#2, 1001001)", + "CAST(#1 AS INTEGER)", + "#2", "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -482,7 +471,7 @@ physical_plan [ "i_brand_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -493,18 +482,18 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2000)", + "__internal_decompress_integral_bigint(#0, 1900)", "#1", - "__internal_decompress_integral_bigint(#2, 1001001)", + "CAST(#2 AS BIGINT)", "#3" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], @@ -515,17 +504,18 @@ physical_plan [ "brand", "ext_price" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57621" } } ], "extra_info": { "Top": "100", "Order By": [ - "dt.d_year ASC", - "sum(memory.main.store_sales.ss_ext_sales_price) DESC", - "memory.main.item.i_brand_id ASC" - ] + "d_year ASC", + "ext_price DESC", + "brand_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q53.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q53.slt.no index b7e5cbc0e8d..f595ba39740 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q53.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q53.slt.no @@ -321,9 +321,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "tmp1.avg_quarterly_sales", - "tmp1.sum_sales", - "tmp1.i_manufact_id" + "avg_quarterly_sales", + "sum_sales", + "i_manufact_id" ] } } @@ -344,19 +344,19 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -365,90 +365,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_qoy" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -465,70 +389,86 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_manufact_id" - ], - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288464" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "#0", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "i_manufact_id", - "d_qoy" + "Expressions": [ + "CAST(#1 AS SMALLINT)", + "#0", + "CAST(#2 AS TINYINT)" ], - "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "111295" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" + "Groups": [ + "i_manufact_id", + "d_qoy" ], - "Estimated Cardinality": "111295" + "Expressions": "sum(ss_sales_price)", + "Estimated Cardinality": "1368" } } ], "extra_info": { - "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manufact_id)", - "Estimated Cardinality": "111295" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2" + ], + "Estimated Cardinality": "1368" } } ], "extra_info": { - "Expressions": [ - "i_manufact_id", - "sum_sales", - "avg_quarterly_sales" - ], - "Estimated Cardinality": "111295" + "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manufact_id)", + "Estimated Cardinality": "1368" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((avg_quarterly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_quarterly_sales)) / avg_quarterly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "111295" + "Expressions": "(CASE WHEN ((avg_quarterly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_quarterly_sales)) / avg_quarterly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "273" } } ], @@ -538,7 +478,7 @@ logical_opt [ "sum_sales", "avg_quarterly_sales" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "273" } } ], @@ -553,10 +493,10 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { "name": "PROJECTION", @@ -605,21 +545,23 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "(((vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics)) or ((vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics)))", + "(vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics))", + "(vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics))", + "(vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics) or vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics))" ], "Projections": [ - "d_date_sk", - "d_qoy" + "i_item_sk", + "i_manufact_id" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -635,7 +577,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } }, { @@ -644,33 +586,31 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics)) or ((vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics)))", - "(vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics))", - "(vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics))", - "(vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics) or vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics))" + "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Projections": [ - "i_item_sk", - "i_manufact_id" + "d_date_sk", + "d_qoy" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ + "CAST(#1 AS SMALLINT)", "#0", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "CAST(#2 AS TINYINT)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], @@ -680,7 +620,7 @@ physical_plan [ "d_qoy", "ss_sales_price" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], @@ -690,22 +630,23 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "111295" + "Estimated Cardinality": "1368" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "1368" } } ], "extra_info": { - "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manufact_id)" + "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manufact_id)", + "Estimated Cardinality": "1368" } } ], @@ -716,33 +657,34 @@ physical_plan [ "#2", "#3" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "1368" } } ], "extra_info": { - "Projections": [ - "i_manufact_id", - "sum_sales", - "avg_quarterly_sales" - ], - "Estimated Cardinality": "111295" + "Expression": "(CASE WHEN ((avg_quarterly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_quarterly_sales)) / avg_quarterly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "273" } } ], "extra_info": { - "Expression": "(CASE WHEN ((avg_quarterly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_quarterly_sales)) / avg_quarterly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "111295" + "Projections": [ + "#0", + "#2", + "#3" + ], + "Estimated Cardinality": "273" } } ], "extra_info": { "Top": "100", "Order By": [ - "tmp1.avg_quarterly_sales ASC", - "tmp1.sum_sales ASC", - "tmp1.i_manufact_id ASC" - ] + "avg_quarterly_sales ASC", + "sum_sales ASC", + "i_manufact_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q54.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q54.slt.no index 5b88d846fc8..01ced0ca572 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q54.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q54.slt.no @@ -883,9 +883,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "segments.SEGMENT", - "count_star()", - "(segments.SEGMENT * 50)" + "SEGMENT", + "num_customers", + "segment_base" ] } } @@ -948,7 +948,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -956,599 +956,545 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_county", - "s_state" - ], - "Estimated Cardinality": "1" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_county", - "ca_state" - ], "Estimated Cardinality": "5000" } }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "UNION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk" + ], + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": [ + "sold_date_sk", + "customer_sk", + "item_sk" + ], "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "sold_date_sk", - "customer_sk", - "item_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_bill_customer_sk" + ], + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": [ + "sold_date_sk", + "customer_sk", + "item_sk" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk" + "Expressions": "", + "Estimated Cardinality": "215289" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.i_category = \"Women\")", + "($.i_class = \"maternity\")" ], - "Estimated Cardinality": "71632" + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "sold_date_sk", - "customer_sk", - "item_sk" - ], - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "(item_sk = i_item_sk)", + "Estimated Cardinality": "43057" } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "215289" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_moy = 12i64)", - "($.d_year = 1998i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(customer_sk = c_customer_sk)", + "Estimated Cardinality": "43057" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sold_date_sk = d_date_sk)", - "Estimated Cardinality": "43046" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": [ - "($.i_category = \"Women\")", - "($.i_class = \"maternity\")" + "($.d_moy = 12i64)", + "($.d_year = 1998i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(sold_date_sk = d_date_sk)", + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(item_sk = i_item_sk)", - "Estimated Cardinality": "8609" + "Expressions": [ + "c_customer_sk", + "c_current_addr_sk" + ], + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = customer_sk)", - "Estimated Cardinality": "8609" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Expressions": [ + "Expressions": "", + "Estimated Cardinality": "43037", + "Distinct Targets": [ "c_customer_sk", "c_current_addr_sk" - ], - "Estimated Cardinality": "8609" + ] } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "8609" + "Estimated Cardinality": "43037" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "8609", - "Distinct Targets": [ - "c_customer_sk", - "c_current_addr_sk" - ] - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" - ], - "Estimated Cardinality": "8609" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "8609" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "43037" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_month_seq" - ], - "Estimated Cardinality": "73049" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, { "name": "PROJECTION", "children": [ { - "name": "DISTINCT", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 12i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": "d_month_seq", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 12i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Expressions": "(d_month_seq + 1)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_month_seq", - "Estimated Cardinality": "2921" + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "(d_month_seq + 1)", - "Estimated Cardinality": "2921" + "Expressions": "", + "Estimated Cardinality": "2395", + "Distinct Targets": "(d_month_seq + 1)" } } ], "extra_info": { - "Expressions": "__internal_compress_integral_usmallint(#0, 1)", - "Estimated Cardinality": "2921" + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2921", - "Distinct Targets": "(d_month_seq + 1)" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "__internal_decompress_integral_bigint(#0, 1)", - "Estimated Cardinality": "2921" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(d_month_seq >= SUBQUERY)", + "Estimated Cardinality": "407" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_month_seq >= SUBQUERY)", - "Estimated Cardinality": "357" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "DISTINCT", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 12i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": "d_month_seq", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 12i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Expressions": "(d_month_seq + 3)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_month_seq", - "Estimated Cardinality": "2921" + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "(d_month_seq + 3)", - "Estimated Cardinality": "2921" + "Expressions": "", + "Estimated Cardinality": "2395", + "Distinct Targets": "(d_month_seq + 3)" } } ], "extra_info": { - "Expressions": "__internal_compress_integral_usmallint(#0, 3)", - "Estimated Cardinality": "2921" + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2921", - "Distinct Targets": "(d_month_seq + 3)" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "__internal_decompress_integral_bigint(#0, 3)", - "Estimated Cardinality": "2921" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(d_month_seq <= SUBQUERY)", + "Estimated Cardinality": "2" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "8" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(d_month_seq <= SUBQUERY)", - "Estimated Cardinality": "1" + "Conditions": "(c_customer_sk = ss_customer_sk)", + "Estimated Cardinality": "38" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "6" + "Expressions": [ + "#0", + "#2", + "CAST(#1 AS BIGINT)" + ], + "Estimated Cardinality": "38" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ss_customer_sk)", - "Estimated Cardinality": "0" + "Expressions": [ + "#0", + "#2", + "#1" + ], + "Estimated Cardinality": "38" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ca_address_sk = c_current_addr_sk)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "(s_county = ca_county)", - "(s_state = ca_state)" + "(ca_county = s_county)", + "(ca_state = s_state)" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" } } ], "extra_info": { "Expressions": [ - "#0", + "CAST(#0 AS SMALLINT)", "#1", - "__internal_compress_integral_usmallint(#2, 1)", + "#2", "#3" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" } } ], "extra_info": { "Groups": "c_customer_sk", "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Expressions": "revenue", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Expressions": "#0", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Expressions": "SEGMENT", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Expressions": "#0", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Groups": "SEGMENT", "Expressions": "count_star()", - "Estimated Cardinality": "0" + "Estimated Cardinality": "23" } } ], @@ -1558,13 +1504,13 @@ logical_opt [ "num_customers", "segment_base" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "23" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "0" + "Estimated Cardinality": "23" } } ] @@ -1602,18 +1548,6 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_county", - "s_state" - ], - "Estimated Cardinality": "1" - } - }, { "name": "HASH_JOIN", "children": [ @@ -1631,88 +1565,121 @@ physical_plan [ } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "HASH_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "UNION", + "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "UNION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_bill_customer_sk" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "sold_date_sk", + "customer_sk", + "item_sk" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": {} + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk" + "Filters": [ + "($.i_category = \"Women\")", + "($.i_class = \"maternity\")" ], - "Estimated Cardinality": "71632" + "Projections": "i_item_sk", + "Estimated Cardinality": "360" } } ], "extra_info": { + "Join Type": "INNER", + "Conditions": "item_sk = i_item_sk", + "Estimated Cardinality": "43057" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", "Projections": [ - "sold_date_sk", - "customer_sk", - "item_sk" + "c_customer_sk", + "c_current_addr_sk" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "10000" } } ], - "extra_info": {} + "extra_info": { + "Join Type": "INNER", + "Conditions": "customer_sk = c_customer_sk", + "Estimated Cardinality": "43057" + } }, { "name": "READ_VORTEX", @@ -1720,45 +1687,37 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "d_year=1998", - "d_moy=12" + "($.d_moy = 12i64)", + "($.d_year = 1998i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "sold_date_sk = d_date_sk", - "Estimated Cardinality": "43046" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "i_class='maternity'", - "i_category='Women'" - ], - "Projections": "i_item_sk", - "Estimated Cardinality": "72" + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "item_sk = i_item_sk", - "Estimated Cardinality": "8609" + "Projections": [ + "c_customer_sk", + "c_current_addr_sk" + ], + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_customer_sk = customer_sk", - "Estimated Cardinality": "8609" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "43057" } } ], @@ -1767,317 +1726,333 @@ physical_plan [ "c_customer_sk", "c_current_addr_sk" ], - "Estimated Cardinality": "8609" + "Estimated Cardinality": "43057" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "8609" + "Aggregates": "", + "Estimated Cardinality": "43057" } } ], "extra_info": { "Projections": [ - "c_customer_sk", - "c_current_addr_sk" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "8609" + "Estimated Cardinality": "43037" } - } - ], - "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "", - "Estimated Cardinality": "8609" - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" - ], - "Estimated Cardinality": "8609" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "NESTED_LOOP_JOIN", - "children": [ + }, { - "name": "NESTED_LOOP_JOIN", + "name": "HASH_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", "Projections": [ - "d_date_sk", - "d_month_seq" + "ss_sold_date_sk", + "ss_customer_sk", + "ss_ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "NESTED_LOOP_JOIN", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "NESTED_LOOP_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Projections": [ + "d_date_sk", + "d_month_seq" + ], + "Estimated Cardinality": "73049" + } + }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 12i64)" + ], + "Projections": "d_month_seq", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": "(d_month_seq + 1)", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=12" - ], - "Projections": "d_month_seq", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Projections": "(d_month_seq + 1)", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "__internal_compress_integral_usmallint(#0, 1)", - "Estimated Cardinality": "2921" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "(d_month_seq + 1)", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "2921" + "Projections": "#0", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Projections": "__internal_decompress_integral_bigint(#0, 1)", - "Estimated Cardinality": "2921" + "Aggregates": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "2921" + "Projections": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Join Type": "INNER", + "Conditions": "d_month_seq >= SUBQUERY", + "Estimated Cardinality": "407" } - } - ], - "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "d_month_seq >= SUBQUERY", - "Estimated Cardinality": "357" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 12i64)" + ], + "Projections": "d_month_seq", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": "(d_month_seq + 3)", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=12" - ], - "Projections": "d_month_seq", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Projections": "(d_month_seq + 3)", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "__internal_compress_integral_usmallint(#0, 3)", - "Estimated Cardinality": "2921" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "(d_month_seq + 3)", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "2921" + "Projections": "#0", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Projections": "__internal_decompress_integral_bigint(#0, 3)", - "Estimated Cardinality": "2921" + "Aggregates": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "2921" + "Projections": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Join Type": "INNER", + "Conditions": "d_month_seq <= SUBQUERY", + "Estimated Cardinality": "2" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "8" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "d_month_seq <= SUBQUERY", - "Estimated Cardinality": "1" + "Conditions": "c_customer_sk = ss_customer_sk", + "Estimated Cardinality": "38" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "6" + "Projections": [ + "#0", + "#2", + "CAST(#1 AS BIGINT)" + ], + "Estimated Cardinality": "38" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_customer_sk = ss_customer_sk", - "Estimated Cardinality": "0" + "Projections": [ + "#0", + "#2", + "#1" + ], + "Estimated Cardinality": "38" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ca_address_sk = c_current_addr_sk", - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_county", + "s_state" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "s_county = ca_county", - "s_state = ca_state" + "ca_county = s_county", + "ca_state = s_state" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" } } ], "extra_info": { "Projections": [ - "#0", + "CAST(#0 AS SMALLINT)", "#1", - "__internal_compress_integral_usmallint(#2, 1)", + "#2", "#3" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" } } ], @@ -2086,48 +2061,48 @@ physical_plan [ "c_customer_sk", "ss_ext_sales_price" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "38" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Projections": "revenue", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Projections": "SEGMENT", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Projections": "SEGMENT", - "Estimated Cardinality": "0" + "Estimated Cardinality": "37" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "0" + "Estimated Cardinality": "23" } } ], @@ -2137,17 +2112,14 @@ physical_plan [ "num_customers", "segment_base" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "23" } } ], "extra_info": { "Top": "100", - "Order By": [ - "segments.SEGMENT ASC", - "count_star() ASC", - "(segments.SEGMENT * 50) ASC" - ] + "Order By": "SEGMENT ASC", + "Estimated Cardinality": "23" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q55.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q55.slt.no index 85a045049ea..5c8ded7564b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q55.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q55.slt.no @@ -208,8 +208,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price)", - "memory.main.item.i_brand_id" + "ext_price", + "brand_id" ] } } @@ -242,93 +242,59 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 1999i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "($.i_manager_id = 28i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_manager_id = 28i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "72" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_uinteger(#1, 1001001)", - "#2" + "CAST(#1 AS INTEGER)", + "#2", + "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -338,17 +304,17 @@ logical_opt [ "i_brand_id" ], "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], @@ -358,7 +324,7 @@ logical_opt [ "brand", "ext_price" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], @@ -411,19 +377,20 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=1999", - "d_moy=11" + "Filters": "($.i_manager_id = 28i64)", + "Projections": [ + "i_item_sk", + "i_brand_id", + "i_brand" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -431,30 +398,31 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "i_manager_id=28", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_brand" + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "72" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_uinteger(#1, 1001001)", - "#2" + "CAST(#1 AS INTEGER)", + "#2", + "#3" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -464,7 +432,7 @@ physical_plan [ "i_brand_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -474,17 +442,17 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], @@ -494,16 +462,17 @@ physical_plan [ "brand", "ext_price" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "46060" } } ], "extra_info": { "Top": "100", "Order By": [ - "sum(memory.main.store_sales.ss_ext_sales_price) DESC", - "memory.main.item.i_brand_id ASC" - ] + "ext_price DESC", + "brand_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q56.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q56.slt.no index 89c2afa05ed..36f46c737cf 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q56.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q56.slt.no @@ -1034,8 +1034,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(tmp1.total_sales)", - "tmp1.i_item_id" + "total_sales", + "i_item_id" ] } } @@ -1098,152 +1098,108 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_addr_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "2307" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1252,7 +1208,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1261,7 +1217,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1270,7 +1226,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } }, { @@ -1289,93 +1245,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_addr_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 2i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "5744" + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1383,64 +1269,90 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Filters": "", "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_id", + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(cs_bill_addr_sk = ca_address_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "1148" + "Conditions": "(d_date_sk = cs_sold_date_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(cs_ext_sales_price)", - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1449,7 +1361,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1458,7 +1370,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1467,7 +1379,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } }, { @@ -1486,93 +1398,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_addr_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2864" + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1580,64 +1422,90 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Filters": "", "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_id", + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ws_bill_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "572" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1646,7 +1514,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1655,7 +1523,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1664,20 +1532,20 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "4009" + "Estimated Cardinality": "4956" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(total_sales)", - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], @@ -1686,7 +1554,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], @@ -1739,23 +1607,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -1763,55 +1650,37 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", - "Projections": "i_item_id", - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "2307" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } } ], @@ -1820,14 +1689,14 @@ physical_plan [ "i_item_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } }, { @@ -1839,6 +1708,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1860,23 +1743,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" } }, { @@ -1884,55 +1786,23 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "5744" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", - "Projections": "i_item_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "1148" + "Conditions": "d_date_sk = cs_sold_date_sk", + "Estimated Cardinality": "5746" } } ], @@ -1941,14 +1811,14 @@ physical_plan [ "i_item_id", "cs_ext_sales_price" ], - "Estimated Cardinality": "1148" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } }, { @@ -1960,6 +1830,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1981,23 +1865,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" } }, { @@ -2005,55 +1908,23 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "2864" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"slate\", \"blanched\", \"burnished\"], $.i_color, opts=sql_null_semantics)", - "Projections": "i_item_id", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "572" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "2865" } } ], @@ -2062,14 +1933,14 @@ physical_plan [ "i_item_id", "ws_ext_sales_price" ], - "Estimated Cardinality": "572" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -2081,23 +1952,24 @@ physical_plan [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "4009" + "Estimated Cardinality": "4956" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], "extra_info": { "Top": "100", "Order By": [ - "sum(tmp1.total_sales) ASC", - "tmp1.i_item_id ASC" - ] + "total_sales ASC", + "i_item_id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q57.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q57.slt.no index 5c097b1ff56..bfffa369b05 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q57.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q57.slt.no @@ -317,7 +317,7 @@ logical_plan [ "extra_info": { "Expressions": [ "avg(sum(cs_sales_price)) OVER (PARTITION BY i_category, i_brand, cc_name, d_year)", - "RANK() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "rank() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" ] } } @@ -535,58 +535,27 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_call_center_sk", - "cs_item_sk", - "cs_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "((($.d_year = 1999i64) or (($.d_year = 1998i64) and ($.d_moy = 12i64))) or (($.d_year = 2000i64) and ($.d_moy = 1i64)))", - "((($.d_year = 1999i64) or ($.d_year = 1998i64)) or ($.d_year = 2000i64))", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "14609" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Conditions": "(cs_call_center_sk = cc_call_center_sk)", "Estimated Cardinality": "143657" } }, @@ -597,46 +566,39 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "((($.d_year = 1999i64) or (($.d_year = 1998i64) and ($.d_moy = 12i64))) or (($.d_year = 2000i64) and ($.d_moy = 1i64)))", + "((($.d_year = 1999i64) or ($.d_year = 1998i64)) or ($.d_year = 2000i64))", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": [ - "cc_call_center_sk", - "cc_name" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_call_center_sk = cc_call_center_sk)", + "Conditions": "(cs_sold_date_sk = d_date_sk)", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand", - "i_category" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -651,9 +613,9 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", - "__internal_compress_integral_utinyint(#2, 1)", + "#1", "#3", + "CAST(#2 AS TINYINT)", "#4", "#5" ], @@ -670,7 +632,7 @@ logical_opt [ "d_moy" ], "Expressions": "sum(cs_sales_price)", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } } ], @@ -680,19 +642,19 @@ logical_opt [ "#1", "#2", "__internal_decompress_integral_bigint(#3, 1900)", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } } ], "extra_info": { "Expressions": [ "avg(sum(cs_sales_price)) OVER (PARTITION BY i_category, i_brand, cc_name, d_year)", - "RANK() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "rank() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } } ], @@ -707,7 +669,7 @@ logical_opt [ "avg_monthly_sales", "rn" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } }, { @@ -723,114 +685,77 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_category = i_category)", - "(i_brand = i_brand)", - "(cc_name = cc_name)", - "((rn + 1) = (rn - 1))" - ], - "Estimated Cardinality": "11465185" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "(d_year = 1999)", - "(avg_monthly_sales > 0.0)" - ], - "Estimated Cardinality": "143657" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_category = i_category)", - "(i_brand = i_brand)", - "(cc_name = cc_name)", - "((rn - 1) = rn)", - "((rn + 1) = rn)" - ], - "Estimated Cardinality": "915030074" + "CTE Index": "0", + "Estimated Cardinality": "143655" } } ], "extra_info": { "Expressions": [ - "i_category", - "i_brand", - "cc_name", - "d_year", - "d_moy", - "avg_monthly_sales", - "sum_sales", - "psum", - "nsum" + "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "(d_year = 1999)", + "(avg_monthly_sales > 0.0)" ], - "Estimated Cardinality": "915030074" + "Estimated Cardinality": "143655" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "143655" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "143655" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(i_category = i_category)", + "(i_brand = i_brand)", + "(cc_name = cc_name)", + "((rn + 1) = (rn - 1))" + ], + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8" + "Join Type": "INNER", + "Conditions": [ + "(i_category = i_category)", + "(i_brand = i_brand)", + "(cc_name = cc_name)", + "(rn = (rn - 1))", + "(rn = (rn + 1))" ], - "Estimated Cardinality": "915030074" + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "915030074" + "Expressions": "", + "Estimated Cardinality": "143655" } } ], @@ -847,7 +772,7 @@ logical_opt [ "nsum", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "915030074" + "Estimated Cardinality": "143655" } } ], @@ -928,6 +853,28 @@ physical_plan [ "Estimated Cardinality": "143657" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cc_call_center_sk", + "cc_name" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_call_center_sk = cc_call_center_sk", + "Estimated Cardinality": "143657" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "READ_VORTEX", "children": [], @@ -948,27 +895,19 @@ physical_plan [ } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "cc_call_center_sk", - "cc_name" + "#0", + "#1", + "#2", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_call_center_sk = cc_call_center_sk", + "Conditions": "cs_sold_date_sk = d_date_sk", "Estimated Cardinality": "143657" } }, @@ -996,9 +935,9 @@ physical_plan [ "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", - "__internal_compress_integral_utinyint(#2, 1)", + "#1", "#3", + "CAST(#2 AS TINYINT)", "#4", "#5" ], @@ -1028,7 +967,7 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } } ], @@ -1038,20 +977,22 @@ physical_plan [ "#1", "#2", "__internal_decompress_integral_bigint(#3, 1900)", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Projections": "avg(sum(cs_sales_price)) OVER (PARTITION BY i_category, i_brand, cc_name, d_year)" + "Projections": "avg(sum(cs_sales_price)) OVER (PARTITION BY i_category, i_brand, cc_name, d_year)", + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY i_category, i_brand, cc_name ORDER BY d_year ASC NULLS LAST, d_moy ASC NULLS LAST)", + "Estimated Cardinality": "143655" } } ], @@ -1066,7 +1007,7 @@ physical_plan [ "#6", "#7" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "143655" } }, { @@ -1079,95 +1020,67 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_category = i_category", - "i_brand = i_brand", - "cc_name = cc_name", - "(rn + 1) = (rn - 1)" - ], - "Estimated Cardinality": "11465185" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expression": "((d_year = 1999) AND (avg_monthly_sales > 0.0))", - "Estimated Cardinality": "143657" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_category = i_category", - "i_brand = i_brand", - "cc_name = cc_name", - "(rn - 1) = rn", - "(rn + 1) = rn" - ], - "Estimated Cardinality": "915030074" + "CTE Index": "0", + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Projections": [ - "i_category", - "i_brand", - "cc_name", - "d_year", - "d_moy", - "avg_monthly_sales", - "sum_sales", - "psum", - "nsum" + "Expression": "((CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1) AND (d_year = 1999) AND (avg_monthly_sales > 0.0))", + "Estimated Cardinality": "143655" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "143655" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "143655" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "i_category = i_category", + "i_brand = i_brand", + "cc_name = cc_name", + "(rn + 1) = (rn - 1)" ], - "Estimated Cardinality": "915030074" + "Estimated Cardinality": "143655" } } ], "extra_info": { - "Expression": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "915030074" + "Join Type": "INNER", + "Conditions": [ + "i_category = i_category", + "i_brand = i_brand", + "cc_name = cc_name", + "rn = (rn - 1)", + "rn = (rn + 1)" + ], + "Estimated Cardinality": "143655" } } ], @@ -1184,7 +1097,7 @@ physical_plan [ "nsum", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "915030074" + "Estimated Cardinality": "143655" } } ], @@ -1201,7 +1114,8 @@ physical_plan [ "sum_sales ASC", "psum ASC", "nsum ASC" - ] + ], + "Estimated Cardinality": "100" } } ], @@ -1224,6 +1138,7 @@ physical_plan [ "extra_info": { "CTE Name": "v1", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q58.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q58.slt.no index 5516e6e773f..2db3a7f61a5 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q58.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q58.slt.no @@ -1194,8 +1194,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "ss_items.item_id", - "ss_items.ss_item_rev" + "item_id", + "ss_item_rev" ] } } @@ -1240,22 +1240,40 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1263,40 +1281,6 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], "Estimated Cardinality": "73049" } }, @@ -1304,178 +1288,139 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.d_date = 2000-01-03)", - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" + "Filters": "($.d_date = 2000-01-03)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = SUBQUERY)", - "Estimated Cardinality": "25" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "d_date", - "Estimated Cardinality": "25" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_date = #0)", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(d_week_seq = SUBQUERY)", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" + "Expressions": "d_date", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "28731" + "Join Type": "SEMI", + "Conditions": "(d_date = #0)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(cs_ext_sales_price)", - "Estimated Cardinality": "26040" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "item_id", - "cs_item_rev" - ], - "Estimated Cardinality": "26040" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "26040" + "Groups": "i_item_id", + "Expressions": "sum(ss_ext_sales_price)", + "Estimated Cardinality": "1799" } }, { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1483,40 +1428,6 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], "Estimated Cardinality": "73049" } }, @@ -1524,159 +1435,102 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.d_date = 2000-01-03)", - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" + "Filters": "($.d_date = 2000-01-03)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = SUBQUERY)", - "Estimated Cardinality": "25" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "d_date", - "Estimated Cardinality": "25" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_date = #0)", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14609" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(d_week_seq = SUBQUERY)", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" + "Expressions": "d_date", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", + "Join Type": "SEMI", + "Conditions": "(d_date = #0)", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "13215" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "item_id", - "ws_item_rev" - ], - "Estimated Cardinality": "13215" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "13215" + "Groups": "i_item_id", + "Expressions": "sum(cs_ext_sales_price)", + "Estimated Cardinality": "1799" } } ], @@ -1684,31 +1538,49 @@ logical_opt [ "Join Type": "INNER", "Conditions": [ "(item_id = item_id)", - "(CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev))", - "((0.9 * cs_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3)))", - "(CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev))", - "((1.1 * cs_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3)))" + "(CAST(ss_item_rev AS DECIMAL(38,3)) >= (0.9 * cs_item_rev))", + "((0.9 * ss_item_rev) <= CAST(cs_item_rev AS DECIMAL(38,3)))", + "(CAST(ss_item_rev AS DECIMAL(38,3)) <= (1.1 * cs_item_rev))", + "((1.1 * ss_item_rev) >= CAST(cs_item_rev AS DECIMAL(38,3)))" ], - "Estimated Cardinality": "199512" + "Estimated Cardinality": "1798" } }, { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1716,40 +1588,6 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], "Estimated Cardinality": "73049" } }, @@ -1757,159 +1595,102 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.d_date = 2000-01-03)", - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "2921" + "Filters": "($.d_date = 2000-01-03)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Expressions": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = SUBQUERY)", - "Estimated Cardinality": "25" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "d_date", - "Estimated Cardinality": "25" + "Expressions": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_date = #0)", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Join Type": "INNER", + "Conditions": "(d_week_seq = SUBQUERY)", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" + "Expressions": "d_date", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "57692" + "Join Type": "SEMI", + "Conditions": "(d_date = #0)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "52288" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "item_id", - "ss_item_rev" - ], - "Estimated Cardinality": "52288" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "52288" + "Groups": "i_item_id", + "Expressions": "sum(ws_ext_sales_price)", + "Estimated Cardinality": "1799" } } ], @@ -1917,16 +1698,16 @@ logical_opt [ "Join Type": "INNER", "Conditions": [ "(item_id = item_id)", - "((0.9 * ws_item_rev) <= CAST(ss_item_rev AS DECIMAL(38,3)))", - "(CAST(ws_item_rev AS DECIMAL(38,3)) >= (0.9 * ss_item_rev))", - "((1.1 * ws_item_rev) >= CAST(ss_item_rev AS DECIMAL(38,3)))", - "(CAST(ws_item_rev AS DECIMAL(38,3)) <= (1.1 * ss_item_rev))", - "((0.9 * cs_item_rev) <= CAST(ss_item_rev AS DECIMAL(38,3)))", - "(CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ss_item_rev))", - "((1.1 * cs_item_rev) >= CAST(ss_item_rev AS DECIMAL(38,3)))", - "(CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ss_item_rev))" + "(CAST(ss_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev))", + "((0.9 * ss_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3)))", + "(CAST(ss_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev))", + "((1.1 * ss_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3)))", + "(CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev))", + "((0.9 * cs_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3)))", + "(CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev))", + "((1.1 * cs_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3)))" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], @@ -1938,7 +1719,7 @@ logical_opt [ "cs_item_rev", "ws_item_rev" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], @@ -1953,7 +1734,7 @@ logical_opt [ "ws_dev", "average" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], @@ -1997,11 +1778,11 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_sales_price" + "ss_sold_date_sk", + "ss_item_sk", + "ss_ext_sales_price" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "288464" } }, { @@ -2012,7 +1793,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", "Projections": [ "d_date_sk", "d_date" @@ -2052,15 +1833,15 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_date='2000-01-03'::DATE", + "Filters": "($.d_date = 2000-01-03)", "Projections": "d_week_seq", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], @@ -2068,7 +1849,8 @@ physical_plan [ "Aggregates": [ "\"first\"(#0)", "count_star()" - ] + ], + "Estimated Cardinality": "1" } } ], @@ -2084,13 +1866,13 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_week_seq = SUBQUERY", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], "extra_info": { "Projections": "d_date", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], @@ -2103,8 +1885,8 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28731" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } }, { @@ -2122,24 +1904,24 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "28731" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ "i_item_id", - "cs_ext_sales_price" + "ss_ext_sales_price" ], - "Estimated Cardinality": "28731" + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "26040" + "Estimated Cardinality": "1799" } }, { @@ -2160,11 +1942,11 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_sales_price" + "cs_sold_date_sk", + "cs_item_sk", + "cs_ext_sales_price" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "143657" } }, { @@ -2175,7 +1957,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", "Projections": [ "d_date_sk", "d_date" @@ -2215,15 +1997,15 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_date='2000-01-03'::DATE", + "Filters": "($.d_date = 2000-01-03)", "Projections": "d_week_seq", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], @@ -2231,7 +2013,8 @@ physical_plan [ "Aggregates": [ "\"first\"(#0)", "count_star()" - ] + ], + "Estimated Cardinality": "1" } } ], @@ -2247,13 +2030,13 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_week_seq = SUBQUERY", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], "extra_info": { "Projections": "d_date", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], @@ -2266,8 +2049,8 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14609" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } }, { @@ -2285,24 +2068,24 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "14609" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { "Projections": [ "i_item_id", - "ws_ext_sales_price" + "cs_ext_sales_price" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "13215" + "Estimated Cardinality": "1799" } } ], @@ -2310,12 +2093,12 @@ physical_plan [ "Join Type": "INNER", "Conditions": [ "item_id = item_id", - "CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev)", - "(0.9 * cs_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3))", - "CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev)", - "(1.1 * cs_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3))" + "CAST(ss_item_rev AS DECIMAL(38,3)) >= (0.9 * cs_item_rev)", + "(0.9 * ss_item_rev) <= CAST(cs_item_rev AS DECIMAL(38,3))", + "CAST(ss_item_rev AS DECIMAL(38,3)) <= (1.1 * cs_item_rev)", + "(1.1 * ss_item_rev) >= CAST(cs_item_rev AS DECIMAL(38,3))" ], - "Estimated Cardinality": "199512" + "Estimated Cardinality": "1798" } }, { @@ -2336,11 +2119,11 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" + "ws_sold_date_sk", + "ws_item_sk", + "ws_ext_sales_price" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "71632" } }, { @@ -2391,15 +2174,15 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_date='2000-01-03'::DATE", + "Filters": "($.d_date = 2000-01-03)", "Projections": "d_week_seq", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], @@ -2407,7 +2190,8 @@ physical_plan [ "Aggregates": [ "\"first\"(#0)", "count_star()" - ] + ], + "Estimated Cardinality": "1" } } ], @@ -2423,13 +2207,13 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_week_seq = SUBQUERY", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], "extra_info": { "Projections": "d_date", - "Estimated Cardinality": "25" + "Estimated Cardinality": "6" } } ], @@ -2442,8 +2226,8 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57692" + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } }, { @@ -2461,24 +2245,24 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "57692" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Projections": [ "i_item_id", - "ss_ext_sales_price" + "ws_ext_sales_price" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "14326" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "52288" + "Estimated Cardinality": "1799" } } ], @@ -2486,16 +2270,16 @@ physical_plan [ "Join Type": "INNER", "Conditions": [ "item_id = item_id", - "(0.9 * ws_item_rev) <= CAST(ss_item_rev AS DECIMAL(38,3))", - "CAST(ws_item_rev AS DECIMAL(38,3)) >= (0.9 * ss_item_rev)", - "(1.1 * ws_item_rev) >= CAST(ss_item_rev AS DECIMAL(38,3))", - "CAST(ws_item_rev AS DECIMAL(38,3)) <= (1.1 * ss_item_rev)", - "(0.9 * cs_item_rev) <= CAST(ss_item_rev AS DECIMAL(38,3))", - "CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ss_item_rev)", - "(1.1 * cs_item_rev) >= CAST(ss_item_rev AS DECIMAL(38,3))", - "CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ss_item_rev)" + "CAST(ss_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev)", + "(0.9 * ss_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3))", + "CAST(ss_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev)", + "(1.1 * ss_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3))", + "CAST(cs_item_rev AS DECIMAL(38,3)) >= (0.9 * ws_item_rev)", + "(0.9 * cs_item_rev) <= CAST(ws_item_rev AS DECIMAL(38,3))", + "CAST(cs_item_rev AS DECIMAL(38,3)) <= (1.1 * ws_item_rev)", + "(1.1 * cs_item_rev) >= CAST(ws_item_rev AS DECIMAL(38,3))" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], @@ -2507,7 +2291,7 @@ physical_plan [ "cs_item_rev", "ws_item_rev" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], @@ -2522,16 +2306,17 @@ physical_plan [ "ws_dev", "average" ], - "Estimated Cardinality": "6048310" + "Estimated Cardinality": "1797" } } ], "extra_info": { "Top": "100", "Order By": [ - "ss_items.item_id ASC", - "ss_items.ss_item_rev ASC" - ] + "item_id ASC", + "ss_item_rev ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q59.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q59.slt.no index 507038cd9ee..cc101cb3cd3 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q59.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q59.slt.no @@ -571,9 +571,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "y.s_store_name1", - "y.s_store_id1", - "y.d_week_seq1" + "s_store_name1", + "s_store_id1", + "d_week_seq1" ] } } @@ -609,46 +609,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_week_seq", - "d_day_name" - ], + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } } @@ -662,9 +636,9 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS TINYINT)", "#1", - "__internal_compress_integral_usmallint(#2, 1)", + "CAST(#2 AS SMALLINT)", "#3" ], "Estimated Cardinality": "288464" @@ -677,22 +651,22 @@ logical_opt [ "ss_store_sk" ], "Expressions": [ - "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL END)", - "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL END)" + "sum(CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)", + "sum(CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -701,7 +675,7 @@ logical_opt [ "#7", "#8" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } } ], @@ -717,20 +691,20 @@ logical_opt [ "fri_sales", "sat_sales" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -739,15 +713,33 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "9914" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "9914" + } + } + ], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "(d_week_seq1 = (d_week_seq2 - 52))", + "Estimated Cardinality": "9418" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -757,86 +749,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id", - "s_store_name" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288463" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1212i64 <= $.d_month_seq <= 1223i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = d_week_seq)", - "Estimated Cardinality": "288463" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_name1", - "d_week_seq1", - "s_store_id1", - "sun_sales1", - "mon_sales1", - "tue_sales1", - "wed_sales1", - "thu_sales1", - "fri_sales1", - "sat_sales1" - ], - "Estimated Cardinality": "288463" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288463" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -848,35 +761,27 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id" - ], + "Join Type": "INNER", + "Conditions": "(s_store_id1 = s_store_id2)", "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288463" + "Conditions": [ + "(ss_store_sk = s_store_sk)", + "(ss_store_sk = s_store_sk)" + ], + "Estimated Cardinality": "9418" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1224i64 <= $.d_month_seq <= 1235i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_week_seq", + "Filters": "(1224i64 <= $.d_month_seq <= 1235i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -884,55 +789,62 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(d_week_seq = d_week_seq)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "13184" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(1212i64 <= $.d_month_seq <= 1223i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "d_week_seq2", - "s_store_id2", - "sun_sales2", - "mon_sales2", - "tue_sales2", - "wed_sales2", - "thu_sales2", - "fri_sales2", - "sat_sales2" - ], - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "(d_week_seq = d_week_seq)", + "Estimated Cardinality": "18455" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(s_store_id1 = s_store_id2)", - "(d_week_seq1 = (d_week_seq2 - 52))" + "Expressions": [ + "s_store_name1", + "s_store_id1", + "d_week_seq1", + "sun_sales_ratio", + "mon_sales_ratio", + "tue_sales_ratio", + "wed_sales_ratio", + "thu_sales_ratio", + "fri_sales_ratio", + "sat_sales_ratio" ], - "Estimated Cardinality": "288462" + "Estimated Cardinality": "18455" } } ], "extra_info": { - "Expressions": [ - "s_store_name1", - "s_store_id1", - "d_week_seq1", - "sun_sales_ratio", - "mon_sales_ratio", - "tue_sales_ratio", - "wed_sales_ratio", - "thu_sales_ratio", - "fri_sales_ratio", - "sat_sales_ratio" - ], - "Estimated Cardinality": "288462" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], "Estimated Cardinality": "100" } } @@ -1000,9 +912,9 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS TINYINT)", "#1", - "__internal_compress_integral_usmallint(#2, 1)", + "CAST(#2 AS SMALLINT)", "#3" ], "Estimated Cardinality": "288464" @@ -1013,13 +925,13 @@ physical_plan [ "Projections": [ "d_week_seq", "ss_store_sk", - "CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL END", - "CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL END" + "CASE WHEN ((d_day_name = 'Sunday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Monday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Tuesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Wednesday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Thursday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Friday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END", + "CASE WHEN ((d_day_name = 'Saturday')) THEN (ss_sales_price) ELSE NULL::DECIMAL(7,2) END" ], "Estimated Cardinality": "288464" } @@ -1039,14 +951,14 @@ physical_plan [ "sum(#7)", "sum(#8)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -1055,7 +967,7 @@ physical_plan [ "#7", "#8" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } }, { @@ -1068,7 +980,7 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -1081,78 +993,38 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "9914" } }, { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_id", - "s_store_name" - ], - "Estimated Cardinality": "1" + "CTE Index": "0", + "Estimated Cardinality": "9914" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288463" + "Conditions": "d_week_seq1 = (d_week_seq2 - 52)", + "Estimated Cardinality": "9418" } }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1212i64 <= $.d_month_seq <= 1223i64)", - "Projections": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "d_week_seq = d_week_seq", - "Estimated Cardinality": "288463" - } - } - ], - "extra_info": { - "Projections": [ - "s_store_name1", - "d_week_seq1", - "s_store_id1", - "sun_sales1", - "mon_sales1", - "tue_sales1", - "wed_sales1", - "thu_sales1", - "fri_sales1", - "sat_sales1" - ], - "Estimated Cardinality": "288463" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "288463" + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_id", + "s_store_name" + ], + "Estimated Cardinality": "1" } }, { @@ -1170,51 +1042,52 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288463" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1224i64 <= $.d_month_seq <= 1235i64)", - "Projections": "d_week_seq", - "Estimated Cardinality": "14609" + "Conditions": "s_store_id1 = s_store_id2", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "d_week_seq = d_week_seq", - "Estimated Cardinality": "288463" + "Conditions": [ + "ss_store_sk = s_store_sk", + "ss_store_sk = s_store_sk" + ], + "Estimated Cardinality": "9418" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(1224i64 <= $.d_month_seq <= 1235i64)", + "Projections": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "d_week_seq2", - "s_store_id2", - "sun_sales2", - "mon_sales2", - "tue_sales2", - "wed_sales2", - "thu_sales2", - "fri_sales2", - "sat_sales2" - ], - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "d_week_seq = d_week_seq", + "Estimated Cardinality": "13184" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(1212i64 <= $.d_month_seq <= 1223i64)", + "Projections": "d_week_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "s_store_id1 = s_store_id2", - "d_week_seq1 = (d_week_seq2 - 52)" - ], - "Estimated Cardinality": "288462" + "Conditions": "d_week_seq = d_week_seq", + "Estimated Cardinality": "18455" } } ], @@ -1231,23 +1104,25 @@ physical_plan [ "fri_sales_ratio", "sat_sales_ratio" ], - "Estimated Cardinality": "288462" + "Estimated Cardinality": "18455" } } ], "extra_info": { "Top": "100", "Order By": [ - "y.s_store_name1 ASC", - "y.s_store_id1 ASC", - "y.d_week_seq1 ASC" - ] + "s_store_name1 ASC", + "s_store_id1 ASC", + "d_week_seq1 ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "wss", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q6.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q6.slt.no index 9802384eb1b..70e753b3d06 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q6.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q6.slt.no @@ -442,8 +442,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -480,8 +479,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "count_star()", - "a.ca_state" + "cnt", + "state" ] } } @@ -505,16 +504,16 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -522,23 +521,11 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "5000" + "Estimated Cardinality": "1800" } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "5000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -546,23 +533,11 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "5000" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -570,24 +545,11 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "10000" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_current_price", - "i_category" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -597,22 +559,9 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -622,30 +571,18 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "73049" } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_month_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "DISTINCT", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", @@ -654,110 +591,136 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 1i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "($.d_moy = 1i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Expressions": "d_month_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Expressions": "d_month_seq", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_month_seq", - "Estimated Cardinality": "2921" + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "__internal_compress_integral_usmallint(#0, 0)", - "Estimated Cardinality": "2921" + "Expressions": "", + "Estimated Cardinality": "2395", + "Distinct Targets": "d_month_seq" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2921", - "Distinct Targets": "d_month_seq" + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Expressions": "__internal_decompress_integral_bigint(#0, 0)", - "Estimated Cardinality": "2921" + "Groups": "", + "Expressions": [ + "\"first\"(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(d_month_seq = SUBQUERY)", + "Estimated Cardinality": "30" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(d_month_seq = SUBQUERY)", - "Estimated Cardinality": "25" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "120" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "98" + "Conditions": "(c_customer_sk = ss_customer_sk)", + "Estimated Cardinality": "120" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(i_item_sk = ss_item_sk)", - "Estimated Cardinality": "98" + "Conditions": "(ca_address_sk = c_current_addr_sk)", + "Estimated Cardinality": "120" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_customer_sk = ss_customer_sk)", - "Estimated Cardinality": "98" + "Conditions": "(i_item_sk = ss_item_sk)", + "Estimated Cardinality": "120" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_address_sk = c_current_addr_sk)", - "Estimated Cardinality": "98" + "Expressions": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "120" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "120" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", @@ -772,68 +735,94 @@ logical_opt [ } }, { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "74", + "Estimated Cardinality": "120" + } + } + ], + "extra_info": { + "Groups": "#[29.12]", + "Expressions": "", + "Estimated Cardinality": "60" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "97" + "Expressions": "#0", + "Estimated Cardinality": "60" } } ], "extra_info": { - "Join Type": "INNER", + "Join Type": "SEMI", "Conditions": "(i_category = i_category)", - "Estimated Cardinality": "97" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "i_current_price", - "i_category" - ], - "Estimated Cardinality": "97" + "Groups": "i_category", + "Expressions": "avg(i_current_price)", + "Estimated Cardinality": "180" + } + }, + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "74", + "Estimated Cardinality": "120" } } ], "extra_info": { - "Groups": "i_category", - "Expressions": "avg(i_current_price)", - "Estimated Cardinality": "48" + "Join Type": "INNER", + "Conditions": [ + "(i_category IS NOT DISTINCT FROM i_category)", + "((1.2 * SUBQUERY) < CAST(i_current_price AS DOUBLE))" + ], + "Estimated Cardinality": "12" } } ], "extra_info": { - "Expressions": [ - "avg(i_current_price)", - "i_category" - ], - "Estimated Cardinality": "48" + "Expressions": "", + "Estimated Cardinality": "12" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(i_category IS NOT DISTINCT FROM i_category)" + "Expressions": "#0", + "Estimated Cardinality": "12" } } ], "extra_info": { - "Expressions": "(CAST(i_current_price AS DOUBLE) > (1.2 * SUBQUERY))", - "Estimated Cardinality": "98" + "CTE Name": "__duckdb_delim_74", + "Table Index": "74", + "Estimated Cardinality": "12" } } ], "extra_info": { "Groups": "ca_state", "Expressions": "count_star()", - "Estimated Cardinality": "97" + "Estimated Cardinality": "11" } } ], "extra_info": { "Expressions": "(count_star() >= 10)", - "Estimated Cardinality": "19" + "Estimated Cardinality": "2" } } ], @@ -842,13 +831,13 @@ logical_opt [ "state", "cnt" ], - "Estimated Cardinality": "19" + "Estimated Cardinality": "2" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "19" + "Estimated Cardinality": "2" } } ] @@ -866,14 +855,27 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_current_price", + "i_category" + ], + "Estimated Cardinality": "1800" + } + }, { "name": "HASH_JOIN", "children": [ @@ -913,11 +915,11 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_current_price", - "i_category" + "ss_sold_date_sk", + "ss_item_sk", + "ss_customer_sk" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "288464" } }, { @@ -928,295 +930,278 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk" + "d_date_sk", + "d_month_seq" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "73049" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Projections": [ - "d_date_sk", - "d_month_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=2001", - "d_moy=1" - ], - "Projections": "d_month_seq", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "__internal_compress_integral_usmallint(#0, 0)", - "Estimated Cardinality": "2921" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "($.d_moy = 1i64)" + ], + "Projections": "d_month_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "d_month_seq", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "2921" + "Projections": "d_month_seq", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "__internal_decompress_integral_bigint(#0, 0)", - "Estimated Cardinality": "2921" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "2921" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "#0", + "Estimated Cardinality": "2395" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + "Aggregates": [ + "\"first\"(#0)", + "count_star()" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "d_month_seq = SUBQUERY", - "Estimated Cardinality": "25" + "Projections": [ + "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", + "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "98" + "Conditions": "d_month_seq = SUBQUERY", + "Estimated Cardinality": "30" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "i_item_sk = ss_item_sk", - "Estimated Cardinality": "98" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "120" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "c_customer_sk = ss_customer_sk", - "Estimated Cardinality": "98" + "Estimated Cardinality": "120" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ca_address_sk = c_current_addr_sk", - "Estimated Cardinality": "98" + "Estimated Cardinality": "120" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "i_item_sk = ss_item_sk", + "Estimated Cardinality": "120" + } + } + ], + "extra_info": { + "Projections": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "120" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_current_price", + "i_category" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_current_price", - "i_category" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "97" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "i_category = i_category", - "Estimated Cardinality": "97" + "CTE Index": "74", + "Estimated Cardinality": "120" } } ], "extra_info": { - "Projections": [ - "i_current_price", - "i_category" - ], - "Estimated Cardinality": "97" + "Projections": "#[29.12]", + "Estimated Cardinality": "120" } } ], "extra_info": { - "Projections": [ - "i_category", - "i_current_price" - ], - "Estimated Cardinality": "97" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "60" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "48" + "Join Type": "SEMI", + "Conditions": "i_category = i_category", + "Estimated Cardinality": "360" } } ], "extra_info": { "Projections": [ - "avg(i_current_price)", - "i_category" + "i_category", + "i_current_price" ], - "Estimated Cardinality": "48" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_category IS NOT DISTINCT FROM i_category", - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "180" } }, { - "name": "HASH_GROUP_BY", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Groups": "#2", - "Aggregates": "", - "Estimated Cardinality": "97" + "CTE Index": "74", + "Estimated Cardinality": "120" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_category IS NOT DISTINCT FROM i_category", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Join Type": "INNER", + "Conditions": [ + "i_category IS NOT DISTINCT FROM i_category", + "(1.2 * SUBQUERY) < CAST(i_current_price AS DOUBLE)" + ], + "Estimated Cardinality": "12" } } ], "extra_info": { - "Expression": "(CAST(i_current_price AS DOUBLE) > (1.2 * SUBQUERY))", - "Estimated Cardinality": "98" + "Projections": "#2", + "Estimated Cardinality": "12" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "98" + "CTE Name": "__duckdb_delim_74", + "Table Index": "74", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "12" } } ], "extra_info": { "Projections": "ca_state", - "Estimated Cardinality": "98" + "Estimated Cardinality": "12" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "97" + "Estimated Cardinality": "11" } } ], "extra_info": { "Expression": "(count_star() >= 10)", - "Estimated Cardinality": "19" + "Estimated Cardinality": "2" } } ], "extra_info": { "Top": "100", "Order By": [ - "count_star() ASC", - "a.ca_state ASC" - ] + "cnt ASC", + "state ASC" + ], + "Estimated Cardinality": "2" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q60.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q60.slt.no index 9295076f126..934d0ac6d5b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q60.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q60.slt.no @@ -1028,8 +1028,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "tmp1.i_item_id", - "sum(tmp1.total_sales)" + "i_item_id", + "total_sales" ] } } @@ -1092,152 +1092,108 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_addr_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 9i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.i_category = \"Music\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_category = \"Music\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "2307" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1246,7 +1202,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1255,7 +1211,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } } ], @@ -1264,7 +1220,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } }, { @@ -1282,6 +1238,19 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1289,152 +1258,95 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_addr_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 9i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.i_category = \"Music\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(cs_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "5744" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_category = \"Music\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "1148" + "Conditions": "(d_date_sk = cs_sold_date_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(cs_ext_sales_price)", - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1443,7 +1355,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1452,7 +1364,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } } ], @@ -1461,7 +1373,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } }, { @@ -1479,6 +1391,19 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1486,152 +1411,95 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_addr_sk", - "ws_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 9i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1800" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.i_category = \"Music\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Expressions": "i_item_id", + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "(i_item_id = #0)", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ws_bill_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2864" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_category = \"Music\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Expressions": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(i_item_id = #0)", - "Estimated Cardinality": "360" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "572" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(ws_ext_sales_price)", - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1640,7 +1508,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1649,7 +1517,7 @@ logical_opt [ "#0", "#1" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -1658,20 +1526,20 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "4009" + "Estimated Cardinality": "4956" } } ], "extra_info": { "Groups": "i_item_id", "Expressions": "sum(total_sales)", - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], @@ -1680,7 +1548,7 @@ logical_opt [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], @@ -1733,23 +1601,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_category = \"Music\")", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=9" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -1757,55 +1644,37 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Music'", - "Projections": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "2307" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } } ], @@ -1814,14 +1683,14 @@ physical_plan [ "i_item_id", "ss_ext_sales_price" ], - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "2297" + "Estimated Cardinality": "1797" } }, { @@ -1833,6 +1702,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1854,23 +1737,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_category = \"Music\")", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=9" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "28731" } }, { @@ -1878,55 +1780,23 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "5744" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Music'", - "Projections": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "1148" + "Conditions": "d_date_sk = cs_sold_date_sk", + "Estimated Cardinality": "5746" } } ], @@ -1935,14 +1805,14 @@ physical_plan [ "i_item_id", "cs_ext_sales_price" ], - "Estimated Cardinality": "1148" + "Estimated Cardinality": "5746" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "1143" + "Estimated Cardinality": "1726" } }, { @@ -1954,6 +1824,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 9i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1975,23 +1859,42 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_category = \"Music\")", + "Projections": "i_item_id", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=9" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "SEMI", + "Conditions": "i_item_id = #0", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" } }, { @@ -1999,55 +1902,23 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_bill_addr_sk = ca_address_sk", - "Estimated Cardinality": "2864" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Music'", - "Projections": "i_item_id", - "Estimated Cardinality": "72" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "i_item_id = #0", - "Estimated Cardinality": "360" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "572" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "2865" } } ], @@ -2056,14 +1927,14 @@ physical_plan [ "i_item_id", "ws_ext_sales_price" ], - "Estimated Cardinality": "572" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "569" + "Estimated Cardinality": "1433" } } ], @@ -2075,23 +1946,21 @@ physical_plan [ "i_item_id", "total_sales" ], - "Estimated Cardinality": "4009" + "Estimated Cardinality": "4956" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "3981" + "Estimated Cardinality": "1685" } } ], "extra_info": { "Top": "100", - "Order By": [ - "tmp1.i_item_id ASC", - "sum(tmp1.total_sales) ASC" - ] + "Order By": "i_item_id ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q61.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q61.slt.no index 54d79710877..9881119688d 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q61.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q61.slt.no @@ -748,8 +748,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "promotional_sales.promotions", - "all_sales.total" + "promotions", + "total" ] } } @@ -778,6 +778,19 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -791,124 +804,65 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 11i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "((($.p_channel_dmail = \"Y\") or ($.p_channel_email = \"Y\")) or ($.p_channel_tv = \"Y\"))", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_promo_sk = p_promo_sk)", + "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_category = \"Jewelry\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "72" + "Filters": "($.i_category = \"Jewelry\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], @@ -926,20 +880,11 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.s_gmt_offset = decimal128(-500, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "s_store_sk", + "Filters": "($.s_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } @@ -949,29 +894,11 @@ logical_opt [ "Conditions": "(ss_store_sk = s_store_sk)", "Estimated Cardinality": "2307" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "((($.p_channel_dmail = \"Y\") or ($.p_channel_email = \"Y\")) or ($.p_channel_tv = \"Y\"))", - "Function": "Vortex Scan", - "Estimated Cardinality": "6" - } - } - ], - "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "6" - } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_promo_sk = p_promo_sk)", + "Conditions": "(d_date_sk = ss_sold_date_sk)", "Estimated Cardinality": "2307" } } @@ -997,6 +924,19 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1007,88 +947,32 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_store_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 11i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_category = \"Jewelry\")", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1098,51 +982,30 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "10000" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2000" + "Conditions": "(ss_customer_sk = c_customer_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "2307" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1154,15 +1017,16 @@ logical_opt [ } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "2307" + "Conditions": "(d_date_sk = ss_sold_date_sk)", + "Estimated Cardinality": "11538" } } ], @@ -1220,6 +1084,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1253,19 +1131,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "((($.p_channel_dmail = \"Y\") or ($.p_channel_email = \"Y\")) or ($.p_channel_tv = \"Y\"))", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_promo_sk = p_promo_sk", + "Estimated Cardinality": "57692" } }, { @@ -1273,16 +1148,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "i_category='Jewelry'", + "Filters": "($.i_category = \"Jewelry\")", "Projections": "i_item_sk", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } }, { @@ -1305,9 +1180,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], @@ -1329,7 +1204,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "s_gmt_offset=-5.00", + "Filters": "($.s_gmt_offset = decimal128(-500, precision=5, scale=2))", "Projections": "s_store_sk", "Estimated Cardinality": "1" } @@ -1340,21 +1215,11 @@ physical_plan [ "Conditions": "ss_store_sk = s_store_sk", "Estimated Cardinality": "2307" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "((($.p_channel_dmail = \"Y\") or ($.p_channel_email = \"Y\")) or ($.p_channel_tv = \"Y\"))", - "Projections": "p_promo_sk", - "Estimated Cardinality": "6" - } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_promo_sk = p_promo_sk", + "Conditions": "d_date_sk = ss_sold_date_sk", "Estimated Cardinality": "2307" } } @@ -1366,7 +1231,8 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } }, { @@ -1378,6 +1244,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1407,103 +1287,91 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "($.i_category = \"Jewelry\")", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_current_addr_sk" + ], + "Estimated Cardinality": "10000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.ca_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Jewelry'", - "Projections": "i_item_sk", - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "2000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_customer_sk = c_customer_sk", + "Estimated Cardinality": "11538" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-5.00", - "Projections": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "2000" + "Function": "Vortex Scan", + "Filters": "($.s_gmt_offset = decimal128(-500, precision=5, scale=2))", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "2307" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "s_gmt_offset=-5.00", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "2307" + "Conditions": "d_date_sk = ss_sold_date_sk", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Projections": "ss_ext_sales_price", - "Estimated Cardinality": "2307" + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ], @@ -1523,9 +1391,10 @@ physical_plan [ "extra_info": { "Top": "100", "Order By": [ - "promotional_sales.promotions ASC", - "all_sales.total ASC" - ] + "promotions ASC", + "total ASC" + ], + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q62.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q62.slt.no index 47e63dd6992..a69dbb2f18c 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q62.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q62.slt.no @@ -397,26 +397,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_ship_date_sk", - "ws_web_site_sk", - "ws_ship_mode_sk", - "ws_warehouse_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, @@ -424,31 +409,19 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "w_substr", - "w_warehouse_sk" + "w_warehouse_sk", + "w_warehouse_name" ], "Estimated Cardinality": "1" } @@ -461,79 +434,46 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "20" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "sm_ship_mode_sk", - "sm_type" - ], - "Estimated Cardinality": "20" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "3" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_ship_mode_sk = sm_ship_mode_sk)", + "Conditions": "(ws_web_site_sk = web_site_sk)", "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "3" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "web_site_sk", - "web_name" - ], - "Estimated Cardinality": "3" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "20" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_web_site_sk = web_site_sk)", + "Conditions": "(ws_ship_mode_sk = sm_ship_mode_sk)", "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450820i64 <= $.d_date_sk <= 2452762i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450820i64 <= $.d_date_sk <= 2452762i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -547,10 +487,10 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "w_substr", - "sm_type", - "web_name", - "(ws_ship_date_sk - ws_sold_date_sk)" + "w_warehouse_name", + "#4", + "#3", + "(#1 - #0)" ], "Estimated Cardinality": "71632" } @@ -559,8 +499,8 @@ logical_opt [ "extra_info": { "Groups": [ "w_substr", - "sm_type", - "web_name" + "#1", + "#2" ], "Expressions": [ "sum(CASE WHEN ((#3 <= 30)) THEN (1) ELSE 0 END)", @@ -569,7 +509,7 @@ logical_opt [ "sum(CASE WHEN (((#3 > 90) AND (#3 <= 120))) THEN (1) ELSE 0 END)", "sum(CASE WHEN ((#3 > 120)) THEN (1) ELSE 0 END)" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "54" } } ], @@ -584,13 +524,13 @@ logical_opt [ "91-120 days", ">120 days" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "54" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "54" } } ] @@ -635,25 +575,13 @@ physical_plan [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "w_warehouse_sk", - "w_warehouse_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", "Projections": [ - "w_substr", - "w_warehouse_sk" + "w_warehouse_sk", + "w_warehouse_name" ], "Estimated Cardinality": "1" } @@ -671,16 +599,16 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "sm_ship_mode_sk", - "sm_type" + "web_site_sk", + "web_name" ], - "Estimated Cardinality": "20" + "Estimated Cardinality": "3" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_ship_mode_sk = sm_ship_mode_sk", + "Conditions": "ws_web_site_sk = web_site_sk", "Estimated Cardinality": "71632" } }, @@ -690,16 +618,16 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "web_site_sk", - "web_name" + "sm_ship_mode_sk", + "sm_type" ], - "Estimated Cardinality": "3" + "Estimated Cardinality": "20" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_site_sk = web_site_sk", + "Conditions": "ws_ship_mode_sk = sm_ship_mode_sk", "Estimated Cardinality": "71632" } }, @@ -726,10 +654,10 @@ physical_plan [ ], "extra_info": { "Projections": [ - "w_substr", - "sm_type", - "web_name", - "(ws_ship_date_sk - ws_sold_date_sk)" + "w_warehouse_name", + "#4", + "#3", + "(#1 - #0)" ], "Estimated Cardinality": "71632" } @@ -738,8 +666,8 @@ physical_plan [ "extra_info": { "Projections": [ "w_substr", - "sm_type", - "web_name", + "#1", + "#2", "CASE WHEN ((#3 <= 30)) THEN (1) ELSE 0 END", "CASE WHEN (((#3 > 30) AND (#3 <= 60))) THEN (1) ELSE 0 END", "CASE WHEN (((#3 > 60) AND (#3 <= 90))) THEN (1) ELSE 0 END", @@ -763,7 +691,7 @@ physical_plan [ "sum(#6)", "sum(#7)" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "54" } } ], @@ -773,7 +701,8 @@ physical_plan [ "w_substr ASC", "sm_type ASC", "web_name ASC" - ] + ], + "Estimated Cardinality": "54" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q63.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q63.slt.no index 8d40374b726..cac609fd7a1 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q63.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q63.slt.no @@ -321,9 +321,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "tmp1.i_manager_id", - "tmp1.avg_monthly_sales", - "tmp1.sum_sales" + "i_manager_id", + "avg_monthly_sales", + "sum_sales" ] } } @@ -344,19 +344,19 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -365,90 +365,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_moy" - ], - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -465,70 +389,86 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_manager_id" - ], - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288464" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "#0", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "i_manager_id", - "d_moy" + "Expressions": [ + "CAST(#1 AS TINYINT)", + "#0", + "CAST(#2 AS TINYINT)" ], - "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "111295" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" + "Groups": [ + "i_manager_id", + "d_moy" ], - "Estimated Cardinality": "111295" + "Expressions": "sum(ss_sales_price)", + "Estimated Cardinality": "1140" } } ], "extra_info": { - "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manager_id)", - "Estimated Cardinality": "111295" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2" + ], + "Estimated Cardinality": "1140" } } ], "extra_info": { - "Expressions": [ - "i_manager_id", - "sum_sales", - "avg_monthly_sales" - ], - "Estimated Cardinality": "111295" + "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manager_id)", + "Estimated Cardinality": "1140" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "111295" + "Expressions": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "228" } } ], @@ -538,7 +478,7 @@ logical_opt [ "sum_sales", "avg_monthly_sales" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "228" } } ], @@ -553,10 +493,10 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { "name": "PROJECTION", @@ -605,21 +545,23 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "(((vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics)) or ((vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics)))", + "(vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics))", + "(vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics))", + "(vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics) or vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics))" ], "Projections": [ - "d_date_sk", - "d_moy" + "i_item_sk", + "i_manager_id" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -635,7 +577,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } }, { @@ -644,33 +586,31 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics)) or ((vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics)) and vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics)))", - "(vortex.list.contains([\"Books\", \"Children\", \"Electronics\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Women\", \"Music\", \"Men\"], $.i_category, opts=sql_null_semantics))", - "(vortex.list.contains([\"personal\", \"portable\", \"reference\", \"self-help\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"accessories\", \"classical\", \"fragrances\", \"pants\"], $.i_class, opts=sql_null_semantics))", - "(vortex.list.contains([\"scholaramalgamalg #14\", \"scholaramalgamalg #7\", \"exportiunivamalg #9\", \"scholaramalgamalg #9\"], $.i_brand, opts=sql_null_semantics) or vortex.list.contains([\"amalgimporto #1\", \"edu packscholar #1\", \"exportiimporto #1\", \"importoamalg #1\"], $.i_brand, opts=sql_null_semantics))" + "vortex.list.contains([1200i64, 1201i64, 1202i64, 1203i64, 1204i64, 1205i64, 1206i64, 1207i64, 1208i64, 1209i64, 1210i64, 1211i64], $.d_month_seq, opts=sql_null_semantics)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Projections": [ - "i_item_sk", - "i_manager_id" + "d_date_sk", + "d_moy" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ + "CAST(#1 AS TINYINT)", "#0", - "__internal_compress_integral_utinyint(#1, 1)", - "__internal_compress_integral_utinyint(#2, 1)" + "CAST(#2 AS TINYINT)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], @@ -680,7 +620,7 @@ physical_plan [ "d_moy", "ss_sales_price" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], @@ -689,22 +629,24 @@ physical_plan [ "#0", "#1" ], - "Aggregates": "sum(#2)" + "Aggregates": "sum(#2)", + "Estimated Cardinality": "1140" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "1140" } } ], "extra_info": { - "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manager_id)" + "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_manager_id)", + "Estimated Cardinality": "1140" } } ], @@ -715,33 +657,34 @@ physical_plan [ "#2", "#3" ], - "Estimated Cardinality": "111295" + "Estimated Cardinality": "1140" } } ], "extra_info": { - "Projections": [ - "i_manager_id", - "sum_sales", - "avg_monthly_sales" - ], - "Estimated Cardinality": "111295" + "Expression": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "228" } } ], "extra_info": { - "Expression": "(CASE WHEN ((avg_monthly_sales > 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "111295" + "Projections": [ + "#0", + "#2", + "#3" + ], + "Estimated Cardinality": "228" } } ], "extra_info": { "Top": "100", "Order By": [ - "tmp1.i_manager_id ASC", - "tmp1.avg_monthly_sales ASC", - "tmp1.sum_sales ASC" - ] + "i_manager_id ASC", + "avg_monthly_sales ASC", + "sum_sales ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q64.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q64.slt.no index d3f3e3c0517..795ae5b1790 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q64.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q64.slt.no @@ -1152,11 +1152,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "cs1.product_name", - "cs1.store_name", - "cs2.cnt", - "cs1.s1", - "cs2.s1" + "product_name", + "store_name", + "cnt", + "s11", + "s12" ] } } @@ -1196,7 +1196,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -1210,6 +1210,15 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1220,445 +1229,281 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_cdemo_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ticket_number", - "ss_wholesale_cost", - "ss_list_price", - "ss_coupon_amt" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(($.d_year = 1999i64) or ($.d_year = 2000i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "28576" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([\"purple\", \"burlywood\", \"indian\", \"spring\", \"floral\", \"medium\"], $.i_color, opts=sql_null_semantics)", + "(decimal128(6500, precision=7, scale=2) <= $.i_current_price <= decimal128(7400, precision=7, scale=2))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } + }, + { + "name": "FILTER", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2i64 <= $.cs_order_number <= 15999i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(cs_item_sk = cr_item_sk)", + "(cs_order_number = cr_order_number)" + ], + "Estimated Cardinality": "128168" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "128168" + } + } + ], + "extra_info": { + "Groups": "cs_item_sk", + "Expressions": [ + "sum(cs_ext_list_price)", + "sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Expressions": "(sum(cs_ext_list_price) > (2 * sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))))", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(i_item_sk = cs_item_sk)", + "Estimated Cardinality": "72" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(sr_item_sk = i_item_sk)", + "Estimated Cardinality": "1143" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_name", - "s_zip" + "Conditions": [ + "(ss_item_sk = i_item_sk)", + "(ss_ticket_number = sr_ticket_number)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Filters": [ + "(($.d_year = 1999i64) or ($.d_year = 2000i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "192080" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status" - ], - "Estimated Cardinality": "192080" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "30" - } - } - ], - "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "30" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_promo_sk = p_promo_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_street_number", - "ca_street_name", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7200" - } - } - ], - "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_income_band_sk" - ], - "Estimated Cardinality": "7200" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "20" - } - } - ], - "extra_info": { - "Expressions": "ib_income_band_sk", - "Estimated Cardinality": "20" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(hd_income_band_sk = ib_income_band_sk)", - "Estimated Cardinality": "7200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([\"purple\", \"burlywood\", \"indian\", \"spring\", \"floral\", \"medium\"], $.i_color, opts=sql_null_semantics)", - "(decimal128(6500, precision=7, scale=2) <= $.i_current_price <= decimal128(7400, precision=7, scale=2))" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_product_name" - ], - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_item_sk = i_item_sk)", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ss_item_sk = sr_item_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "FILTER", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2i64 <= $.cs_order_number <= 15999i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_item_sk", - "cs_order_number", - "cs_ext_list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number", - "cr_refunded_cash", - "cr_reversed_charge", - "cr_store_credit" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(cs_item_sk = cr_item_sk)", - "(cs_order_number = cr_order_number)" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "cs_item_sk", - "Expressions": [ - "sum(cs_ext_list_price)", - "sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))" - ], - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "(cd_demo_sk = ss_cdemo_sk)", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "30" } } ], "extra_info": { - "Expressions": [ - "cs_item_sk", - "sale", - "refund" - ], - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "(ss_promo_sk = p_promo_sk)", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "(ss_addr_sk = ca_address_sk)", + "Estimated Cardinality": "11538" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7200" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "20" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(hd_income_band_sk = ib_income_band_sk)", + "Estimated Cardinality": "7200" } } ], "extra_info": { - "Expressions": "(sum(cs_ext_list_price) > (2 * sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))))", - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(i_item_sk = cs_item_sk)", - "Estimated Cardinality": "72763441" + "Expressions": [ + "#10", + "#11", + "#12", + "#13", + "#0", + "#8", + "#9", + "#7", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#14", + "#15", + "__internal_compress_integral_utinyint(#7, 1900)" + ], + "Estimated Cardinality": "11538" } }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -1667,29 +1512,17 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(2448998i64 <= $.d_date_sk <= 2452648i64)", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "192080" } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1700,172 +1533,142 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "(2449028i64 <= $.d_date_sk <= 2452678i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Estimated Cardinality": "73049" } } ], "extra_info": { "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_hdemo_sk", - "c_current_addr_sk", - "c_first_shipto_date_sk", - "c_first_sales_date_sk" + "d_date_sk", + "d_year" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "73049" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_street_number", - "ca_street_name", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2448998i64 <= $.d_date_sk <= 2452648i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7200" + "Expressions": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "73049" } - } - ], - "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_income_band_sk" - ], - "Estimated Cardinality": "7200" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "20" + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": "ib_income_band_sk", - "Estimated Cardinality": "20" + "Join Type": "INNER", + "Conditions": "(d_date_sk = c_first_sales_date_sk)", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(hd_income_band_sk = ib_income_band_sk)", - "Estimated Cardinality": "7200" + "Conditions": "(d_date_sk = c_first_shipto_date_sk)", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_current_hdemo_sk = hd_demo_sk)", + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", "Estimated Cardinality": "10000" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(d_date_sk = c_first_sales_date_sk)", - "Estimated Cardinality": "73049" + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(2449028i64 <= $.d_date_sk <= 2452678i64)", + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7200" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "20" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "73049" + "Join Type": "INNER", + "Conditions": "(hd_income_band_sk = ib_income_band_sk)", + "Estimated Cardinality": "7200" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_first_shipto_date_sk = d_date_sk)", - "Estimated Cardinality": "533615" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], - "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status" - ], - "Estimated Cardinality": "192080" + "Conditions": "(c_current_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "10249689" + "Expressions": [ + "#4", + "#5", + "#6", + "#7", + "#0", + "#1", + "#2", + "#3", + "#8", + "#9", + "__internal_compress_integral_utinyint(#1, 1900)", + "__internal_compress_integral_utinyint(#2, 1900)" + ], + "Estimated Cardinality": "10000" } } ], @@ -1875,32 +1678,32 @@ logical_opt [ "(ss_customer_sk = c_customer_sk)", "(cd_marital_status != cd_marital_status)" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#11, 1)", - "#10", - "#6", - "#7", - "#8", - "#9", - "#4", - "#5", "#0", "#1", "#2", - "__internal_compress_integral_utinyint(#3, 1900)", - "__internal_compress_integral_utinyint(#17, 1900)", - "__internal_compress_integral_utinyint(#12, 1900)", + "#3", + "#4", + "#5", + "#11", + "CAST(#6 AS SMALLINT)", + "#7", + "#8", + "#9", + "#10", + "#12", "#13", "#14", "#15", - "#16" + "#16", + "#17" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -1928,14 +1731,14 @@ logical_opt [ "sum(ss_list_price)", "sum(ss_coupon_amt)" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -1954,7 +1757,7 @@ logical_opt [ "#17", "#18" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -1978,7 +1781,7 @@ logical_opt [ "s2", "s3" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -2001,109 +1804,252 @@ logical_opt [ "#14", "#15", "#16" - ] + ], + "Estimated Cardinality": "34660" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "ORDER_BY", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "224028100764" - } - } - ], - "extra_info": { - "Expressions": "(syear = 1999)", - "Estimated Cardinality": "224028100764" - } - }, - { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expressions": "(syear = 1999)", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16", + "__internal_compress_integral_utinyint(#12, 1999)" + ], + "Estimated Cardinality": "34660" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expressions": "(syear = 2000)", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "__internal_compress_integral_utinyint(#3, 2000)" + ], + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "(item_sk = item_sk)", + "(store_name = store_name)", + "(store_zip = store_zip)", + "(cnt >= cnt)" + ], + "Estimated Cardinality": "1130068" + } + } + ], "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "224028100764" + "Expressions": [ + "product_name", + "store_name", + "store_zip", + "b_street_number", + "b_street_name", + "b_city", + "b_zip", + "c_street_number", + "c_street_name", + "c_city", + "c_zip", + "cs1syear", + "cs1cnt", + "s11", + "s21", + "s31", + "s12", + "s22", + "s32", + "syear", + "cnt", + "#16", + "#22" + ], + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Expressions": "(syear = 2000)", - "Estimated Cardinality": "224028100764" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#21", + "#12", + "#13", + "#14", + "#15", + "#16", + "#17", + "#18", + "#22", + "#20" + ], + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(item_sk = item_sk)", - "(store_name = store_name)", - "(store_zip = store_zip)", - "(cnt >= cnt)" + "Order By": [ + "product_name", + "store_name", + "cnt", + "s11", + "s12" ], - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ], "extra_info": { "Expressions": [ - "product_name", - "store_name", - "store_zip", - "b_street_number", - "b_street_name", - "b_city", - "b_zip", - "c_street_number", - "c_street_name", - "c_city", - "c_zip", - "cs1syear", - "cs1cnt", - "s11", - "s21", - "s31", - "s12", - "s22", - "s32", - "syear", - "cnt" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "__internal_decompress_integral_bigint(#11, 1999)", + "#12", + "#13", + "#14", + "#15", + "#16", + "#17", + "#18", + "__internal_decompress_integral_bigint(#19, 2000)", + "#20" ], - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Order By": [ - "cs1.product_name", - "cs1.store_name", - "cs2.cnt", - "cs1.s1", - "cs2.s1" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16", + "#17", + "#18", + "#19", + "#20" ], - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ], "extra_info": { "CTE Name": "cross_sales", "Table Index": "1", - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ] @@ -2130,7 +2076,7 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", @@ -2144,6 +2090,19 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", + "Projections": [ + "cd_demo_sk", + "cd_marital_status" + ], + "Estimated Cardinality": "192080" + } + }, { "name": "HASH_JOIN", "children": [ @@ -2176,26 +2135,175 @@ physical_plan [ } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_ticket_number" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([\"purple\", \"burlywood\", \"indian\", \"spring\", \"floral\", \"medium\"], $.i_color, opts=sql_null_semantics)", + "(decimal128(6500, precision=7, scale=2) <= $.i_current_price <= decimal128(7400, precision=7, scale=2))" + ], + "Projections": [ + "i_item_sk", + "i_product_name" + ], + "Estimated Cardinality": "360" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PERFECT_HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(2i64 <= $.cs_order_number <= 15999i64)", + "Projections": [ + "cs_item_sk", + "cs_order_number", + "cs_ext_list_price" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cr_item_sk", + "cr_order_number", + "cr_refunded_cash", + "cr_reversed_charge", + "cr_store_credit" + ], + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": [ + "cs_item_sk = cr_item_sk", + "cs_order_number = cr_order_number" + ], + "Estimated Cardinality": "128168" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "128168" + } + } + ], + "extra_info": { + "Projections": [ + "cs_item_sk", + "cs_ext_list_price", + "((cr_refunded_cash + cr_reversed_charge) + cr_store_credit)" + ], + "Estimated Cardinality": "128168" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Expression": "(sum(cs_ext_list_price) > (2 * sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))))", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "i_item_sk = cs_item_sk", + "Estimated Cardinality": "72" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 1999i64) or ($.d_year = 2000i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "sr_item_sk = i_item_sk", + "Estimated Cardinality": "1143" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" + "Conditions": [ + "ss_item_sk = i_item_sk", + "ss_ticket_number = sr_ticket_number" + ], + "Estimated Cardinality": "11538" } }, { @@ -2203,19 +2311,22 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 1999i64) or ($.d_year = 2000i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "s_store_sk", - "s_store_name", - "s_zip" + "d_date_sk", + "d_year" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } }, { @@ -2223,72 +2334,26 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2i64 <= $.cd_demo_sk <= 192076i64)", "Projections": [ - "cd_demo_sk", - "cd_marital_status" + "s_store_sk", + "s_store_name", + "s_zip" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "p_promo_sk", - "Estimated Cardinality": "30" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "11538" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_promo_sk = p_promo_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_street_number", - "ca_street_name", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "hd_demo_sk", - "hd_income_band_sk" - ], - "Estimated Cardinality": "7200" + "Conditions": "cd_demo_sk = ss_cdemo_sk", + "Estimated Cardinality": "11538" } }, { @@ -2296,37 +2361,15 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": "ib_income_band_sk", - "Estimated Cardinality": "20" + "Projections": "p_promo_sk", + "Estimated Cardinality": "30" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "hd_income_band_sk = ib_income_band_sk", - "Estimated Cardinality": "7200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_item_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" + "Conditions": "ss_promo_sk = p_promo_sk", + "Estimated Cardinality": "11538" } }, { @@ -2334,156 +2377,87 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([\"purple\", \"burlywood\", \"indian\", \"spring\", \"floral\", \"medium\"], $.i_color, opts=sql_null_semantics)", - "(decimal128(6500, precision=7, scale=2) <= $.i_current_price <= decimal128(7400, precision=7, scale=2))" - ], "Projections": [ - "i_item_sk", - "i_product_name" + "ca_address_sk", + "ca_street_number", + "ca_street_name", + "ca_city", + "ca_zip" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ss_item_sk = sr_item_sk", - "ss_ticket_number = sr_ticket_number" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PERFECT_HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(2i64 <= $.cs_order_number <= 15999i64)", - "Projections": [ - "cs_item_sk", - "cs_order_number", - "cs_ext_list_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cr_item_sk", - "cr_order_number", - "cr_refunded_cash", - "cr_reversed_charge", - "cr_store_credit" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "cs_item_sk = cr_item_sk", - "cs_order_number = cr_order_number" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Projections": [ - "cs_item_sk", - "cs_ext_list_price", - "((cr_refunded_cash + cr_reversed_charge) + cr_store_credit)" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } - } - ], + "Conditions": "ss_addr_sk = ca_address_sk", + "Estimated Cardinality": "11538" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "hd_demo_sk", + "hd_income_band_sk" ], - "Estimated Cardinality": "90808" + "Estimated Cardinality": "7200" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "ib_income_band_sk", + "Estimated Cardinality": "20" } } ], "extra_info": { - "Expression": "(sum(cs_ext_list_price) > (2 * sum(((cr_refunded_cash + cr_reversed_charge) + cr_store_credit))))", - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "hd_income_band_sk = ib_income_band_sk", + "Estimated Cardinality": "7200" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "90808" + "Join Type": "INNER", + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "i_item_sk = cs_item_sk", - "Estimated Cardinality": "72763441" + "Projections": [ + "#10", + "#11", + "#12", + "#13", + "#0", + "#8", + "#9", + "#7", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#14", + "#15", + "__internal_compress_integral_utinyint(#7, 1900)" + ], + "Estimated Cardinality": "11538" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", @@ -2491,61 +2465,20 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(2448998i64 <= $.d_date_sk <= 2452648i64)", - "Projections": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "73049" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_hdemo_sk", - "c_current_addr_sk", - "c_first_shipto_date_sk", - "c_first_sales_date_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_street_number", - "ca_street_name", - "ca_city", - "ca_zip" - ], - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" + "Function": "Vortex Scan", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Projections": [ + "cd_demo_sk", + "cd_marital_status" + ], + "Estimated Cardinality": "192080" } }, { @@ -2556,81 +2489,144 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(2449028i64 <= $.d_date_sk <= 2452678i64)", "Projections": [ - "hd_demo_sk", - "hd_income_band_sk" + "d_date_sk", + "d_year" ], - "Estimated Cardinality": "7200" + "Estimated Cardinality": "73049" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(2448998i64 <= $.d_date_sk <= 2452648i64)", + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "73049" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_current_cdemo_sk", + "c_current_hdemo_sk", + "c_current_addr_sk", + "c_first_shipto_date_sk", + "c_first_sales_date_sk" + ], + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": "ib_income_band_sk", - "Estimated Cardinality": "20" + "Join Type": "INNER", + "Conditions": "d_date_sk = c_first_sales_date_sk", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "hd_income_band_sk = ib_income_band_sk", - "Estimated Cardinality": "7200" + "Conditions": "d_date_sk = c_first_shipto_date_sk", + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_current_hdemo_sk = hd_demo_sk", + "Conditions": "cd_demo_sk = c_current_cdemo_sk", "Estimated Cardinality": "10000" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_street_number", + "ca_street_name", + "ca_city", + "ca_zip" + ], + "Estimated Cardinality": "5000" + } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "d_date_sk = c_first_sales_date_sk", - "Estimated Cardinality": "73049" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "10000" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "hd_demo_sk", + "hd_income_band_sk" + ], + "Estimated Cardinality": "7200" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "ib_income_band_sk", + "Estimated Cardinality": "20" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "(2449028i64 <= $.d_date_sk <= 2452678i64)", - "Projections": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "73049" + "Join Type": "INNER", + "Conditions": "hd_income_band_sk = ib_income_band_sk", + "Estimated Cardinality": "7200" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_first_shipto_date_sk = d_date_sk", - "Estimated Cardinality": "533615" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Projections": [ - "cd_demo_sk", - "cd_marital_status" - ], - "Estimated Cardinality": "192080" + "Conditions": "c_current_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_current_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "10249689" + "Projections": [ + "#4", + "#5", + "#6", + "#7", + "#0", + "#1", + "#2", + "#3", + "#8", + "#9", + "__internal_compress_integral_utinyint(#1, 1900)", + "__internal_compress_integral_utinyint(#2, 1900)" + ], + "Estimated Cardinality": "10000" } } ], @@ -2640,32 +2636,32 @@ physical_plan [ "ss_customer_sk = c_customer_sk", "cd_marital_status != cd_marital_status" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#11, 1)", - "#10", - "#6", - "#7", - "#8", - "#9", - "#4", - "#5", "#0", "#1", "#2", - "__internal_compress_integral_utinyint(#3, 1900)", - "__internal_compress_integral_utinyint(#17, 1900)", - "__internal_compress_integral_utinyint(#12, 1900)", + "#3", + "#4", + "#5", + "#11", + "CAST(#6 AS SMALLINT)", + "#7", + "#8", + "#9", + "#10", + "#12", "#13", "#14", "#15", - "#16" + "#16", + "#17" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -2690,7 +2686,7 @@ physical_plan [ "ss_list_price", "ss_coupon_amt" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -2718,14 +2714,14 @@ physical_plan [ "sum(#16)", "sum(#17)" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#1 AS BIGINT)", "#2", "#3", "#4", @@ -2744,7 +2740,7 @@ physical_plan [ "#17", "#18" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } } ], @@ -2768,126 +2764,239 @@ physical_plan [ "s2", "s3" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "34660" } }, { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "224028100764" - } - } - ], - "extra_info": { - "Expression": "(syear = 1999)", - "Estimated Cardinality": "224028100764" - } - }, { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "CTE_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expression": "(syear = 1999)", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16", + "__internal_compress_integral_utinyint(#12, 1999)" + ], + "Estimated Cardinality": "34660" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "1", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Expression": "(syear = 2000)", + "Estimated Cardinality": "34660" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#3", + "#12", + "#13", + "#14", + "#15", + "#16" + ], + "Estimated Cardinality": "34660" + } + } + ], "extra_info": { - "CTE Index": "1", - "Estimated Cardinality": "224028100764" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "__internal_compress_integral_utinyint(#3, 2000)" + ], + "Estimated Cardinality": "34660" } } ], "extra_info": { - "Expression": "(syear = 2000)", - "Estimated Cardinality": "224028100764" + "Join Type": "INNER", + "Conditions": [ + "item_sk = item_sk", + "store_name = store_name", + "store_zip = store_zip", + "cnt >= cnt" + ], + "Estimated Cardinality": "1130068" } } ], "extra_info": { "Projections": [ - "#1", - "#2", - "#3", - "#12", - "#13", - "#14", - "#15", - "#16" + "product_name", + "store_name", + "store_zip", + "b_street_number", + "b_street_name", + "b_city", + "b_zip", + "c_street_number", + "c_street_name", + "c_city", + "c_zip", + "cs1syear", + "cs1cnt", + "s11", + "s21", + "s31", + "s12", + "s22", + "s32", + "syear", + "cnt", + "#16", + "#22" ], - "Estimated Cardinality": "224028100764" + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "item_sk = item_sk", - "store_name = store_name", - "store_zip = store_zip", - "cnt >= cnt" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#21", + "#12", + "#13", + "#14", + "#15", + "#16", + "#17", + "#18", + "#22", + "#20" ], - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Projections": [ - "product_name", - "store_name", - "store_zip", - "b_street_number", - "b_street_name", - "b_city", - "b_zip", - "c_street_number", - "c_street_name", - "c_city", - "c_zip", - "cs1syear", - "cs1cnt", - "s11", - "s21", - "s31", - "s12", - "s22", - "s32", - "syear", - "cnt" + "Order By": [ + "product_name ASC", + "store_name ASC", + "cnt ASC", + "s11 ASC", + "s12 ASC" ], - "Estimated Cardinality": "11495924774494705664" + "Estimated Cardinality": "1130068" } } ], "extra_info": { - "Order By": [ - "cs1.product_name ASC", - "cs1.store_name ASC", - "cs2.cnt ASC", - "cs1.s1 ASC", - "cs2.s1 ASC" - ] + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "__internal_decompress_integral_bigint(#11, 1999)", + "#12", + "#13", + "#14", + "#15", + "#16", + "#17", + "#18", + "__internal_decompress_integral_bigint(#19, 2000)", + "#20" + ], + "Estimated Cardinality": "1130068" } } ], "extra_info": { "CTE Name": "cross_sales", "Table Index": "1", - "Estimated Cardinality": "11495924774494705664" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1130068" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q65.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q65.slt.no index dc367cec446..94c2641e68e 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q65.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q65.slt.no @@ -466,8 +466,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.store.s_store_name", - "memory.main.item.i_item_desc" + "s_store_name", + "i_item_desc" ] } } @@ -487,6 +487,30 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Expressions": [ + "i_item_sk", + "i_item_desc", + "i_current_price", + "i_wholesale_cost", + "i_brand" + ], + "Estimated Cardinality": "1800" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -494,146 +518,97 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1176i64 <= $.d_month_seq <= 1187i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1176i64 <= $.d_month_seq <= 1187i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", - "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" - ], + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ - "ss_store_sk", - "ss_item_sk" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", + "#2", + "#3" ], - "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" + "Groups": [ + "ss_store_sk", + "ss_item_sk" ], - "Estimated Cardinality": "288463" + "Expressions": "sum(ss_sales_price)", + "Estimated Cardinality": "1710" } } ], "extra_info": { "Expressions": [ - "ss_store_sk", - "ss_item_sk", - "revenue" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Expressions": [ + "s_store_sk", + "s_store_name" + ], + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_desc", - "i_current_price", - "i_wholesale_cost", - "i_brand" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288463" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -659,46 +634,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1176i64 <= $.d_month_seq <= 1187i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(1176i64 <= $.d_month_seq <= 1187i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -712,10 +664,10 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" + "#3" ], "Estimated Cardinality": "288464" } @@ -727,17 +679,17 @@ logical_opt [ "ss_item_sk" ], "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], @@ -746,79 +698,56 @@ logical_opt [ "ss_store_sk", "revenue" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS TINYINT)", "#1" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Groups": "ss_store_sk", "Expressions": "avg(revenue)", - "Estimated Cardinality": "182343" + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "182343" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_store_sk", - "ave" - ], - "Estimated Cardinality": "182343" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_name" - ], + "Join Type": "INNER", + "Conditions": "(s_store_sk = ss_store_sk)", "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "182343" + "Conditions": [ + "(ss_store_sk = s_store_sk)", + "(CAST(revenue AS DOUBLE) <= (0.1 * ave))" + ], + "Estimated Cardinality": "1710" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(ss_store_sk = s_store_sk)", - "(CAST(revenue AS DOUBLE) <= (0.1 * ave))" - ], - "Estimated Cardinality": "12048087" + "Conditions": "(i_item_sk = ss_item_sk)", + "Estimated Cardinality": "1710" } } ], @@ -831,7 +760,7 @@ logical_opt [ "i_wholesale_cost", "i_brand" ], - "Estimated Cardinality": "12048087" + "Estimated Cardinality": "1710" } } ], @@ -851,6 +780,21 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_desc", + "i_current_price", + "i_wholesale_cost", + "i_brand" + ], + "Estimated Cardinality": "1800" + } + }, { "name": "HASH_JOIN", "children": [ @@ -906,10 +850,10 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" + "#3" ], "Estimated Cardinality": "288464" } @@ -931,52 +875,39 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } }, { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_desc", - "i_current_price", - "i_wholesale_cost", - "i_brand" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "288463" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_name" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { "name": "PROJECTION", @@ -988,161 +919,160 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_store_sk", + "ss_sales_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1176i64 <= $.d_month_seq <= 1187i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1176i64 <= $.d_month_seq <= 1187i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Projections": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS TINYINT)", + "#2", + "#3" + ], "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_utinyint(#1, 1)", - "#2", - "__internal_compress_integral_usmallint(#3, 2450816)" + "ss_store_sk", + "ss_item_sk", + "ss_sales_price" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "ss_store_sk", - "ss_item_sk", - "ss_sales_price" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "288464" + "Aggregates": "sum(#2)", + "Estimated Cardinality": "1710" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2" ], - "Aggregates": "sum(#2)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" + "ss_store_sk", + "revenue" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Projections": [ - "ss_store_sk", - "revenue" + "CAST(#0 AS TINYINT)", + "#1" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", - "#1" + "ss_store_sk", + "revenue" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1710" } } ], "extra_info": { - "Projections": [ - "ss_store_sk", - "revenue" - ], - "Estimated Cardinality": "288463" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" - ], - "Estimated Cardinality": "182343" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_name" - ], + "Join Type": "INNER", + "Conditions": "s_store_sk = ss_store_sk", "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "182343" + "Conditions": [ + "ss_store_sk = s_store_sk", + "CAST(revenue AS DOUBLE) <= (0.1 * ave)" + ], + "Estimated Cardinality": "1710" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "ss_store_sk = s_store_sk", - "CAST(revenue AS DOUBLE) <= (0.1 * ave)" - ], - "Estimated Cardinality": "12048087" + "Conditions": "i_item_sk = ss_item_sk", + "Estimated Cardinality": "1710" } } ], @@ -1155,16 +1085,17 @@ physical_plan [ "i_wholesale_cost", "i_brand" ], - "Estimated Cardinality": "12048087" + "Estimated Cardinality": "1710" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.store.s_store_name ASC", - "memory.main.item.i_item_desc ASC" - ] + "s_store_name ASC", + "i_item_desc ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q66.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q66.slt.no index 870c5d6cca8..0fbce022ad3 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q66.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q66.slt.no @@ -964,7 +964,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "x.w_warehouse_name" + "Order By": "w_warehouse_name" } } ], @@ -1013,6 +1013,18 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1023,94 +1035,47 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_sold_time_sk", - "ws_ship_mode_sk", - "ws_warehouse_sk", - "ws_quantity", - "ws_ext_sales_price", - "ws_net_paid" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "2921" + "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Conditions": "(ws_ship_mode_sk = sm_ship_mode_sk)", + "Estimated Cardinality": "14326" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name", - "w_warehouse_sq_ft", - "w_city", - "w_county", - "w_state", - "w_country" + "Filters": [ + "(30838i64 <= $.t_time <= 59638i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" ], - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_warehouse_sk = w_warehouse_sk)", - "Estimated Cardinality": "14322" + "Conditions": "(ws_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "3456" } }, { @@ -1120,50 +1085,38 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(30838i64 <= $.t_time <= 59638i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "17280" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "__internal_compress_integral_utinyint(#2, 977787)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "4" - } - } - ], - "extra_info": { - "Expressions": "sm_ship_mode_sk", - "Estimated Cardinality": "4" + "Conditions": "(ws_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "3456" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_ship_mode_sk = sm_ship_mode_sk)", - "Estimated Cardinality": "14322" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "3456" } } ], @@ -1190,21 +1143,22 @@ logical_opt [ "(d_moy = 10)", "(d_moy = 11)", "(d_moy = 12)", - "ws_net_paid" + "ws_net_paid", + "#11" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "3456" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 977787)", + "#22", "#2", "#3", "#4", "#5", - "__internal_compress_integral_utinyint(#6, 2001)", + "__internal_compress_integral_utinyint(#6, 1900)", "#7", "#8", "#9", @@ -1221,7 +1175,7 @@ logical_opt [ "#20", "#21" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "3456" } } ], @@ -1261,7 +1215,7 @@ logical_opt [ "sum(CASE WHEN (#19) THEN ((CAST(ws_net_paid AS DECIMAL(26,2)) * CAST(ws_quantity AS DECIMAL(26,0)))) ELSE 0.00 END)", "sum(CASE WHEN (#20) THEN ((CAST(ws_net_paid AS DECIMAL(26,2)) * CAST(ws_quantity AS DECIMAL(26,0)))) ELSE 0.00 END)" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } } ], @@ -1273,7 +1227,7 @@ logical_opt [ "#3", "#4", "#5", - "__internal_decompress_integral_bigint(#6, 2001)", + "__internal_decompress_integral_bigint(#6, 1900)", "#7", "#8", "#9", @@ -1299,7 +1253,7 @@ logical_opt [ "#29", "#30" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } } ], @@ -1338,7 +1292,7 @@ logical_opt [ "nov_net", "dec_net" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } }, { @@ -1369,94 +1323,47 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_sold_time_sk", - "cs_ship_mode_sk", - "cs_warehouse_sk", - "cs_quantity", - "cs_sales_price", - "cs_net_paid_inc_tax" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "2921" + "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Conditions": "(cs_ship_mode_sk = sm_ship_mode_sk)", + "Estimated Cardinality": "28731" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name", - "w_warehouse_sq_ft", - "w_city", - "w_county", - "w_state", - "w_country" + "Filters": [ + "(30838i64 <= $.t_time <= 59638i64)", + "(26i64 <= $.t_time_sk <= 86359i64)" ], - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_warehouse_sk = w_warehouse_sk)", - "Estimated Cardinality": "28723" + "Conditions": "(cs_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "5750" } }, { @@ -1466,50 +1373,50 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(30838i64 <= $.t_time <= 59638i64)", - "(26i64 <= $.t_time_sk <= 86359i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "17280" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "__internal_compress_integral_utinyint(#2, 977787)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "28723" + "Conditions": "(cs_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "5750" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "4" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "sm_ship_mode_sk", - "Estimated Cardinality": "4" + "Filters": [ + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_ship_mode_sk = sm_ship_mode_sk)", - "Estimated Cardinality": "28723" + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "5750" } } ], @@ -1536,21 +1443,22 @@ logical_opt [ "(d_moy = 10)", "(d_moy = 11)", "(d_moy = 12)", - "cs_net_paid_inc_tax" + "cs_net_paid_inc_tax", + "#9" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "5750" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 977787)", + "#22", "#2", "#3", "#4", "#5", - "__internal_compress_integral_utinyint(#6, 2001)", + "__internal_compress_integral_utinyint(#6, 1900)", "#7", "#8", "#9", @@ -1567,7 +1475,7 @@ logical_opt [ "#20", "#21" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "5750" } } ], @@ -1607,7 +1515,7 @@ logical_opt [ "sum(CASE WHEN (#19) THEN ((CAST(cs_net_paid_inc_tax AS DECIMAL(26,2)) * CAST(cs_quantity AS DECIMAL(26,0)))) ELSE 0.00 END)", "sum(CASE WHEN (#20) THEN ((CAST(cs_net_paid_inc_tax AS DECIMAL(26,2)) * CAST(cs_quantity AS DECIMAL(26,0)))) ELSE 0.00 END)" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], @@ -1619,7 +1527,7 @@ logical_opt [ "#3", "#4", "#5", - "__internal_decompress_integral_bigint(#6, 2001)", + "__internal_decompress_integral_bigint(#6, 1900)", "#7", "#8", "#9", @@ -1645,7 +1553,7 @@ logical_opt [ "#29", "#30" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], @@ -1684,13 +1592,13 @@ logical_opt [ "nov_net", "dec_net" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -1730,7 +1638,7 @@ logical_opt [ "nov_net", "dec_net" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -1743,7 +1651,7 @@ logical_opt [ "#4", "#5", "__internal_compress_string_uhugeint(#6)", - "__internal_compress_integral_utinyint(#7, 2001)", + "__internal_compress_integral_utinyint(#7, 1900)", "#8", "#9", "#10", @@ -1770,7 +1678,7 @@ logical_opt [ "#31", "#32" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -1823,7 +1731,7 @@ logical_opt [ "sum(nov_net)", "sum(dec_net)" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "123" } } ], @@ -1836,7 +1744,7 @@ logical_opt [ "#4", "#5", "__internal_decompress_string(#6)", - "__internal_decompress_integral_bigint(#7, 2001)", + "__internal_decompress_integral_bigint(#7, 1900)", "#8", "#9", "#10", @@ -1874,7 +1782,7 @@ logical_opt [ "#42", "#43" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "123" } } ], @@ -1925,7 +1833,7 @@ logical_opt [ "nov_net", "dec_net" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "123" } } ], @@ -1978,6 +1886,23 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year", + "d_moy" + ], + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -2009,22 +1934,41 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "2921" + "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", + "Projections": "sm_ship_mode_sk", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Conditions": "ws_ship_mode_sk = sm_ship_mode_sk", + "Estimated Cardinality": "14326" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(30838i64 <= $.t_time <= 59638i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" + ], + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_time_sk = t_time_sk", + "Estimated Cardinality": "3456" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "READ_VORTEX", "children": [], @@ -2044,46 +1988,31 @@ physical_plan [ } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(30838i64 <= $.t_time <= 59638i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "__internal_compress_integral_utinyint(#2, 977787)" ], - "Projections": "t_time_sk", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_time_sk = t_time_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", - "Projections": "sm_ship_mode_sk", - "Estimated Cardinality": "4" + "Conditions": "ws_warehouse_sk = w_warehouse_sk", + "Estimated Cardinality": "3456" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_ship_mode_sk = sm_ship_mode_sk", - "Estimated Cardinality": "14322" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "3456" } } ], @@ -2110,21 +2039,22 @@ physical_plan [ "(d_moy = 10)", "(d_moy = 11)", "(d_moy = 12)", - "ws_net_paid" + "ws_net_paid", + "#11" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "3456" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 977787)", + "#22", "#2", "#3", "#4", "#5", - "__internal_compress_integral_utinyint(#6, 2001)", + "__internal_compress_integral_utinyint(#6, 1900)", "#7", "#8", "#9", @@ -2141,7 +2071,7 @@ physical_plan [ "#20", "#21" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "3456" } } ], @@ -2179,7 +2109,7 @@ physical_plan [ "CASE WHEN (#19) THEN ((CAST(ws_net_paid AS DECIMAL(26,2)) * CAST(ws_quantity AS DECIMAL(26,0)))) ELSE 0.00 END", "CASE WHEN (#20) THEN ((CAST(ws_net_paid AS DECIMAL(26,2)) * CAST(ws_quantity AS DECIMAL(26,0)))) ELSE 0.00 END" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "3456" } } ], @@ -2219,7 +2149,7 @@ physical_plan [ "sum(#29)", "sum(#30)" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } } ], @@ -2231,7 +2161,7 @@ physical_plan [ "#3", "#4", "#5", - "__internal_decompress_integral_bigint(#6, 2001)", + "__internal_decompress_integral_bigint(#6, 1900)", "#7", "#8", "#9", @@ -2257,7 +2187,7 @@ physical_plan [ "#29", "#30" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } } ], @@ -2296,7 +2226,7 @@ physical_plan [ "nov_net", "dec_net" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "147" } }, { @@ -2351,22 +2281,41 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": [ - "d_date_sk", - "d_year", - "d_moy" - ], - "Estimated Cardinality": "2921" + "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", + "Projections": "sm_ship_mode_sk", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_ship_mode_sk = sm_ship_mode_sk", + "Estimated Cardinality": "28731" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(30838i64 <= $.t_time <= 59638i64)", + "(26i64 <= $.t_time_sk <= 86359i64)" + ], + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_time_sk = t_time_sk", + "Estimated Cardinality": "5750" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "READ_VORTEX", "children": [], @@ -2386,29 +2335,24 @@ physical_plan [ } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "28723" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(30838i64 <= $.t_time <= 59638i64)", - "(26i64 <= $.t_time_sk <= 86359i64)" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "__internal_compress_integral_utinyint(#2, 977787)" ], - "Projections": "t_time_sk", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_time_sk = t_time_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_warehouse_sk = w_warehouse_sk", + "Estimated Cardinality": "5750" } }, { @@ -2416,16 +2360,23 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"DHL\", \"BARIAN\"], $.sm_carrier, opts=sql_null_semantics)", - "Projections": "sm_ship_mode_sk", - "Estimated Cardinality": "4" + "Filters": [ + "($.d_year = 2001i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": [ + "d_date_sk", + "d_year", + "d_moy" + ], + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_ship_mode_sk = sm_ship_mode_sk", - "Estimated Cardinality": "28723" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "5750" } } ], @@ -2452,21 +2403,22 @@ physical_plan [ "(d_moy = 10)", "(d_moy = 11)", "(d_moy = 12)", - "cs_net_paid_inc_tax" + "cs_net_paid_inc_tax", + "#9" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "5750" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_utinyint(#1, 977787)", + "#22", "#2", "#3", "#4", "#5", - "__internal_compress_integral_utinyint(#6, 2001)", + "__internal_compress_integral_utinyint(#6, 1900)", "#7", "#8", "#9", @@ -2483,7 +2435,7 @@ physical_plan [ "#20", "#21" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "5750" } } ], @@ -2521,7 +2473,7 @@ physical_plan [ "CASE WHEN (#19) THEN ((CAST(cs_net_paid_inc_tax AS DECIMAL(26,2)) * CAST(cs_quantity AS DECIMAL(26,0)))) ELSE 0.00 END", "CASE WHEN (#20) THEN ((CAST(cs_net_paid_inc_tax AS DECIMAL(26,2)) * CAST(cs_quantity AS DECIMAL(26,0)))) ELSE 0.00 END" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "5750" } } ], @@ -2561,7 +2513,7 @@ physical_plan [ "sum(#29)", "sum(#30)" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], @@ -2573,7 +2525,7 @@ physical_plan [ "#3", "#4", "#5", - "__internal_decompress_integral_bigint(#6, 2001)", + "__internal_decompress_integral_bigint(#6, 1900)", "#7", "#8", "#9", @@ -2599,7 +2551,7 @@ physical_plan [ "#29", "#30" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], @@ -2638,7 +2590,7 @@ physical_plan [ "nov_net", "dec_net" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "147" } } ], @@ -2681,7 +2633,7 @@ physical_plan [ "nov_net", "dec_net" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -2694,7 +2646,7 @@ physical_plan [ "#4", "#5", "__internal_compress_string_uhugeint(#6)", - "__internal_compress_integral_utinyint(#7, 2001)", + "__internal_compress_integral_utinyint(#7, 1900)", "#8", "#9", "#10", @@ -2721,7 +2673,7 @@ physical_plan [ "#31", "#32" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -2772,7 +2724,7 @@ physical_plan [ "nov_net", "dec_net" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "294" } } ], @@ -2825,7 +2777,7 @@ physical_plan [ "sum(#42)", "sum(#43)" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "123" } } ], @@ -2838,7 +2790,7 @@ physical_plan [ "#4", "#5", "__internal_decompress_string(#6)", - "__internal_decompress_integral_bigint(#7, 2001)", + "__internal_decompress_integral_bigint(#7, 1900)", "#8", "#9", "#10", @@ -2876,13 +2828,14 @@ physical_plan [ "#42", "#43" ], - "Estimated Cardinality": "43045" + "Estimated Cardinality": "123" } } ], "extra_info": { "Top": "100", - "Order By": "x.w_warehouse_name ASC" + "Order By": "w_warehouse_name ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q67.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q67.slt.no index 26d2998e67f..f090e0a5b3d 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q67.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q67.slt.no @@ -313,7 +313,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)" + "Expressions": "rank() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)" } } ], @@ -356,16 +356,16 @@ logical_plan [ ], "extra_info": { "Order By": [ - "dw2.i_category", - "dw2.i_class", - "dw2.i_brand", - "dw2.i_product_name", - "dw2.d_year", - "dw2.d_qoy", - "dw2.d_moy", - "dw2.s_store_id", - "dw2.sumsales", - "dw2.rk" + "i_category", + "i_class", + "i_brand", + "i_product_name", + "d_year", + "d_qoy", + "d_moy", + "s_store_id", + "sumsales", + "rk" ] } } @@ -395,147 +395,1027 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#9", + "CAST(#7 AS TINYINT)", + "CAST(#8 AS TINYINT)" ], "Estimated Cardinality": "288464" } - }, + } + ], + "extra_info": { + "Groups": [ + "i_category", + "i_class", + "i_brand", + "i_product_name", + "d_year", + "d_qoy", + "d_moy", + "s_store_id" + ], + "Expressions": "sum(COALESCE((CAST(ss_sales_price AS DECIMAL(26,2)) * CAST(ss_quantity AS DECIMAL(26,0))), 0.00)) EXPORT_STATE", + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "#7", + "#8" + ], + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "144232" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "48", + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "CAST(#5 AS TINYINT)", + "CAST(#6 AS TINYINT)", + "#7", + "#8" + ], + "Estimated Cardinality": "144232" + } + } + ], "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Expressions": "combine_aggr(#8)", + "Estimated Cardinality": "72116" } } ], "extra_info": { "Expressions": [ - "d_date_sk", - "d_year", - "d_moy", - "d_qoy" + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "#7" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "72116" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "72116" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "52", + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "CAST(#5 AS TINYINT)", + "#6", + "#7" + ], + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Expressions": "combine_aggr(#7)", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "#6" + ], + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Estimated Cardinality": "36058" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "56", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "#5", + "#6" + ], + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Expressions": "combine_aggr(#6)", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "#5" + ], + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "18029" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Expressions": "combine_aggr(#5)", + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "9014" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "64", + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Expressions": "combine_aggr(#4)", + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "4507" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "68", + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Expressions": "combine_aggr(#3)", + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "2253" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "72", + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "combine_aggr(#2)", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "1126" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "76", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#0)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "76", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#1)" + ], + "Estimated Cardinality": "1126" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "72", + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#2)" + ], + "Estimated Cardinality": "2253" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "68", + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#3)" + ], + "Estimated Cardinality": "4507" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "64", + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#4)" + ], + "Estimated Cardinality": "9014" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#5)" + ], + "Estimated Cardinality": "18029" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "56", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#6)" + ], + "Estimated Cardinality": "36058" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "52", + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "NULL::VARCHAR", + "finalize(#7)" + ], + "Estimated Cardinality": "72116" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "48", + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "finalize(#8)" + ], + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_76", + "Table Index": "76", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_72", + "Table Index": "72", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_68", + "Table Index": "68", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_64", + "Table Index": "64", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_60", + "Table Index": "60", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "CTE Name": "__grouping_sets_cte_56", + "Table Index": "56", + "Estimated Cardinality": "287336" } } ], "extra_info": { "Expressions": [ - "s_store_sk", - "s_store_id" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand", - "i_class", - "i_category", - "i_product_name" - ], - "Estimated Cardinality": "1800" + "CTE Name": "__grouping_sets_cte_52", + "Table Index": "52", + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Groups": [ - "i_category", - "i_class", - "i_brand", - "i_product_name", - "d_year", - "d_qoy", - "d_moy", - "s_store_id" - ], - "Expressions": "sum(COALESCE((CAST(ss_sales_price AS DECIMAL(26,2)) * CAST(ss_quantity AS DECIMAL(26,0))), 0.00))", - "Estimated Cardinality": "288464" + "CTE Name": "__grouping_sets_cte_48", + "Table Index": "48", + "Estimated Cardinality": "287336" } } ], @@ -551,19 +1431,19 @@ logical_opt [ "s_store_id", "sumsales" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)", - "Estimated Cardinality": "288464" + "Expressions": "rank() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)", + "Estimated Cardinality": "287336" } } ], "extra_info": { "Expressions": "(rk <= 100)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "57467" } } ], @@ -580,7 +1460,7 @@ logical_opt [ "sumsales", "rk" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "57467" } } ], @@ -597,7 +1477,7 @@ logical_opt [ "sumsales", "rk" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "57467" } } ], @@ -621,136 +1501,915 @@ physical_plan [ "name": "WINDOW", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_store_sk", + "ss_quantity", + "ss_sales_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_id" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_brand", + "i_class", + "i_category", + "i_product_name" + ], + "Estimated Cardinality": "1800" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year", + "d_moy", + "d_qoy" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_quantity", - "ss_sales_price" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_year", - "d_moy", - "d_qoy" - ], - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_store_id" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#9", + "CAST(#7 AS TINYINT)", + "CAST(#8 AS TINYINT)" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_brand", - "i_class", "i_category", - "i_product_name" + "i_class", + "i_brand", + "i_product_name", + "d_year", + "d_qoy", + "d_moy", + "s_store_id", + "COALESCE((CAST(ss_sales_price AS DECIMAL(26,2)) * CAST(ss_quantity AS DECIMAL(26,0))), 0.00)" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "288464" + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Aggregates": "sum(#8) EXPORT_STATE", + "Estimated Cardinality": "144232" } } ], "extra_info": { "Projections": [ - "i_category", - "i_class", - "i_brand", - "i_product_name", - "d_year", - "d_qoy", - "d_moy", - "s_store_id", - "COALESCE((CAST(ss_sales_price AS DECIMAL(26,2)) * CAST(ss_quantity AS DECIMAL(26,0))), 0.00)" + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "#7", + "#8" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "144232" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "48", + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "CAST(#5 AS TINYINT)", + "CAST(#6 AS TINYINT)", + "#7", + "#8" + ], + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#8" + ], + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Aggregates": "combine_aggr(#7)", + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "CAST(#6 AS BIGINT)", + "#7" + ], + "Estimated Cardinality": "72116" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "52", + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "CAST(#5 AS TINYINT)", + "#6", + "#7" + ], + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#7" + ], + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5" + ], + "Aggregates": "combine_aggr(#6)", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "CAST(#5 AS BIGINT)", + "#6" + ], + "Estimated Cardinality": "36058" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "56", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_compress_integral_utinyint(#4, 1900)", + "#5", + "#6" + ], + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#6" + ], + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Aggregates": "combine_aggr(#5)", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "__internal_decompress_integral_bigint(#4, 1900)", + "#5" + ], + "Estimated Cardinality": "18029" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#5" + ], + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Aggregates": "combine_aggr(#4)", + "Estimated Cardinality": "9014" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "64", + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#4" + ], + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1", + "#2" + ], + "Aggregates": "combine_aggr(#3)", + "Estimated Cardinality": "4507" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "68", + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#3" + ], + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "combine_aggr(#2)", + "Estimated Cardinality": "2253" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "72", + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2" + ], + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "combine_aggr(#1)", + "Estimated Cardinality": "1126" + } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "76", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Projections": "#1", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Aggregates": "combine_aggr(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#0)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "76", + "Estimated Cardinality": "1126" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#1)" + ], + "Estimated Cardinality": "1126" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "72", + "Estimated Cardinality": "2253" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "NULL::VARCHAR", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#2)" + ], + "Estimated Cardinality": "2253" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "68", + "Estimated Cardinality": "4507" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "NULL::VARCHAR", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#3)" + ], + "Estimated Cardinality": "4507" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "64", + "Estimated Cardinality": "9014" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#4)" + ], + "Estimated Cardinality": "9014" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "18029" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "NULL::BIGINT", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#5)" + ], + "Estimated Cardinality": "18029" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "56", + "Estimated Cardinality": "36058" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "NULL::BIGINT", + "NULL::VARCHAR", + "finalize(#6)" + ], + "Estimated Cardinality": "36058" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "52", + "Estimated Cardinality": "72116" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "NULL::VARCHAR", + "finalize(#7)" + ], + "Estimated Cardinality": "72116" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "48", + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "finalize(#8)" + ], + "Estimated Cardinality": "144232" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_76", + "Table Index": "76", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_72", + "Table Index": "72", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_68", + "Table Index": "68", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_64", + "Table Index": "64", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_60", + "Table Index": "60", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_56", + "Table Index": "56", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_52", + "Table Index": "52", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7" - ], - "Aggregates": "sum(#8)", - "Estimated Cardinality": "288464" + "CTE Name": "__grouping_sets_cte_48", + "Table Index": "48", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "287336" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY i_category ORDER BY sumsales DESC NULLS LAST)", + "Estimated Cardinality": "287336" } } ], @@ -767,30 +2426,31 @@ physical_plan [ "#8", "#9" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "287336" } } ], "extra_info": { "Expression": "(rk <= 100)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "57467" } } ], "extra_info": { "Top": "100", "Order By": [ - "dw2.i_category ASC", - "dw2.i_class ASC", - "dw2.i_brand ASC", - "dw2.i_product_name ASC", - "dw2.d_year ASC", - "dw2.d_qoy ASC", - "dw2.d_moy ASC", - "dw2.s_store_id ASC", - "dw2.sumsales ASC", - "dw2.rk ASC" - ] + "i_category ASC", + "i_class ASC", + "i_brand ASC", + "i_product_name ASC", + "d_year ASC", + "d_qoy ASC", + "d_moy ASC", + "s_store_id ASC", + "sumsales ASC", + "rk ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q68.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q68.slt.no index 3577151558c..b6d76c12015 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q68.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q68.slt.no @@ -434,8 +434,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name", - "dn.ss_ticket_number" + "c_last_name", + "ss_ticket_number" ] } } @@ -459,13 +459,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -477,93 +477,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_ext_sales_price", - "ss_ext_list_price", - "ss_ext_tax" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(1i64 <= $.d_dom <= 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -575,35 +496,33 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", "Function": "Vortex Scan", - "Estimated Cardinality": "5000" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_city" - ], + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "5000" } } @@ -611,110 +530,92 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(ss_addr_sk = ca_address_sk)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(1i64 <= $.d_dom <= 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "ca_city" - ], "Expressions": [ - "sum(ss_ext_sales_price)", - "sum(ss_ext_list_price)", - "sum(ss_ext_tax)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { + "Groups": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "ca_city" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5", - "#6" + "sum(ss_ext_sales_price)", + "sum(ss_ext_list_price)", + "sum(ss_ext_tax)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": [ - "ss_ticket_number", - "ss_customer_sk", - "bought_city", - "extended_price", - "list_price", - "extended_tax" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_addr_sk", - "c_first_name", - "c_last_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_city" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "5000" } } @@ -732,7 +633,7 @@ logical_opt [ "(ss_customer_sk = c_customer_sk)", "(bought_city != ca_city)" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -747,7 +648,7 @@ logical_opt [ "extended_tax", "list_price" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -771,16 +672,16 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -792,45 +693,21 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_ext_sales_price", - "ss_ext_list_price", - "ss_ext_tax" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(1i64 <= $.d_dom <= 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_ticket_number", + "ss_ext_sales_price", + "ss_ext_list_price", + "ss_ext_tax" + ], "Estimated Cardinality": "288464" } }, @@ -839,16 +716,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" + "Filters": "(($.hd_dep_count = 4i64) or ($.hd_vehicle_count = 3i32))", + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "57692" } }, { @@ -856,16 +733,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(($.hd_dep_count = 4i64) or ($.hd_vehicle_count = 3i32))", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Filters": "vortex.list.contains([\"Fairview\", \"Midway\"], $.s_city, opts=sql_null_semantics)", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "57692" } }, { @@ -884,78 +761,87 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_addr_sk = ca_address_sk", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(1i64 <= $.d_dom <= 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "ca_city", - "ss_ext_sales_price", - "ss_ext_list_price", - "ss_ext_tax" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": [ - "sum(#4)", - "sum(#5)", - "sum(#6)" + "Projections": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "ca_city", + "ss_ext_sales_price", + "ss_ext_list_price", + "ss_ext_tax" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5", - "#6" + "Groups": [ + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "288464" + "Aggregates": [ + "sum(#4)", + "sum(#5)", + "sum(#6)" + ], + "Estimated Cardinality": "57691" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "bought_city", - "extended_price", - "list_price", - "extended_tax" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } }, { @@ -1001,7 +887,7 @@ physical_plan [ "ss_customer_sk = c_customer_sk", "bought_city != ca_city" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], @@ -1016,16 +902,17 @@ physical_plan [ "extended_tax", "list_price" ], - "Estimated Cardinality": "4932665" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer.c_last_name ASC", - "dn.ss_ticket_number ASC" - ] + "c_last_name ASC", + "ss_ticket_number ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q69.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q69.slt.no index 23e1c611bd2..62bf91790ec 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q69.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q69.slt.no @@ -356,8 +356,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -551,8 +550,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -746,8 +744,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -791,11 +788,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer_demographics.cd_gender", - "memory.main.customer_demographics.cd_marital_status", - "memory.main.customer_demographics.cd_education_status", - "memory.main.customer_demographics.cd_purchase_estimate", - "memory.main.customer_demographics.cd_credit_rating" + "cd_gender", + "cd_marital_status", + "cd_education_status", + "cd_purchase_estimate", + "cd_credit_rating" ] } } @@ -822,99 +819,64 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { - "name": "DELIM_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_education_status", - "cd_purchase_estimate", - "cd_credit_rating" - ], - "Estimated Cardinality": "192080" + "Filters": "is_not_null($.ss_customer_sk)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"KY\", \"GA\", \"NM\"], $.ca_state, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "10000" + "Filters": [ + "($.d_year = 2001i64)", + "(4i64 <= $.d_moy <= 6i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "192080" + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Expressions": "c_customer_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ { "name": "PROJECTION", "children": [ @@ -922,119 +884,58 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(4i64 <= $.d_moy <= 6i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Filters": "is_not_null($.cs_ship_customer_sk)", + "Function": "Vortex Scan", + "Estimated Cardinality": "28731" } }, { - "name": "DELIM_GET", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9999" + "Filters": [ + "($.d_year = 2001i64)", + "(4i64 <= $.d_moy <= 6i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57671" + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { "Expressions": "c_customer_sk", - "Estimated Cardinality": "57671" + "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "38416" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "is_not_null($.ws_bill_customer_sk)", "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1045,61 +946,24 @@ logical_opt [ "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Expressions": "c_customer_sk", + "Estimated Cardinality": "14326" } }, { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "9785" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "14014" - } - } - ], - "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "14014" - } - } - ], - "extra_info": { - "Join Type": "ANTI", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "7683" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1107,73 +971,51 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "143657" + "Estimated Cardinality": "10000" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ship_customer_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 2001i64)", - "(4i64 <= $.d_moy <= 6i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "vortex.list.contains([\"KY\", \"GA\", \"NM\"], $.ca_state, opts=sql_null_semantics)", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "5361" + "Join Type": "RIGHT_ANTI", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_ship_customer_sk = c_customer_sk)", - "Estimated Cardinality": "15398" + "Join Type": "RIGHT_ANTI", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "80" } } ], "extra_info": { - "Expressions": "c_customer_sk", - "Estimated Cardinality": "15398" + "Join Type": "RIGHT_SEMI", + "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", + "Estimated Cardinality": "16" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "(c_customer_sk IS NOT DISTINCT FROM c_customer_sk)", - "Estimated Cardinality": "1536" + "Join Type": "INNER", + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", + "Estimated Cardinality": "16" } } ], @@ -1182,10 +1024,11 @@ logical_opt [ "#0", "#1", "#2", - "__internal_compress_integral_usmallint(#3, 500)", - "#4" + "CAST(#3 AS SMALLINT)", + "#4", + "#5" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1198,7 +1041,7 @@ logical_opt [ "cd_credit_rating" ], "Expressions": "count_star()", - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1207,11 +1050,11 @@ logical_opt [ "#0", "#1", "#2", - "__internal_decompress_integral_bigint(#3, 500)", + "CAST(#3 AS BIGINT)", "#4", "#5" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1226,13 +1069,13 @@ logical_opt [ "cd_credit_rating", "cnt3" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "16" } } ] @@ -1256,13 +1099,30 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "optional: Dynamic Filter (cd_gender)", + "Projections": [ + "cd_demo_sk", + "cd_gender", + "cd_marital_status", + "cd_education_status", + "cd_purchase_estimate", + "cd_credit_rating" + ], + "Estimated Cardinality": "192080" + } + }, + { + "name": "HASH_JOIN", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", @@ -1272,18 +1132,47 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Filters": "is_not_null($.ss_customer_sk)", "Projections": [ - "cd_demo_sk", - "cd_gender", - "cd_marital_status", - "cd_education_status", - "cd_purchase_estimate", - "cd_credit_rating" + "ss_sold_date_sk", + "ss_customer_sk" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "57692" } }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2001i64)", + "(4i64 <= $.d_moy <= 6i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Projections": "c_customer_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ { "name": "HASH_JOIN", "children": [ @@ -1292,12 +1181,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "is_not_null($.cs_ship_customer_sk)", "Projections": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_addr_sk" + "cs_sold_date_sk", + "cs_ship_customer_sk" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "28731" } }, { @@ -1305,133 +1194,33 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"KY\", \"GA\", \"NM\"], $.ca_state, opts=sql_null_semantics)", - "Projections": "ca_address_sk", - "Estimated Cardinality": "1000" + "Filters": [ + "($.d_year = 2001i64)", + "(4i64 <= $.d_moy <= 6i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "10000" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cd_demo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "192080" + "Projections": "c_customer_sk", + "Estimated Cardinality": "28731" } }, { "name": "HASH_JOIN", "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "38416" - } - }, { "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "9999" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57671" - } - } - ], - "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "57671" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "9999" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "38416", - "Delim Index": "1" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "7683" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -1441,11 +1230,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "is_not_null($.ws_bill_customer_sk)", "Projections": [ "ws_sold_date_sk", "ws_bill_customer_sk" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14326" } }, { @@ -1453,79 +1243,28 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", + "Filters": [ + "($.d_year = 2001i64)", + "(4i64 <= $.d_moy <= 6i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "9785" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", - "Estimated Cardinality": "14014" + "Projections": "c_customer_sk", + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "14014" - } - } - ], - "extra_info": { - "Join Type": "ANTI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "7683" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "9785" - } - } - ], - "extra_info": { - "Join Type": "ANTI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "7683", - "Delim Index": "2" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "1536" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ + }, { "name": "HASH_JOIN", "children": [ @@ -1535,10 +1274,11 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", - "cs_ship_customer_sk" + "c_customer_sk", + "c_current_cdemo_sk", + "c_current_addr_sk" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "10000" } }, { @@ -1546,61 +1286,44 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2001", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "vortex.list.contains([\"KY\", \"GA\", \"NM\"], $.ca_state, opts=sql_null_semantics)", + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "3", - "Estimated Cardinality": "5361" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_ship_customer_sk = c_customer_sk", - "Estimated Cardinality": "15398" + "Join Type": "RIGHT_ANTI", + "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", + "Estimated Cardinality": "400" } } ], "extra_info": { - "Projections": "c_customer_sk", - "Estimated Cardinality": "15398" + "Join Type": "RIGHT_ANTI", + "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", + "Estimated Cardinality": "80" } } ], "extra_info": { - "Join Type": "ANTI", + "Join Type": "RIGHT_SEMI", "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "1536" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#5", - "Aggregates": "", - "Estimated Cardinality": "5361" + "Estimated Cardinality": "16" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "c_customer_sk IS NOT DISTINCT FROM c_customer_sk", - "Estimated Cardinality": "1536", - "Delim Index": "3" + "Join Type": "INNER", + "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Estimated Cardinality": "16" } } ], @@ -1609,10 +1332,11 @@ physical_plan [ "#0", "#1", "#2", - "__internal_compress_integral_usmallint(#3, 500)", - "#4" + "CAST(#3 AS SMALLINT)", + "#4", + "#5" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1624,7 +1348,7 @@ physical_plan [ "cd_purchase_estimate", "cd_credit_rating" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1637,7 +1361,7 @@ physical_plan [ "#4" ], "Aggregates": "count_star()", - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1646,11 +1370,11 @@ physical_plan [ "#0", "#1", "#2", - "__internal_decompress_integral_bigint(#3, 500)", + "CAST(#3 AS BIGINT)", "#4", "#5" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], @@ -1665,19 +1389,20 @@ physical_plan [ "cd_credit_rating", "cnt3" ], - "Estimated Cardinality": "1536" + "Estimated Cardinality": "16" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer_demographics.cd_gender ASC", - "memory.main.customer_demographics.cd_marital_status ASC", - "memory.main.customer_demographics.cd_education_status ASC", - "memory.main.customer_demographics.cd_purchase_estimate ASC", - "memory.main.customer_demographics.cd_credit_rating ASC" - ] + "cd_gender ASC", + "cd_marital_status ASC", + "cd_education_status ASC", + "cd_purchase_estimate ASC", + "cd_credit_rating ASC" + ], + "Estimated Cardinality": "16" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q7.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q7.slt.no index 576452d5c9d..78dfcd58e4a 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q7.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q7.slt.no @@ -300,7 +300,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.item.i_item_id" + "Order By": "i_item_id" } } ], @@ -317,13 +317,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -332,127 +332,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_cdemo_sk", - "ss_promo_sk", - "ss_quantity", - "ss_list_price", - "ss_sales_price", - "ss_coupon_amt" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.cd_gender = \"M\")", - "($.cd_marital_status = \"S\")", - "($.cd_education_status = \"College\")", - "(2i64 <= $.cd_demo_sk <= 192076i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "7683" - } - } - ], - "extra_info": { - "Expressions": "cd_demo_sk", - "Estimated Cardinality": "7683" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "11535" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "11535" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -464,52 +351,77 @@ logical_opt [ } ], "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "(ss_promo_sk = p_promo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.cd_gender = \"M\")", + "($.cd_marital_status = \"S\")", + "($.cd_education_status = \"College\")", + "(2i64 <= $.cd_demo_sk <= 192076i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_promo_sk = p_promo_sk)", - "Estimated Cardinality": "11535" + "Conditions": "(ss_cdemo_sk = cd_demo_sk)", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 1)" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "11535" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": [ - "avg(ss_quantity)", - "avg(ss_list_price)", - "avg(ss_coupon_amt)", - "avg(ss_sales_price)" - ], - "Estimated Cardinality": "11307" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { + "Groups": "i_item_id", "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4" + "avg(ss_quantity)", + "avg(ss_list_price)", + "avg(ss_coupon_amt)", + "avg(ss_sales_price)" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1797" } } ], @@ -521,7 +433,7 @@ logical_opt [ "agg3", "agg4" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1797" } } ], @@ -542,7 +454,7 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -554,41 +466,21 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_cdemo_sk", - "ss_promo_sk", - "ss_quantity", - "ss_list_price", - "ss_sales_price", - "ss_coupon_amt" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_cdemo_sk", + "ss_promo_sk", + "ss_quantity", + "ss_list_price", + "ss_sales_price", + "ss_coupon_amt" + ], + "Estimated Cardinality": "288464" } }, { @@ -596,20 +488,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "cd_gender='M'", - "cd_marital_status='S'", - "cd_education_status='College'" - ], - "Projections": "cd_demo_sk", - "Estimated Cardinality": "7683" + "Filters": "(($.p_channel_email = \"N\") or ($.p_channel_event = \"N\"))", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_promo_sk = p_promo_sk", + "Estimated Cardinality": "57692" } }, { @@ -617,18 +505,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": [ - "i_item_sk", - "i_item_id" + "Filters": [ + "($.cd_gender = \"M\")", + "($.cd_marital_status = \"S\")", + "($.cd_education_status = \"College\")", + "(2i64 <= $.cd_demo_sk <= 192076i64)" ], - "Estimated Cardinality": "1800" + "Projections": "cd_demo_sk", + "Estimated Cardinality": "38416" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_cdemo_sk = cd_demo_sk", + "Estimated Cardinality": "11538" } }, { @@ -636,29 +527,38 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(($.p_channel_email = \"N\") or ($.p_channel_event = \"N\"))", - "Projections": "p_promo_sk", - "Estimated Cardinality": "6" + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_promo_sk = p_promo_sk", - "Estimated Cardinality": "11535" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 1)" - ], - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } } ], @@ -670,7 +570,7 @@ physical_plan [ "ss_coupon_amt", "ss_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "11538" } } ], @@ -682,13 +582,14 @@ physical_plan [ "avg(#3)", "avg(#4)" ], - "Estimated Cardinality": "11307" + "Estimated Cardinality": "1797" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.item.i_item_id ASC" + "Order By": "i_item_id ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q70.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q70.slt.no index bf3fb8a0b84..14c4c423519 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q70.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q70.slt.no @@ -395,7 +395,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)" + "Expressions": "rank() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)" } } ], @@ -444,7 +444,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = CAST(0 AS BIGINT))) THEN (s_state) ELSE CAST(NULL AS VARCHAR) END ORDER BY sum(ss_net_profit) DESC NULLS LAST)" + "Expressions": "rank() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = CAST(0 AS BIGINT))) THEN (s_state) ELSE CAST(NULL AS VARCHAR) END ORDER BY sum(ss_net_profit) DESC NULLS LAST)" } } ], @@ -462,9 +462,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "(GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county))", + "lochierarchy", "#[21.5]", - "rank() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (memory.main.store.s_state) ELSE NULL END ORDER BY sum(memory.main.store_sales.ss_net_profit) DESC)" + "rank_within_parent" ] } } @@ -499,41 +499,19 @@ logical_opt [ "name": "WINDOW", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -541,39 +519,35 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_county", - "s_state" - ], - "Estimated Cardinality": "1" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "WINDOW", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", @@ -582,45 +556,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_net_profit" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_state" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } @@ -632,23 +581,14 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -661,110 +601,282 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450816)" - ], - "Estimated Cardinality": "288464" + "Groups": "s_state", + "Expressions": "sum(ss_net_profit)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "s_state", - "Expressions": "sum(ss_net_profit)", + "Expressions": "rank() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "1" + "Expressions": "(ranking <= 5)", + "Estimated Cardinality": "0" } } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)", - "Estimated Cardinality": "1" + "Expressions": "s_state", + "Estimated Cardinality": "0" } } ], "extra_info": { - "Expressions": "(ranking <= 5)", + "Expressions": "s_state", "Estimated Cardinality": "0" } } ], "extra_info": { - "Expressions": "s_state", + "Join Type": "SEMI", + "Conditions": "(s_state = #0)", "Estimated Cardinality": "0" } } ], "extra_info": { - "Expressions": "s_state", - "Estimated Cardinality": "0" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(s_state = #0)", - "Estimated Cardinality": "0" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Groups": [ + "s_state", + "s_county" + ], + "Expressions": "sum(ss_net_profit) EXPORT_STATE", + "Estimated Cardinality": "28846" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "28846" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "63", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "combine_aggr(#2)", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "14423" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "67", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "1", + "1", + "1", + "1", + "1", + "1", + "1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "67", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "0", + "1", + "0", + "1", + "1", + "0", + "1" + ], + "Estimated Cardinality": "14423" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "63", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "finalize(#2)", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "43270" + } + } + ], "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "CTE Name": "__grouping_sets_cte_67", + "Table Index": "67", + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57692" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Groups": [ - "s_state", - "s_county" - ], - "Expressions": "sum(ss_net_profit)", - "Estimated Cardinality": "57683" + "CTE Name": "__grouping_sets_cte_63", + "Table Index": "63", + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (s_state) ELSE NULL END ORDER BY sum(ss_net_profit) DESC NULLS LAST)", - "Estimated Cardinality": "57683" + "Expressions": "rank() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (s_state) ELSE NULL::VARCHAR END ORDER BY sum(ss_net_profit) DESC NULLS LAST)", + "Estimated Cardinality": "43270" } } ], @@ -775,9 +887,9 @@ logical_opt [ "s_county", "lochierarchy", "rank_within_parent", - "CASE WHEN (((GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)) = 0)) THEN (s_state) ELSE NULL END" + "CASE WHEN (((GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)) = 0)) THEN (s_state) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "57683" + "Estimated Cardinality": "43270" } } ], @@ -816,30 +928,17 @@ physical_plan [ "name": "WINDOW", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, { "name": "HASH_JOIN", "children": [ @@ -849,30 +948,43 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_county", - "s_state" + "ss_sold_date_sk", + "ss_store_sk", + "ss_net_profit" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_county", + "s_state" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "WINDOW", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", @@ -938,113 +1050,262 @@ physical_plan [ ], "extra_info": { "Projections": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450816)" + "s_state", + "ss_net_profit" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "s_state", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" + "Groups": "#0", + "Aggregates": "sum(#1)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "sum(#1)", + "Projections": "rank() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)", "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY s_state ORDER BY sum(ss_net_profit) DESC NULLS LAST)" + "Projections": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "1" + "Expression": "(ranking <= 5)", + "Estimated Cardinality": "0" } } ], "extra_info": { - "Expression": "(ranking <= 5)", + "Projections": "#0", "Estimated Cardinality": "0" } } ], "extra_info": { - "Projections": "#0", + "Join Type": "SEMI", + "Conditions": "s_state = #0", "Estimated Cardinality": "0" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "s_state = #0", - "Estimated Cardinality": "0" + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Projections": [ + "s_state", + "s_county", + "ss_net_profit" + ], + "Estimated Cardinality": "57692" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "28846" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "63", + "Estimated Cardinality": "28846" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Projections": [ + "#0", + "#2" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "28846" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57692" + "Groups": "#0", + "Aggregates": "combine_aggr(#1)", + "Estimated Cardinality": "14423" } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "67", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Projections": "#1", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Aggregates": "combine_aggr(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "1", + "1", + "1", + "1", + "1", + "1", + "1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "67", + "Estimated Cardinality": "14423" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "0", + "1", + "0", + "1", + "1", + "0", + "1" + ], + "Estimated Cardinality": "14423" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "63", + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "finalize(#2)", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "Estimated Cardinality": "28846" + } + } + ], + "extra_info": {} } ], "extra_info": { - "Projections": [ - "s_state", - "s_county", - "ss_net_profit" - ], - "Estimated Cardinality": "57692" + "CTE Name": "__grouping_sets_cte_67", + "Table Index": "67", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "sum(#2)", - "Estimated Cardinality": "57683" + "CTE Name": "__grouping_sets_cte_63", + "Table Index": "63", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "43270" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (s_state) ELSE NULL END ORDER BY sum(ss_net_profit) DESC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (s_state) ELSE NULL::VARCHAR END ORDER BY sum(ss_net_profit) DESC NULLS LAST)", + "Estimated Cardinality": "43270" } } ], @@ -1062,7 +1323,7 @@ physical_plan [ "#9", "#10" ], - "Estimated Cardinality": "57683" + "Estimated Cardinality": "43270" } } ], @@ -1073,19 +1334,20 @@ physical_plan [ "s_county", "lochierarchy", "rank_within_parent", - "CASE WHEN (((GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)) = 0)) THEN (s_state) ELSE NULL END" + "CASE WHEN (((GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)) = 0)) THEN (s_state) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "57683" + "Estimated Cardinality": "43270" } } ], "extra_info": { "Top": "100", "Order By": [ - "(GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)) DESC", + "lochierarchy DESC", "#5 ASC", - "rank() OVER (PARTITION BY (GROUPING(memory.main.store.s_state) + GROUPING(memory.main.store.s_county)), CASE WHEN ((GROUPING(memory.main.store.s_county) = 0)) THEN (memory.main.store.s_state) ELSE NULL END ORDER BY sum(memory.main.store_sales.ss_net_profit) DESC) ASC" - ] + "rank_within_parent ASC" + ], + "Estimated Cardinality": "100" } } ], diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q71.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q71.slt.no index b0a4c7b6ff4..d5e28a68630 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q71.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q71.slt.no @@ -564,9 +564,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(tmp.ext_price)", - "memory.main.item.i_brand_id", - "memory.main.time_dim.t_hour" + "ext_price", + "brand_id", + "t_hour" ] } } @@ -612,55 +612,32 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_sold_time_sk", - "ws_item_sk", - "ws_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 1999i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], @@ -670,7 +647,7 @@ logical_opt [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], @@ -680,7 +657,7 @@ logical_opt [ "#1", "#2" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } }, { @@ -693,55 +670,32 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_sold_time_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 1999i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28723" + "Estimated Cardinality": "143657" } } ], @@ -751,7 +705,7 @@ logical_opt [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "143657" } } ], @@ -761,7 +715,7 @@ logical_opt [ "#1", "#2" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "143657" } }, { @@ -774,55 +728,32 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_sold_time_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_moy = 11i64)", - "($.d_year = 1999i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": [ + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -832,7 +763,7 @@ logical_opt [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -842,66 +773,40 @@ logical_opt [ "#1", "#2" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100722" + "Estimated Cardinality": "503753" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_manager_id = 1i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_brand" - ], - "Estimated Cardinality": "72" + "Filters": "($.i_manager_id = 1i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(sold_item_sk = i_item_sk)", - "Estimated Cardinality": "20144" + "Estimated Cardinality": "100750" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.t_meal_time = \"breakfast\") or ($.t_meal_time = \"dinner\"))", - "(26i64 <= $.t_time_sk <= 86359i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "17280" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "t_time_sk", - "t_hour", - "t_minute" + "Filters": [ + "(($.t_meal_time = \"breakfast\") or ($.t_meal_time = \"dinner\"))", + "(26i64 <= $.t_time_sk <= 86359i64)" ], + "Function": "Vortex Scan", "Estimated Cardinality": "17280" } } @@ -909,19 +814,19 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(time_sk = t_time_sk)", - "Estimated Cardinality": "20144" + "Estimated Cardinality": "24304" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_uinteger(#1, 1001001)", + "CAST(#1 AS INTEGER)", "#2", "#0", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)" + "CAST(#3 AS TINYINT)", + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "20144" + "Estimated Cardinality": "24304" } } ], @@ -933,19 +838,19 @@ logical_opt [ "t_minute" ], "Expressions": "sum(ext_price)", - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 0)", - "__internal_decompress_integral_bigint(#3, 0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], @@ -957,39 +862,41 @@ logical_opt [ "t_minute", "ext_price" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_uinteger(#0, 1001001)", + "CAST(#0 AS INTEGER)", "#1", - "__internal_compress_integral_utinyint(#2, 0)", - "__internal_compress_integral_utinyint(#3, 0)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", "#4" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Order By": [ - "sum(tmp.ext_price)", - "memory.main.item.i_brand_id", - "memory.main.time_dim.t_hour" - ] + "ext_price", + "brand_id", + "t_hour" + ], + "Estimated Cardinality": "24302" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1001001)", + "CAST(#0 AS BIGINT)", "#1", - "__internal_decompress_integral_bigint(#2, 0)", - "__internal_decompress_integral_bigint(#3, 0)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4" - ] + ], + "Estimated Cardinality": "24302" } } ] @@ -1053,18 +960,19 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "d_year=1999", - "d_moy=11" + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } } ], @@ -1074,7 +982,7 @@ physical_plan [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "14322" + "Estimated Cardinality": "71632" } }, { @@ -1103,18 +1011,19 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "d_year=1999", - "d_moy=11" + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "28723" + "Estimated Cardinality": "143657" } } ], @@ -1124,7 +1033,7 @@ physical_plan [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "28723" + "Estimated Cardinality": "143657" } }, { @@ -1153,18 +1062,19 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "d_year=1999", - "d_moy=11" + "($.d_moy = 11i64)", + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -1174,7 +1084,7 @@ physical_plan [ "sold_item_sk", "time_sk" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "288464" } } ], @@ -1185,20 +1095,20 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "i_manager_id=1", + "Filters": "($.i_manager_id = 1i64)", "Projections": [ "i_item_sk", "i_brand_id", "i_brand" ], - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "sold_item_sk = i_item_sk", - "Estimated Cardinality": "20144" + "Estimated Cardinality": "100750" } }, { @@ -1222,19 +1132,19 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "time_sk = t_time_sk", - "Estimated Cardinality": "20144" + "Estimated Cardinality": "24304" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_uinteger(#1, 1001001)", + "CAST(#1 AS INTEGER)", "#2", "#0", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)" + "CAST(#3 AS TINYINT)", + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "20144" + "Estimated Cardinality": "24304" } } ], @@ -1246,7 +1156,7 @@ physical_plan [ "t_minute", "ext_price" ], - "Estimated Cardinality": "20144" + "Estimated Cardinality": "24304" } } ], @@ -1258,19 +1168,19 @@ physical_plan [ "#3" ], "Aggregates": "sum(#4)", - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 0)", - "__internal_decompress_integral_bigint(#3, 0)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], @@ -1282,40 +1192,41 @@ physical_plan [ "t_minute", "ext_price" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_uinteger(#0, 1001001)", + "CAST(#0 AS INTEGER)", "#1", - "__internal_compress_integral_utinyint(#2, 0)", - "__internal_compress_integral_utinyint(#3, 0)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", "#4" ], - "Estimated Cardinality": "20143" + "Estimated Cardinality": "24302" } } ], "extra_info": { "Order By": [ - "sum(tmp.ext_price) DESC", - "memory.main.item.i_brand_id ASC", - "memory.main.time_dim.t_hour ASC" - ] + "ext_price DESC", + "brand_id ASC", + "t_hour ASC" + ], + "Estimated Cardinality": "24302" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1001001)", + "CAST(#0 AS BIGINT)", "#1", - "__internal_decompress_integral_bigint(#2, 0)", - "__internal_decompress_integral_bigint(#3, 0)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", "#4" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "24302" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q72.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q72.slt.no index e505e80bb53..ca9b0b6df34 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q72.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q72.slt.no @@ -561,7 +561,7 @@ logical_plan [ "Expressions": [ "(d_week_seq = d_week_seq)", "(CAST(inv_quantity_on_hand AS BIGINT) < cs_quantity)", - "(CAST(d_date AS TIMESTAMP) > (d_date + to_days(CAST(trunc(CAST('5' AS DOUBLE)) AS INTEGER))))", + "(CAST(d_date AS TIMESTAMP) > (d_date + '5 days'::INTERVAL))", "(hd_buy_potential = CAST('>10000' AS VARCHAR))", "(d_year = CAST(1999 AS BIGINT))", "(cd_marital_status = CAST('D' AS VARCHAR))" @@ -597,10 +597,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "count_star()", - "memory.main.item.i_item_desc", - "memory.main.warehouse.w_warehouse_name", - "d1.d_week_seq" + "total_cnt", + "i_item_desc", + "w_warehouse_name", + "d_week_seq" ] } } @@ -636,146 +636,23 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "234900" - } - } - ], - "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk", - "inv_warehouse_sk", - "inv_quantity_on_hand" - ], - "Estimated Cardinality": "234900" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450815i64 <= $.d_date_sk <= 2452635i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1999i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_week_seq = d_week_seq)", - "Estimated Cardinality": "14605" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "46967" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", - "Estimated Cardinality": "46967" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "234900" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450817i64 <= $.d_date_sk <= 2452740i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], + "Filters": "(2450815i64 <= $.d_date_sk <= 2452635i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } }, @@ -789,199 +666,192 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.hd_buy_potential = \">10000\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1440" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_bill_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.cd_marital_status = \"D\")", + "($.cd_demo_sk >= 16i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "38416" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", + "Estimated Cardinality": "7683" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ship_date_sk", - "cs_bill_cdemo_sk", - "cs_bill_hdemo_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_order_number", - "cs_quantity" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.cd_marital_status = \"D\")", - "($.cd_demo_sk >= 16i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "7683" + "Estimated Cardinality": "30" } } ], "extra_info": { - "Expressions": "cd_demo_sk", + "Join Type": "LEFT", + "Conditions": "(cs_promo_sk = p_promo_sk)", "Estimated Cardinality": "7683" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_cdemo_sk = cd_demo_sk)", - "Estimated Cardinality": "28730" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.hd_buy_potential = \">10000\")", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "288" + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "288" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "7683" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "5746" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_desc" + "Join Type": "LEFT", + "Conditions": [ + "(cs_item_sk = cr_item_sk)", + "(cs_order_number = cr_order_number)" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "7683" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1999i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "5746" + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "7683" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(d_date_sk = cs_ship_date_sk)", - "Estimated Cardinality": "5746" + "Conditions": "(d_week_seq = d_week_seq)", + "Estimated Cardinality": "53780" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "(d_date_sk = cs_sold_date_sk)", - "(inv_item_sk = i_item_sk)", - "((d_date + '5 days'::INTERVAL) < CAST(d_date AS TIMESTAMP))", + "(inv_item_sk = cs_item_sk)", + "(inv_date_sk = d_date_sk)", "(CAST(inv_quantity_on_hand AS BIGINT) < cs_quantity)" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "172938" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "30" - } - } - ], - "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "30" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": "(cs_promo_sk = p_promo_sk)", - "Estimated Cardinality": "2405240" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14275" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number" - ], - "Estimated Cardinality": "14275" + "Join Type": "INNER", + "Conditions": "(inv_warehouse_sk = w_warehouse_sk)", + "Estimated Cardinality": "172938" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450817i64 <= $.d_date_sk <= 2452740i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" } } ], "extra_info": { - "Join Type": "LEFT", + "Join Type": "INNER", "Conditions": [ - "(cs_item_sk = cr_item_sk)", - "(cs_order_number = cr_order_number)" + "(cs_ship_date_sk = d_date_sk)", + "((d_date + '5 days'::INTERVAL) < CAST(d_date AS TIMESTAMP))" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1445779" } } ], "extra_info": { "Expressions": [ - "#2", - "__internal_compress_integral_usmallint(#0, 1)", + "#0", "#1", + "CAST(#2 AS SMALLINT)", "#3", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_usmallint(#5, 2)" + "#4", + "#5" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1445779" } } ], @@ -996,7 +866,7 @@ logical_opt [ "sum(CASE WHEN ((p_promo_sk IS NOT NULL)) THEN (1) ELSE 0 END)", "count_star()" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1385846" } } ], @@ -1004,12 +874,12 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1385846" } } ], @@ -1022,7 +892,7 @@ logical_opt [ "promo", "total_cnt" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1385846" } } ], @@ -1058,86 +928,17 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "inv_date_sk", - "inv_item_sk", - "inv_warehouse_sk", - "inv_quantity_on_hand" - ], - "Estimated Cardinality": "234900" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(2450815i64 <= $.d_date_sk <= 2452635i64)", - "Projections": [ - "d_date_sk", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=1999", - "Projections": [ - "d_date_sk", - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "d_week_seq = d_week_seq", - "Estimated Cardinality": "14605" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "inv_date_sk = d_date_sk", - "Estimated Cardinality": "46967" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "w_warehouse_sk", - "w_warehouse_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "inv_warehouse_sk = w_warehouse_sk", - "Estimated Cardinality": "46967" + "Function": "Vortex Scan", + "Projections": [ + "inv_date_sk", + "inv_item_sk", + "inv_warehouse_sk", + "inv_quantity_on_hand" + ], + "Estimated Cardinality": "234900" } }, { @@ -1148,10 +949,10 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450817i64 <= $.d_date_sk <= 2452740i64)", + "Filters": "(2450815i64 <= $.d_date_sk <= 2452635i64)", "Projections": [ "d_date_sk", - "d_date" + "d_week_seq" ], "Estimated Cardinality": "73049" } @@ -1166,21 +967,83 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_ship_date_sk", + "cs_bill_cdemo_sk", + "cs_bill_hdemo_sk", + "cs_item_sk", + "cs_promo_sk", + "cs_order_number", + "cs_quantity" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.hd_buy_potential = \">10000\")", + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_bill_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.cd_marital_status = \"D\")", + "($.cd_demo_sk >= 16i64)" + ], + "Projections": "cd_demo_sk", + "Estimated Cardinality": "38416" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_bill_cdemo_sk = cd_demo_sk", + "Estimated Cardinality": "7683" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "p_promo_sk", + "Estimated Cardinality": "30" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_ship_date_sk", - "cs_bill_cdemo_sk", - "cs_bill_hdemo_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_order_number", - "cs_quantity" - ], - "Estimated Cardinality": "143657" + "Join Type": "LEFT", + "Conditions": "cs_promo_sk = p_promo_sk", + "Estimated Cardinality": "7683" } }, { @@ -1188,16 +1051,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "cd_marital_status='D'", - "Projections": "cd_demo_sk", - "Estimated Cardinality": "7683" + "Projections": [ + "i_item_sk", + "i_item_desc" + ], + "Estimated Cardinality": "1800" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_bill_cdemo_sk = cd_demo_sk", - "Estimated Cardinality": "28730" + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "7683" } }, { @@ -1205,16 +1070,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "hd_buy_potential='>10000'", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "288" + "Projections": [ + "cr_item_sk", + "cr_order_number" + ], + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_bill_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "5746" + "Join Type": "LEFT", + "Conditions": [ + "cs_item_sk = cr_item_sk", + "cs_order_number = cr_order_number" + ], + "Estimated Cardinality": "7683" } }, { @@ -1222,37 +1092,41 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 1999i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], "Projections": [ - "i_item_sk", - "i_item_desc" + "d_date_sk", + "d_date", + "d_week_seq" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "5746" + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "7683" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "d_date_sk = cs_ship_date_sk", - "Estimated Cardinality": "5746" + "Conditions": "d_week_seq = d_week_seq", + "Estimated Cardinality": "53780" } } ], "extra_info": { "Join Type": "INNER", "Conditions": [ - "d_date_sk = cs_sold_date_sk", - "inv_item_sk = i_item_sk", - "(d_date + '5 days'::INTERVAL) < CAST(d_date AS TIMESTAMP)", + "inv_item_sk = cs_item_sk", + "inv_date_sk = d_date_sk", "CAST(inv_quantity_on_hand AS BIGINT) < cs_quantity" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "172938" } }, { @@ -1260,15 +1134,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Projections": "p_promo_sk", - "Estimated Cardinality": "30" + "Projections": [ + "w_warehouse_sk", + "w_warehouse_name" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "cs_promo_sk = p_promo_sk", - "Estimated Cardinality": "2405240" + "Join Type": "INNER", + "Conditions": "inv_warehouse_sk = w_warehouse_sk", + "Estimated Cardinality": "172938" } }, { @@ -1276,34 +1153,35 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(2450817i64 <= $.d_date_sk <= 2452740i64)", "Projections": [ - "cr_item_sk", - "cr_order_number" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "14275" + "Estimated Cardinality": "73049" } } ], "extra_info": { - "Join Type": "LEFT", + "Join Type": "INNER", "Conditions": [ - "cs_item_sk = cr_item_sk", - "cs_order_number = cr_order_number" + "cs_ship_date_sk = d_date_sk", + "(d_date + '5 days'::INTERVAL) < CAST(d_date AS TIMESTAMP)" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1445779" } } ], "extra_info": { "Projections": [ - "#2", - "__internal_compress_integral_usmallint(#0, 1)", + "#0", "#1", + "CAST(#2 AS SMALLINT)", "#3", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_usmallint(#5, 2)" + "#4", + "#5" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1445779" } } ], @@ -1315,7 +1193,7 @@ physical_plan [ "CASE WHEN ((p_promo_sk IS NULL)) THEN (1) ELSE 0 END", "CASE WHEN ((p_promo_sk IS NOT NULL)) THEN (1) ELSE 0 END" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1445779" } } ], @@ -1330,7 +1208,7 @@ physical_plan [ "sum(#4)", "count_star()" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1385846" } } ], @@ -1338,23 +1216,24 @@ physical_plan [ "Projections": [ "#0", "#1", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "2405240" + "Estimated Cardinality": "1385846" } } ], "extra_info": { "Top": "100", "Order By": [ - "count_star() DESC", - "memory.main.item.i_item_desc ASC", - "memory.main.warehouse.w_warehouse_name ASC", - "d1.d_week_seq ASC" - ] + "total_cnt DESC", + "i_item_desc ASC", + "w_warehouse_name ASC", + "d_week_seq ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q73.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q73.slt.no index 9fb92dd2cbb..021db223a8e 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q73.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q73.slt.no @@ -340,8 +340,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "dj.cnt", - "memory.main.customer.c_last_name" + "cnt", + "c_last_name" ] } } @@ -360,25 +360,34 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -387,7 +396,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -397,51 +406,35 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_store_sk", - "ss_ticket_number" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "FILTER", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(($.hd_buy_potential = \"Unknown\") or ($.hd_buy_potential = \">10000\"))", + "($.hd_vehicle_count > 0i32)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "1440" + } + } + ], "extra_info": { - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "(1i64 <= $.d_dom <= 2i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Expressions": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL::DOUBLE END > 1.0)", + "Estimated Cardinality": "288" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -453,133 +446,98 @@ logical_opt [ } ], "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "FILTER", - "children": [ + }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(($.hd_buy_potential = \"Unknown\") or ($.hd_buy_potential = \">10000\"))", - "($.hd_vehicle_count > 0i32)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "1440" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_dep_count", - "hd_vehicle_count" + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "(1i64 <= $.d_dom <= 2i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "1440" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL END > 1.0)", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "Groups": [ + "ss_ticket_number", + "ss_customer_sk" ], - "Estimated Cardinality": "288464" + "Expressions": "count_star()", + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Groups": [ - "ss_ticket_number", - "ss_customer_sk" + "Expressions": [ + "CAST(#1 AS BIGINT)", + "#2", + "#0" ], - "Expressions": "count_star()", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" - ], - "Estimated Cardinality": "288463" + "Expressions": "(cnt BETWEEN 1 AND 5)", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Expressions": "(cnt BETWEEN 1 AND 5)", - "Estimated Cardinality": "57692" + "Join Type": "INNER", + "Conditions": "(c_customer_sk = ss_customer_sk)", + "Estimated Cardinality": "2307" } } ], "extra_info": { "Expressions": [ - "ss_ticket_number", - "ss_customer_sk", - "cnt" + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS BIGINT)" ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag" - ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57692" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#5", + "#4" + ], + "Estimated Cardinality": "2307" } } ], @@ -592,7 +550,7 @@ logical_opt [ "ss_ticket_number", "cnt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], @@ -602,18 +560,19 @@ logical_opt [ "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], "extra_info": { "Order By": [ - "dj.cnt", - "memory.main.customer.c_last_name" - ] + "cnt", + "c_last_name" + ], + "Estimated Cardinality": "2307" } } ], @@ -623,9 +582,10 @@ logical_opt [ "#1", "#2", "#3", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" - ] + ], + "Estimated Cardinality": "2307" } } ] @@ -643,45 +603,125 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_GROUP_BY", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_salutation", + "c_first_name", + "c_last_name", + "c_preferred_cust_flag" + ], + "Estimated Cardinality": "10000" + } + }, + { + "name": "FILTER", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_hdemo_sk", + "ss_store_sk", + "ss_ticket_number" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.hd_buy_potential = \"Unknown\") or ($.hd_buy_potential = \">10000\"))", + "($.hd_vehicle_count > 0i32)" + ], + "Projections": [ + "hd_demo_sk", + "hd_dep_count", + "hd_vehicle_count" + ], + "Estimated Cardinality": "1440" + } + } + ], + "extra_info": { + "Expression": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL::DOUBLE END > 1.0)", + "Estimated Cardinality": "288" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "288" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "11538" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([\"Orange County\", \"Bronx County\", \"Franklin Parish\", \"Williamson County\"], $.s_county, opts=sql_null_semantics)", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_store_sk", - "ss_ticket_number" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "11538" } }, { @@ -702,133 +742,85 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Orange County\", \"Bronx County\", \"Franklin Parish\", \"Williamson County\"], $.s_county, opts=sql_null_semantics)", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(($.hd_buy_potential = \"Unknown\") or ($.hd_buy_potential = \">10000\"))", - "($.hd_vehicle_count > 0i32)" - ], - "Projections": [ - "hd_demo_sk", - "hd_dep_count", - "hd_vehicle_count" - ], - "Estimated Cardinality": "1440" - } - } - ], - "extra_info": { - "Expression": "(CASE WHEN ((hd_vehicle_count > 0)) THEN ((CAST((CAST(hd_dep_count AS DECIMAL(23,0)) * 1.000) AS DOUBLE) / CAST(hd_vehicle_count AS DOUBLE))) ELSE NULL END > 1.0)", - "Estimated Cardinality": "1440" + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1440" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "288464" + "Projections": [ + "ss_ticket_number", + "ss_customer_sk" + ], + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "288464" + "Aggregates": "count_star()", + "Estimated Cardinality": "11537" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk" + "CAST(#1 AS BIGINT)", + "#2", + "#0" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "11537" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "count_star()", - "Estimated Cardinality": "288463" + "Expression": "(cnt BETWEEN 1 AND 5)", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" - ], - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "c_customer_sk = ss_customer_sk", + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Expression": "(cnt BETWEEN 1 AND 5)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "c_customer_sk", - "c_salutation", - "c_first_name", - "c_last_name", - "c_preferred_cust_flag" + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS BIGINT)" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "2307" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57692" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#5", + "#4" + ], + "Estimated Cardinality": "2307" } } ], @@ -841,7 +833,7 @@ physical_plan [ "ss_ticket_number", "cnt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], @@ -851,18 +843,19 @@ physical_plan [ "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "2307" } } ], "extra_info": { "Order By": [ - "dj.cnt DESC", - "memory.main.customer.c_last_name ASC" - ] + "cnt DESC", + "c_last_name ASC" + ], + "Estimated Cardinality": "2307" } } ], @@ -872,10 +865,10 @@ physical_plan [ "#1", "#2", "#3", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#4 AS BIGINT)", "#5" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "2307" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q74.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q74.slt.no index 8bc224d7d6a..8a30e02a865 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q74.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q74.slt.no @@ -575,98 +575,140 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#2" + ], + "Expressions": "sum(ss_net_paid) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_net_paid" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", + "Groups": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "#0" + ], + "Expressions": "combine_aggr(#1)", "Estimated Cardinality": "288464" } } @@ -674,9 +716,9 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", + "#1", "#2", - "#3", + "__internal_decompress_integral_bigint(#3, 1900)", "#4" ], "Estimated Cardinality": "288464" @@ -684,32 +726,36 @@ logical_opt [ } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "d_year" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)" ], - "Expressions": "sum(ss_net_paid)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "__internal_decompress_integral_bigint(#3, 1900)", - "#4" + "year_", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": "((year_ = 2002) OR ((year_ = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "57692" + "Expressions": [ + "(sale_type = 's')", + "(((year_ = 2002) AND (sale_type = 's')) OR ((year_total > 0.00) AND ((year_ = 2001) AND (sale_type = 's'))))" + ], + "Estimated Cardinality": "288464" } } ], @@ -722,7 +768,7 @@ logical_opt [ "year_total", "sale_type" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } }, { @@ -735,141 +781,187 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#2" + ], + "Expressions": "sum(ws_net_paid) EXPORT_STATE", + "Estimated Cardinality": "71631" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "71631" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_net_paid" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Join Type": "INNER", + "Conditions": "(#0 = c_customer_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "71632" + "Groups": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "#0" + ], + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "71631" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", + "#1", "#2", - "#3", + "__internal_decompress_integral_bigint(#3, 1900)", "#4" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Groups": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "d_year" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "finalize(#4)" ], - "Expressions": "sum(ws_net_paid)", "Estimated Cardinality": "71631" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2", - "__internal_decompress_integral_bigint(#3, 1900)", - "#4" + "year_", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name" ], "Estimated Cardinality": "71631" } } ], "extra_info": { - "Expressions": "((year_ = 2002) OR ((year_ = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "14326" + "Expressions": [ + "(sale_type = 'w')", + "(((year_ = 2002) AND (sale_type = 'w')) OR ((year_total > 0.00) AND ((year_ = 2001) AND (sale_type = 'w'))))" + ], + "Estimated Cardinality": "71631" } } ], @@ -882,13 +974,13 @@ logical_opt [ "year_total", "sale_type" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71631" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], @@ -900,17 +992,18 @@ logical_opt [ "#3", "#4", "#5" - ] + ], + "Estimated Cardinality": "360095" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -926,17 +1019,16 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Expressions": [ - "(year_ = 2001)", - "(year_total > 0.00)", + "(year_ = 2002)", "(sale_type = 's')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } }, { @@ -947,23 +1039,24 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Expressions": [ - "(year_ = 2002)", + "(year_ = 2001)", + "(year_total > 0.00)", "(sale_type = 's')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966840" } }, { @@ -977,7 +1070,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], @@ -987,7 +1080,7 @@ logical_opt [ "(year_total > 0.00)", "(sale_type = 'w')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } }, { @@ -998,7 +1091,7 @@ logical_opt [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], @@ -1007,14 +1100,14 @@ logical_opt [ "(year_ = 2002)", "(sale_type = 'w')" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(customer_id = customer_id)", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966840" } } ], @@ -1022,30 +1115,34 @@ logical_opt [ "Join Type": "INNER", "Conditions": [ "(customer_id = customer_id)", - "(CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL END < CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL END)" + "(CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL::DOUBLE END < CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL::DOUBLE END)" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38512994145" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "57955887304299528" + "Expressions": [ + "customer_id", + "customer_first_name", + "customer_last_name" + ], + "Estimated Cardinality": "38512994145" } } ], "extra_info": { - "Expressions": [ - "customer_id", - "customer_first_name", - "customer_last_name" - ], - "Estimated Cardinality": "57955887304299528" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "100" } } @@ -1074,130 +1171,225 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_net_paid" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "ss_net_paid" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name" + ], + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_net_paid" - ], + "Join Type": "INNER", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", + "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "#0", + "#1" + ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ + "Groups": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", + "#1", "#2", - "#3", - "#4" + "#3" ], + "Aggregates": "combine_aggr(#4)", "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "d_year", - "ss_net_paid" + "#0", + "#1", + "#2", + "__internal_decompress_integral_bigint(#3, 1900)", + "#4" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", - "#3" + "#3", + "finalize(#4)" ], - "Aggregates": "sum(#4)", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "__internal_decompress_integral_bigint(#3, 1900)", - "#4" + "year_", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expression": "((year_ = 2002) OR ((year_ = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "57692" + "Expression": "((sale_type = 's') AND (((year_ = 2002) AND (sale_type = 's')) OR ((year_total > 0.00) AND ((year_ = 2001) AND (sale_type = 's')))))", + "Estimated Cardinality": "288464" } } ], @@ -1210,7 +1402,7 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "288464" } }, { @@ -1223,130 +1415,225 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_bill_customer_sk", + "ws_net_paid" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", + "(($.d_year = 2001i64) or ($.d_year = 2002i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "ws_net_paid" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "71631" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "__internal_decompress_integral_bigint(#1, 1900)", + "#2" + ], + "Estimated Cardinality": "71631" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_customer_sk", + "c_customer_id", + "c_first_name", + "c_last_name" + ], + "Estimated Cardinality": "10000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_bill_customer_sk", - "ws_net_paid" - ], + "Join Type": "INNER", + "Conditions": "#0 = c_customer_sk", "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.list.contains([2001i64, 2002i64], $.d_year, opts=sql_null_semantics)", - "(($.d_year = 2001i64) or ($.d_year = 2002i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "c_customer_sk", - "c_customer_id", - "c_first_name", - "c_last_name" + "__internal_compress_integral_utinyint(#0, 1900)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Projections": [ + "c_customer_id", + "c_first_name", + "c_last_name", + "#0", + "#1" + ], "Estimated Cardinality": "71632" } } ], "extra_info": { - "Projections": [ + "Groups": [ "#0", - "__internal_compress_integral_utinyint(#1, 1900)", + "#1", "#2", - "#3", - "#4" + "#3" ], - "Estimated Cardinality": "71632" + "Aggregates": "combine_aggr(#4)", + "Estimated Cardinality": "71631" } } ], "extra_info": { "Projections": [ - "c_customer_id", - "c_first_name", - "c_last_name", - "d_year", - "ws_net_paid" + "#0", + "#1", + "#2", + "__internal_decompress_integral_bigint(#3, 1900)", + "#4" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", "#1", "#2", - "#3" + "#3", + "finalize(#4)" ], - "Aggregates": "sum(#4)", "Estimated Cardinality": "71631" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "__internal_decompress_integral_bigint(#3, 1900)", - "#4" + "year_", + "year_total", + "sale_type", + "customer_id", + "customer_first_name", + "customer_last_name" ], "Estimated Cardinality": "71631" } } ], "extra_info": { - "Expression": "((year_ = 2002) OR ((year_ = 2001) AND (year_total > 0.00)))", - "Estimated Cardinality": "14326" + "Expression": "((sale_type = 'w') AND (((year_ = 2002) AND (sale_type = 'w')) OR ((year_total > 0.00) AND ((year_ = 2001) AND (sale_type = 'w')))))", + "Estimated Cardinality": "71631" } } ], @@ -1359,7 +1646,7 @@ physical_plan [ "year_total", "sale_type" ], - "Estimated Cardinality": "14326" + "Estimated Cardinality": "71631" } } ], @@ -1388,22 +1675,24 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { - "Expression": "((year_ = 2001) AND (year_total > 0.00) AND (sale_type = 's'))", - "Estimated Cardinality": "72018" + "Expression": "((year_ = 2002) AND (sale_type = 's'))", + "Estimated Cardinality": "360095" } } ], "extra_info": { "Projections": [ "#0", + "#1", + "#2", "#4" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } }, { @@ -1417,31 +1706,29 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { - "Expression": "((year_ = 2002) AND (sale_type = 's'))", - "Estimated Cardinality": "72018" + "Expression": "((year_ = 2001) AND (year_total > 0.00) AND (sale_type = 's'))", + "Estimated Cardinality": "360095" } } ], "extra_info": { "Projections": [ "#0", - "#1", - "#2", "#4" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966840" } }, { @@ -1458,13 +1745,13 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Expression": "((year_ = 2001) AND (year_total > 0.00) AND (sale_type = 'w'))", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], @@ -1473,7 +1760,7 @@ physical_plan [ "#0", "#4" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } }, { @@ -1487,13 +1774,13 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Expression": "((year_ = 2002) AND (sale_type = 'w'))", - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], @@ -1502,14 +1789,14 @@ physical_plan [ "#0", "#4" ], - "Estimated Cardinality": "72018" + "Estimated Cardinality": "360095" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "customer_id = customer_id", - "Estimated Cardinality": "518659" + "Estimated Cardinality": "12966840" } } ], @@ -1517,31 +1804,33 @@ physical_plan [ "Join Type": "INNER", "Conditions": [ "customer_id = customer_id", - "CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL END < CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL END" + "CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL::DOUBLE END < CASE WHEN ((year_total > 0.00)) THEN ((CAST(year_total AS DOUBLE) / CAST(year_total AS DOUBLE))) ELSE NULL::DOUBLE END" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38512994145" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2" + "customer_id", + "customer_first_name", + "customer_last_name" ], - "Estimated Cardinality": "57955887304299528" + "Estimated Cardinality": "38512994145" } } ], "extra_info": { "Top": "100", - "Order By": "customer_id ASC" + "Order By": "customer_id ASC", + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "year_total", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q75.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q75.slt.no index d4cb80e12f1..1b49673f5aa 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q75.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q75.slt.no @@ -886,8 +886,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "(curr_yr.sales_cnt - prev_yr.sales_cnt)", - "(curr_yr.sales_amt - prev_yr.sales_amt)" + "sales_cnt_diff", + "sales_amt_diff" ] } } @@ -929,13 +929,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -944,7 +944,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -954,133 +954,77 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "143657" } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_category = \"Books\")", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(($.d_year = 2002i64) or ($.d_year = 2001i64))", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" + "Join Type": "LEFT", + "Conditions": [ + "(cs_order_number = cr_order_number)", + "(cs_item_sk = cr_item_sk)" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(($.d_year = 2002i64) or ($.d_year = 2001i64))", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "14275" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number", - "cr_return_quantity", - "cr_return_amount" - ], - "Estimated Cardinality": "14275" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(cs_order_number = cr_order_number)", - "(cs_item_sk = cr_item_sk)" + "Expressions": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" ], "Estimated Cardinality": "28731" } - } - ], - "extra_info": { - "Expressions": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" - ], - "Estimated Cardinality": "28731" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -1089,7 +1033,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1099,53 +1043,23 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ticket_number", - "ss_quantity", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_category = \"Books\")", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1160,23 +1074,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1188,44 +1090,30 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number", - "sr_return_quantity", - "sr_return_amt" + "Join Type": "LEFT", + "Conditions": [ + "(ss_ticket_number = sr_ticket_number)", + "(ss_item_sk = sr_item_sk)" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_ticket_number = sr_ticket_number)", - "(ss_item_sk = sr_item_sk)" + "Expressions": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" ], "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" - ], - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -1234,7 +1122,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1244,53 +1132,23 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_order_number", - "ws_quantity", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_category = \"Books\")", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1305,23 +1163,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1333,63 +1179,66 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "wr_item_sk", - "wr_order_number", - "wr_return_quantity", - "wr_return_amt" + "Join Type": "LEFT", + "Conditions": [ + "(ws_order_number = wr_order_number)", + "(ws_item_sk = wr_item_sk)" ], - "Estimated Cardinality": "7037" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ws_order_number = wr_order_number)", - "(ws_item_sk = wr_item_sk)" + "Expressions": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" ], "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" - ], - "Estimated Cardinality": "14326" + "Expressions": "", + "Estimated Cardinality": "100749" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "57692" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6" + ], + "Estimated Cardinality": "100749" } } ], "extra_info": { "Expressions": [ "__internal_compress_integral_utinyint(#0, 1900)", - "__internal_compress_integral_uinteger(#1, 1001001)", - "__internal_compress_integral_utinyint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 1)", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_utinyint(#5, -99)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "CAST(#4 AS SMALLINT)", + "CAST(#5 AS TINYINT)", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "57692", + "Estimated Cardinality": "100749", "Distinct Targets": [ "d_year", "i_brand_id", @@ -1405,28 +1254,28 @@ logical_opt [ "extra_info": { "Expressions": [ "__internal_decompress_integral_bigint(#0, 1900)", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", - "__internal_decompress_integral_bigint(#4, 1)", - "__internal_decompress_integral_bigint(#5, -99)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "CAST(#4 AS BIGINT)", + "CAST(#5 AS BIGINT)", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], "extra_info": { "Expressions": [ "__internal_compress_integral_utinyint(#0, 1900)", - "__internal_compress_integral_uinteger(#1, 1001001)", - "__internal_compress_integral_utinyint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 1)", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "CAST(#4 AS SMALLINT)", "#5", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], @@ -1442,21 +1291,21 @@ logical_opt [ "sum(sales_cnt)", "sum(sales_amt)" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100747" } } ], "extra_info": { "Expressions": [ "__internal_decompress_integral_bigint(#0, 1900)", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "CAST(#4 AS BIGINT)", "#5", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100747" } } ], @@ -1470,102 +1319,105 @@ logical_opt [ "sales_cnt", "sales_amt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100747" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": "(d_year = 2002)", - "Estimated Cardinality": "57692" + "CTE Index": "0", + "Estimated Cardinality": "100747" } - }, + } + ], + "extra_info": { + "Expressions": "(d_year = 2002)", + "Estimated Cardinality": "100747" + } + }, + { + "name": "FILTER", + "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": "(d_year = 2001)", - "Estimated Cardinality": "57692" + "CTE Index": "0", + "Estimated Cardinality": "100747" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(i_brand_id = i_brand_id)", - "(i_class_id = i_class_id)", - "(i_category_id = i_category_id)", - "(i_manufact_id = i_manufact_id)" - ], - "Estimated Cardinality": "23168" + "Expressions": "(d_year = 2001)", + "Estimated Cardinality": "100747" } } ], "extra_info": { - "Expressions": "((CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE) / CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE)) < 0.9)", - "Estimated Cardinality": "23168" + "Join Type": "INNER", + "Conditions": [ + "(i_brand_id = i_brand_id)", + "(i_class_id = i_class_id)", + "(i_category_id = i_category_id)", + "(i_manufact_id = i_manufact_id)", + "((CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE) / CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE)) < 0.9)" + ], + "Estimated Cardinality": "28194327" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "23168" + "Expressions": [ + "prev_year", + "year_", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "prev_yr_cnt", + "curr_yr_cnt", + "sales_cnt_diff", + "sales_amt_diff" + ], + "Estimated Cardinality": "28194327" } } ], "extra_info": { - "Expressions": [ - "prev_year", - "year_", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "prev_yr_cnt", - "curr_yr_cnt", - "sales_cnt_diff", - "sales_amt_diff" - ], - "Estimated Cardinality": "23168" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], "Estimated Cardinality": "100" } } @@ -1606,13 +1458,13 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "UNION", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -1621,44 +1473,18 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_ext_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Books'", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "28731" + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_item_sk", + "cs_order_number", + "cs_quantity", + "cs_ext_sales_price" + ], + "Estimated Cardinality": "143657" } }, { @@ -1666,21 +1492,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2002i64) or ($.d_year = 2001i64))", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], + "Filters": "($.i_category = \"Books\")", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", + "Conditions": "cs_item_sk = i_item_sk", "Estimated Cardinality": "28731" } }, @@ -1707,23 +1533,49 @@ physical_plan [ ], "Estimated Cardinality": "28731" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2002i64) or ($.d_year = 2001i64))", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" - ], + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", "Estimated Cardinality": "28731" } - }, + } + ], + "extra_info": { + "Projections": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -1732,44 +1584,18 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ticket_number", - "ss_quantity", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Books'", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "57692" + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_ticket_number", + "ss_quantity", + "ss_ext_sales_price" + ], + "Estimated Cardinality": "288464" } }, { @@ -1777,21 +1603,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2002i64) or ($.d_year = 2001i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "($.i_category = \"Books\")", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Conditions": "ss_item_sk = i_item_sk", "Estimated Cardinality": "57692" } }, @@ -1800,41 +1626,67 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2002i64) or ($.d_year = 2001i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "sr_item_sk", - "sr_ticket_number", - "sr_return_quantity", - "sr_return_amt" + "d_date_sk", + "d_year" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ss_ticket_number = sr_ticket_number", - "ss_item_sk = sr_item_sk" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "57692" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_ticket_number", + "sr_return_quantity", + "sr_return_amt" + ], + "Estimated Cardinality": "28576" + } } ], "extra_info": { - "Projections": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" + "Join Type": "LEFT", + "Conditions": [ + "ss_ticket_number = sr_ticket_number", + "ss_item_sk = sr_item_sk" ], "Estimated Cardinality": "57692" } - }, + } + ], + "extra_info": { + "Projections": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" + ], + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -1843,44 +1695,18 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_order_number", - "ws_quantity", - "ws_ext_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_category='Books'", - "Projections": [ - "i_item_sk", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id" - ], - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "14326" + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_order_number", + "ws_quantity", + "ws_ext_sales_price" + ], + "Estimated Cardinality": "71632" } }, { @@ -1888,21 +1714,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(($.d_year = 2002i64) or ($.d_year = 2001i64))", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], + "Filters": "($.i_category = \"Books\")", "Projections": [ - "d_date_sk", - "d_year" + "i_item_sk", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Conditions": "ws_item_sk = i_item_sk", "Estimated Cardinality": "14326" } }, @@ -1911,69 +1737,77 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(($.d_year = 2002i64) or ($.d_year = 2001i64))", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "wr_item_sk", - "wr_order_number", - "wr_return_quantity", - "wr_return_amt" + "d_date_sk", + "d_year" ], - "Estimated Cardinality": "7037" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ws_order_number = wr_order_number", - "ws_item_sk = wr_item_sk" - ], + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", "Estimated Cardinality": "14326" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "wr_item_sk", + "wr_order_number", + "wr_return_quantity", + "wr_return_amt" + ], + "Estimated Cardinality": "7037" + } } ], "extra_info": { - "Projections": [ - "d_year", - "i_brand_id", - "i_class_id", - "i_category_id", - "i_manufact_id", - "sales_cnt", - "sales_amt" + "Join Type": "LEFT", + "Conditions": [ + "ws_order_number = wr_order_number", + "ws_item_sk = wr_item_sk" ], "Estimated Cardinality": "14326" } } ], - "extra_info": {} + "extra_info": { + "Projections": [ + "d_year", + "i_brand_id", + "i_class_id", + "i_category_id", + "i_manufact_id", + "sales_cnt", + "sales_amt" + ], + "Estimated Cardinality": "14326" + } } ], - "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Aggregates": "", - "Estimated Cardinality": "57692" - } + "extra_info": {} } ], "extra_info": { "Projections": [ "__internal_compress_integral_utinyint(#0, 1900)", - "__internal_compress_integral_uinteger(#1, 1001001)", - "__internal_compress_integral_utinyint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 1)", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_utinyint(#5, -99)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "CAST(#4 AS SMALLINT)", + "CAST(#5 AS TINYINT)", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], @@ -1987,7 +1821,7 @@ physical_plan [ "sales_cnt", "sales_amt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], @@ -2002,35 +1836,35 @@ physical_plan [ "#6" ], "Aggregates": "", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], "extra_info": { "Projections": [ "__internal_decompress_integral_bigint(#0, 1900)", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", - "__internal_decompress_integral_bigint(#4, 1)", - "__internal_decompress_integral_bigint(#5, -99)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "CAST(#4 AS BIGINT)", + "CAST(#5 AS BIGINT)", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], "extra_info": { "Projections": [ "__internal_compress_integral_utinyint(#0, 1900)", - "__internal_compress_integral_uinteger(#1, 1001001)", - "__internal_compress_integral_utinyint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 1)", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#1 AS INTEGER)", + "CAST(#2 AS TINYINT)", + "CAST(#3 AS TINYINT)", + "CAST(#4 AS SMALLINT)", "#5", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], @@ -2044,7 +1878,7 @@ physical_plan [ "sales_cnt", "sales_amt" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100749" } } ], @@ -2060,21 +1894,21 @@ physical_plan [ "sum(#5)", "sum(#6)" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100747" } } ], "extra_info": { "Projections": [ "__internal_decompress_integral_bigint(#0, 1900)", - "__internal_decompress_integral_bigint(#1, 1001001)", - "__internal_decompress_integral_bigint(#2, 1)", - "__internal_decompress_integral_bigint(#3, 1)", - "__internal_decompress_integral_bigint(#4, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "CAST(#3 AS BIGINT)", + "CAST(#4 AS BIGINT)", "#5", "#6" ], - "Estimated Cardinality": "57692" + "Estimated Cardinality": "100747" } }, { @@ -2084,61 +1918,53 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expression": "(d_year = 2002)", - "Estimated Cardinality": "57692" + "CTE Index": "0", + "Estimated Cardinality": "100747" } - }, + } + ], + "extra_info": { + "Expression": "(d_year = 2002)", + "Estimated Cardinality": "100747" + } + }, + { + "name": "FILTER", + "children": [ { - "name": "FILTER", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "57692" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expression": "(d_year = 2001)", - "Estimated Cardinality": "57692" + "CTE Index": "0", + "Estimated Cardinality": "100747" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "i_brand_id = i_brand_id", - "i_class_id = i_class_id", - "i_category_id = i_category_id", - "i_manufact_id = i_manufact_id" - ], - "Estimated Cardinality": "23168" + "Expression": "(d_year = 2001)", + "Estimated Cardinality": "100747" } } ], "extra_info": { - "Expression": "((CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE) / CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE)) < 0.9)", - "Estimated Cardinality": "23168" + "Join Type": "INNER", + "Conditions": [ + "i_brand_id = i_brand_id", + "i_class_id = i_class_id", + "i_category_id = i_category_id", + "i_manufact_id = i_manufact_id", + "((CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE) / CAST(CAST(sales_cnt AS DECIMAL(17,2)) AS DOUBLE)) < 0.9)" + ], + "Estimated Cardinality": "28194327" } } ], @@ -2155,22 +1981,24 @@ physical_plan [ "sales_cnt_diff", "sales_amt_diff" ], - "Estimated Cardinality": "23168" + "Estimated Cardinality": "28194327" } } ], "extra_info": { "Top": "100", "Order By": [ - "(curr_yr.sales_cnt - prev_yr.sales_cnt) ASC", - "(curr_yr.sales_amt - prev_yr.sales_amt) ASC" - ] + "sales_cnt_diff ASC", + "sales_amt_diff ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "all_sales", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q76.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q76.slt.no index 573437a6b87..51c31fb7f10 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q76.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q76.slt.no @@ -634,11 +634,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "foo.channel", - "foo.col_name", - "foo.d_year", - "foo.d_qoy", - "foo.i_category" + "channel", + "col_name", + "d_year", + "d_qoy", + "i_category" ] } } @@ -674,24 +674,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_qoy" - ], + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } }, @@ -699,45 +686,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.is_null($.ss_store_sk)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], + "Filters": "vortex.is_null($.ss_store_sk)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_category" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -752,7 +714,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(d_date_sk = ss_sold_date_sk)", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "57692" } } ], @@ -765,7 +727,7 @@ logical_opt [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "57692" } }, { @@ -775,24 +737,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_qoy" - ], + "Filters": "(2450816i64 <= $.d_date_sk <= 2452642i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } }, @@ -800,45 +749,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.is_null($.ws_ship_customer_sk)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14326" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_sales_price" - ], + "Filters": "vortex.is_null($.ws_ship_customer_sk)", + "Function": "Vortex Scan", "Estimated Cardinality": "14326" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_category" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -853,7 +777,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(d_date_sk = ws_sold_date_sk)", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "14326" } } ], @@ -866,7 +790,7 @@ logical_opt [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "14326" } }, { @@ -876,24 +800,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year", - "d_qoy" - ], + "Filters": "(2450815i64 <= $.d_date_sk <= 2452652i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "73049" } }, @@ -901,45 +812,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.is_null($.cs_ship_addr_sk)", - "Function": "Vortex Scan", - "Estimated Cardinality": "28731" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_item_sk", - "cs_ext_sales_price" - ], + "Filters": "vortex.is_null($.cs_ship_addr_sk)", + "Function": "Vortex Scan", "Estimated Cardinality": "28731" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_category" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1800" } } @@ -954,7 +840,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(d_date_sk = cs_sold_date_sk)", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "28731" } } ], @@ -967,13 +853,13 @@ logical_opt [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "219147" + "Estimated Cardinality": "100749" } } ], @@ -982,11 +868,11 @@ logical_opt [ "__internal_compress_string_ubigint(#0)", "#1", "__internal_compress_integral_utinyint(#2, 1900)", - "__internal_compress_integral_utinyint(#3, 1)", + "CAST(#3 AS TINYINT)", "#4", "#5" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "100749" } } ], @@ -1002,7 +888,7 @@ logical_opt [ "count_star()", "sum(ext_sales_price)" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "96563" } } ], @@ -1011,12 +897,12 @@ logical_opt [ "__internal_decompress_string(#0)", "#1", "__internal_decompress_integral_bigint(#2, 1900)", - "__internal_decompress_integral_bigint(#3, 1)", + "CAST(#3 AS BIGINT)", "#4", "#5", "#6" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "96563" } } ], @@ -1030,7 +916,7 @@ logical_opt [ "sales_cnt", "sales_amt" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "96563" } } ], @@ -1119,7 +1005,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_date_sk = ss_sold_date_sk", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "57692" } } ], @@ -1132,7 +1018,7 @@ physical_plan [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "57692" } }, { @@ -1195,7 +1081,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_date_sk = ws_sold_date_sk", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "14326" } } ], @@ -1208,7 +1094,7 @@ physical_plan [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "14326" } }, { @@ -1271,7 +1157,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "d_date_sk = cs_sold_date_sk", - "Estimated Cardinality": "73049" + "Estimated Cardinality": "28731" } } ], @@ -1284,7 +1170,7 @@ physical_plan [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "73049" + "Estimated Cardinality": "28731" } } ], @@ -1296,11 +1182,11 @@ physical_plan [ "__internal_compress_string_ubigint(#0)", "#1", "__internal_compress_integral_utinyint(#2, 1900)", - "__internal_compress_integral_utinyint(#3, 1)", + "CAST(#3 AS TINYINT)", "#4", "#5" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "100749" } } ], @@ -1313,7 +1199,7 @@ physical_plan [ "i_category", "ext_sales_price" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "100749" } } ], @@ -1329,7 +1215,7 @@ physical_plan [ "count_star()", "sum(#5)" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "96563" } } ], @@ -1338,24 +1224,25 @@ physical_plan [ "__internal_decompress_string(#0)", "#1", "__internal_decompress_integral_bigint(#2, 1900)", - "__internal_decompress_integral_bigint(#3, 1)", + "CAST(#3 AS BIGINT)", "#4", "#5", "#6" ], - "Estimated Cardinality": "219147" + "Estimated Cardinality": "96563" } } ], "extra_info": { "Top": "100", "Order By": [ - "foo.channel ASC", - "foo.col_name ASC", - "foo.d_year ASC", - "foo.d_qoy ASC", - "foo.i_category ASC" - ] + "channel ASC", + "col_name ASC", + "d_year ASC", + "d_qoy ASC", + "i_category ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q77.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q77.slt.no index c7a881c112e..c2c0f77fd5b 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q77.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q77.slt.no @@ -1263,9 +1263,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "x.channel", - "x.id", - "sum(x.returns_)" + "channel", + "id", + "returns_" ] } } @@ -1319,64 +1319,69 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", "Estimated Cardinality": "288464" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1391,140 +1396,82 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "288464" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "288464" + "Groups": "s_store_sk", + "Expressions": [ + "sum(ss_ext_sales_price)", + "sum(ss_net_profit)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Groups": "s_store_sk", - "Expressions": [ - "sum(ss_ext_sales_price)", - "sum(ss_net_profit)" - ], - "Estimated Cardinality": "182344" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "182344" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "sales", - "profit" - ], - "Estimated Cardinality": "182344" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "182344" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(sr_store_sk = s_store_sk)", "Estimated Cardinality": "28576" } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_store_sk", - "sr_return_amt", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1539,427 +1486,323 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "28576" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "28576" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "s_store_sk", - "Estimated Cardinality": "1" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_store_sk = s_store_sk)", - "Estimated Cardinality": "28576" + "Groups": "s_store_sk", + "Expressions": [ + "sum(sr_return_amt)", + "sum(sr_net_loss)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "s_store_sk", - "Expressions": [ - "sum(sr_return_amt)", - "sum(sr_net_loss)" - ], - "Estimated Cardinality": "18063" + "Join Type": "LEFT", + "Conditions": "(s_store_sk = s_store_sk)", + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "18063" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "returns_", - "profit_loss" - ], - "Estimated Cardinality": "18063" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "18063" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": "(s_store_sk = s_store_sk)", - "Estimated Cardinality": "182344" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "182344" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "CROSS_PRODUCT", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CROSS_PRODUCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" + "Groups": "cs_call_center_sk", + "Expressions": [ + "sum(cs_ext_sales_price)", + "sum(cs_net_profit)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "cs_sold_date_sk", - "cs_call_center_sk", - "cs_ext_sales_price", - "cs_net_profit" + "CAST(#0 AS BIGINT)", + "#1", + "#2" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "1" } - }, + } + ], + "extra_info": { + "Expressions": [ + "cs_call_center_sk", + "sales", + "profit" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "14275" + } + } + ], "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "Groups": "cr_call_center_sk", + "Expressions": [ + "sum(cr_return_amount)", + "sum(cr_net_loss)" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" + "Expressions": [ + "returns_", + "profit_loss" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", - "#1", - "#2", - "__internal_compress_integral_usmallint(#3, 2450815)" + "#0", + "#1" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "cs_call_center_sk", - "Expressions": [ - "sum(cs_ext_sales_price)", - "sum(cs_net_profit)" - ], - "Estimated Cardinality": "90808" + "Expressions": "", + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "90808" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": [ - "cs_call_center_sk", - "sales", - "profit" - ], - "Estimated Cardinality": "90808" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "90808" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_returned_date_sk", - "cr_call_center_sk", - "cr_return_amount", - "cr_net_loss" - ], - "Estimated Cardinality": "14275" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450852i64 <= $.d_date_sk <= 2452907i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", - "#1", - "#2", - "__internal_compress_integral_usmallint(#3, 2450852)" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Groups": "cr_call_center_sk", - "Expressions": [ - "sum(cr_return_amount)", - "sum(cr_net_loss)" - ], - "Estimated Cardinality": "9144" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "9144" - } - } - ], - "extra_info": { - "Expressions": [ - "returns_", - "profit_loss" - ], - "Estimated Cardinality": "9144" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "9144" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "830348352" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "830348352" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ws_web_page_sk = wp_web_page_sk)", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_web_page_sk", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1974,278 +1817,409 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], "Estimated Cardinality": "71632" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "6" - } - } - ], - "extra_info": { - "Expressions": "wp_web_page_sk", - "Estimated Cardinality": "6" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_web_page_sk = wp_web_page_sk)", - "Estimated Cardinality": "71632" + "Groups": "wp_web_page_sk", + "Expressions": [ + "sum(ws_ext_sales_price)", + "sum(ws_net_profit)" + ], + "Estimated Cardinality": "6" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "6" } - } - ], - "extra_info": { - "Groups": "wp_web_page_sk", - "Expressions": [ - "sum(ws_ext_sales_price)", - "sum(ws_net_profit)" - ], - "Estimated Cardinality": "45280" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "45280" - } - } - ], - "extra_info": { - "Expressions": [ - "wp_web_page_sk", - "sales", - "profit" - ], - "Estimated Cardinality": "45280" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "45280" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450865i64 <= $.d_date_sk <= 2452974i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450865i64 <= $.d_date_sk <= 2452974i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "7037" + "Estimated Cardinality": "14609" } - } - ], - "extra_info": { - "Expressions": [ - "wr_returned_date_sk", - "wr_web_page_sk", - "wr_return_amt", - "wr_net_loss" - ], - "Estimated Cardinality": "7037" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "(wr_web_page_sk = wp_web_page_sk)", + "Estimated Cardinality": "7037" } } ], "extra_info": { - "Expressions": "wp_web_page_sk", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "(d_date_sk = wr_returned_date_sk)", + "Estimated Cardinality": "7037" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(wr_web_page_sk = wp_web_page_sk)", + "Expressions": [ + "#0", + "CAST(#1 AS TINYINT)", + "#2", + "#3" + ], "Estimated Cardinality": "7037" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_date_sk = wr_returned_date_sk)", - "Estimated Cardinality": "14609" + "Groups": "wp_web_page_sk", + "Expressions": [ + "sum(wr_return_amt)", + "sum(wr_net_loss)" + ], + "Estimated Cardinality": "6" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 2450865)", - "__internal_compress_integral_utinyint(#1, 1)", - "#2", - "#3" + "CAST(#0 AS BIGINT)", + "#1", + "#2" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "6" } } ], "extra_info": { - "Groups": "wp_web_page_sk", - "Expressions": [ - "sum(wr_return_amt)", - "sum(wr_net_loss)" - ], - "Estimated Cardinality": "6154" + "Join Type": "LEFT", + "Conditions": "(wp_web_page_sk = wp_web_page_sk)", + "Estimated Cardinality": "6" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "6154" + "Estimated Cardinality": "6" } } ], "extra_info": { - "Expressions": [ - "wp_web_page_sk", - "returns_", - "profit_loss" - ], - "Estimated Cardinality": "6154" + "Expressions": "", + "Estimated Cardinality": "8" } } ], "extra_info": { "Expressions": [ - "#0", - "#1", - "#2" + "__internal_compress_string_uhugeint(#0)", + "CAST(#1 AS TINYINT)", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "6154" + "Estimated Cardinality": "8" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(wp_web_page_sk = wp_web_page_sk)", - "Estimated Cardinality": "45280" + "Groups": [ + "channel", + "id" + ], + "Expressions": [ + "sum(sales) EXPORT_STATE", + "sum(returns_) EXPORT_STATE", + "sum(profit) EXPORT_STATE" + ], + "Estimated Cardinality": "4" } } ], "extra_info": { "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "45280" + "Estimated Cardinality": "4" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "830575976" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4" } - } - ], - "extra_info": { - "Groups": [ - "channel", - "id" - ], - "Expressions": [ - "sum(sales)", - "sum(returns_)", - "sum(profit)" - ], - "Estimated Cardinality": "274040" + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "187", + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": [ + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)" + ], + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "191", + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::BIGINT", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "191", + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::BIGINT", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "2" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "187", + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_191", + "Table Index": "191", + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_187", + "Table Index": "187", + "Estimated Cardinality": "7" } } ], @@ -2257,13 +2231,13 @@ logical_opt [ "returns_", "profit" ], - "Estimated Cardinality": "274040" + "Estimated Cardinality": "7" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "7" } } ] @@ -2272,359 +2246,362 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "UNION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_store_sk", + "ss_ext_sales_price", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_ext_sales_price", - "ss_net_profit" + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" ], "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Projections": [ + "s_store_sk", + "ss_ext_sales_price", + "ss_net_profit" + ], "Estimated Cardinality": "288464" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "288464" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Projections": [ - "s_store_sk", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "182344" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PERFECT_HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_returned_date_sk", + "sr_store_sk", + "sr_return_amt", + "sr_net_loss" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "sr_store_sk = s_store_sk", + "Estimated Cardinality": "28576" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450821i64 <= $.d_date_sk <= 2452820i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "sr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "28576" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "sr_returned_date_sk", - "sr_store_sk", - "sr_return_amt", - "sr_net_loss" + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" ], "Estimated Cardinality": "28576" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450821i64 <= $.d_date_sk <= 2452820i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_returned_date_sk = d_date_sk", + "Projections": [ + "s_store_sk", + "sr_return_amt", + "sr_net_loss" + ], "Estimated Cardinality": "28576" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "s_store_sk", - "Estimated Cardinality": "1" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "sr_store_sk = s_store_sk", - "Estimated Cardinality": "28576" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "s_store_sk", - "sr_return_amt", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" + "Join Type": "LEFT", + "Conditions": "s_store_sk = s_store_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "18063" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": "s_store_sk = s_store_sk", - "Estimated Cardinality": "182344" - } - } - ], - "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "182344" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "CROSS_PRODUCT", - "children": [ - { - "name": "PROJECTION", - "children": [ + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "1" + } + }, { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CROSS_PRODUCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_call_center_sk", + "cs_ext_sales_price", + "cs_net_profit" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "cs_sold_date_sk", "cs_call_center_sk", "cs_ext_sales_price", "cs_net_profit" ], "Estimated Cardinality": "143657" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "143657" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_usmallint(#3, 2450815)" + "#2" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Projections": [ - "cs_call_center_sk", - "cs_ext_sales_price", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "90808" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PERFECT_HASH_GROUP_BY", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -2632,333 +2609,372 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cr_returned_date_sk", + "cr_call_center_sk", + "cr_return_amount", + "cr_net_loss" + ], + "Estimated Cardinality": "14275" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "14275" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "cr_returned_date_sk", "cr_call_center_sk", "cr_return_amount", "cr_net_loss" ], "Estimated Cardinality": "14275" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450852i64 <= $.d_date_sk <= 2452907i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "14609" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_usmallint(#3, 2450852)" + "#2" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "cr_call_center_sk", - "cr_return_amount", - "cr_net_loss" + "returns_", + "profit_loss" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1" } } ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } + "extra_info": {} } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "9144" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Projections": [ - "returns_", - "profit_loss" - ], - "Estimated Cardinality": "9144" - } - } - ], - "extra_info": {} - } - ], - "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "830348352" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_web_page_sk", + "ws_ext_sales_price", + "ws_net_profit" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "wp_web_page_sk", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "71632" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ws_sold_date_sk", - "ws_web_page_sk", - "ws_ext_sales_price", - "ws_net_profit" + "CAST(#0 AS TINYINT)", + "#1", + "#2", + "#3" ], "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Projections": [ + "wp_web_page_sk", + "ws_ext_sales_price", + "ws_net_profit" + ], "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "wp_web_page_sk", - "Estimated Cardinality": "6" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_web_page_sk = wp_web_page_sk", - "Estimated Cardinality": "71632" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "6" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_utinyint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "#2" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "6" } - } - ], - "extra_info": { - "Projections": [ - "wp_web_page_sk", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] - } - } - ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "45280" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PERFECT_HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450865i64 <= $.d_date_sk <= 2452974i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - }, - { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450865i64 <= $.d_date_sk <= 2452974i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "wr_returned_date_sk", + "wr_web_page_sk", + "wr_return_amt", + "wr_net_loss" + ], + "Estimated Cardinality": "7037" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "wp_web_page_sk", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "wr_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "7037" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "d_date_sk = wr_returned_date_sk", + "Estimated Cardinality": "7037" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "wr_returned_date_sk", - "wr_web_page_sk", - "wr_return_amt", - "wr_net_loss" + "#0", + "CAST(#1 AS TINYINT)", + "#2", + "#3" ], "Estimated Cardinality": "7037" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "wp_web_page_sk", - "Estimated Cardinality": "6" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "wr_web_page_sk = wp_web_page_sk", + "Projections": [ + "wp_web_page_sk", + "wr_return_amt", + "wr_net_loss" + ], "Estimated Cardinality": "7037" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "d_date_sk = wr_returned_date_sk", - "Estimated Cardinality": "14609" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "6" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 2450865)", - "__internal_compress_integral_utinyint(#1, 1)", - "#2", - "#3" + "CAST(#0 AS BIGINT)", + "#1", + "#2" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "6" } } ], "extra_info": { - "Projections": [ - "wp_web_page_sk", - "wr_return_amt", - "wr_net_loss" - ], - "Estimated Cardinality": "14609" + "Join Type": "LEFT", + "Conditions": "wp_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)" - ] + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "6" } } ], - "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1", - "#2" - ], - "Estimated Cardinality": "6154" - } + "extra_info": {} } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "wp_web_page_sk = wp_web_page_sk", - "Estimated Cardinality": "45280" + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "CAST(#1 AS TINYINT)", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "8" } } ], @@ -2970,46 +2986,229 @@ physical_plan [ "returns_", "profit" ], - "Estimated Cardinality": "45280" + "Estimated Cardinality": "8" } } ], - "extra_info": {} + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "sum(#2) EXPORT_STATE", + "sum(#3) EXPORT_STATE", + "sum(#4) EXPORT_STATE" + ], + "Estimated Cardinality": "4" + } } ], "extra_info": { "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "__internal_decompress_string(#0)", + "CAST(#1 AS BIGINT)", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "830575976" + "Estimated Cardinality": "4" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "187", + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2" + } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "191", + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Aggregates": [ + "combine_aggr(#0)", + "combine_aggr(#1)", + "combine_aggr(#2)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::BIGINT", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "191", + "Estimated Cardinality": "2" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::BIGINT", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "2" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "187", + "Estimated Cardinality": "4" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "4" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_191", + "Table Index": "191", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "7" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": [ - "sum(#2)", - "sum(#3)", - "sum(#4)" - ], - "Estimated Cardinality": "274040" + "CTE Name": "__grouping_sets_cte_187", + "Table Index": "187", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "7" } } ], "extra_info": { "Top": "100", "Order By": [ - "x.channel ASC", - "x.id ASC", - "sum(x.returns_) DESC" - ] + "channel ASC", + "id ASC", + "returns_ DESC" + ], + "Estimated Cardinality": "7" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q78.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q78.slt.no index b58ee92dbb5..f1afc38ede8 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q78.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q78.slt.no @@ -758,16 +758,16 @@ logical_plan [ ], "extra_info": { "Order By": [ - "ss.ss_sold_year", - "ss.ss_item_sk", - "ss.ss_customer_sk", - "ss.ss_qty", - "ss.ss_wc", - "ss.ss_sp", - "(COALESCE(ws.ws_qty, 0) + COALESCE(cs.cs_qty, 0))", - "(COALESCE(ws.ws_wc, 0) + COALESCE(cs.cs_wc, 0))", - "(COALESCE(ws.ws_sp, 0) + COALESCE(cs.cs_sp, 0))", - "round(((ss.ss_qty * 1.00) / (COALESCE(ws.ws_qty, 0) + COALESCE(cs.cs_qty, 0))), 2)" + "ss_sold_year", + "ss_item_sk", + "ss_customer_sk", + "store_qty", + "store_wholesale_cost", + "store_sales_price", + "other_chan_qty", + "other_chan_wholesale_cost", + "other_chan_sales_price", + "ratio" ] } } @@ -809,592 +809,381 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "COMPARISON_JOIN", + "name": "FILTER", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_ticket_number", - "ss_quantity", - "ss_wholesale_cost", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_ticket_number = sr_ticket_number)", - "(ss_item_sk = sr_item_sk)" - ], - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "(sr_ticket_number IS NULL)", - "Estimated Cardinality": "57692" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + } + ], + "extra_info": { + "Join Type": "ANTI", + "Conditions": [ + "(ss_ticket_number = sr_ticket_number)", + "(ss_item_sk = sr_item_sk)" + ], + "Estimated Cardinality": "57692" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "2921" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "11535" + "Expressions": [ + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 2000)" - ], - "Estimated Cardinality": "11535" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "d_year", - "ss_item_sk", - "ss_customer_sk" - ], "Expressions": [ - "sum(ss_quantity)", - "sum(ss_wholesale_cost)", - "sum(ss_sales_price)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57692" } } ], "extra_info": { + "Groups": [ + "d_year", + "ss_item_sk", + "ss_customer_sk" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "sum(ss_quantity)", + "sum(ss_wholesale_cost)", + "sum(ss_sales_price)" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": [ - "ss_sold_year", - "ss_item_sk", - "ss_customer_sk", - "ss_qty", - "ss_wc", - "ss_sp" + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57691" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk", - "ws_order_number", - "ws_quantity", - "ws_wholesale_cost", - "ws_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Expressions": [ - "wr_item_sk", - "wr_order_number" - ], - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ws_order_number = wr_order_number)", - "(ws_item_sk = wr_item_sk)" - ], - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "(wr_order_number IS NULL)", - "Estimated Cardinality": "14326" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" - ], - "Estimated Cardinality": "2921" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "2864" + "Join Type": "ANTI", + "Conditions": [ + "(ws_order_number = wr_order_number)", + "(ws_item_sk = wr_item_sk)" + ], + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 2000)" - ], - "Estimated Cardinality": "2864" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Groups": [ - "d_year", - "ws_item_sk", - "ws_bill_customer_sk" - ], "Expressions": [ - "sum(ws_quantity)", - "sum(ws_wholesale_cost)", - "sum(ws_sales_price)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "__internal_compress_integral_utinyint(#5, 1900)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], "extra_info": { + "Groups": [ + "d_year", + "ws_item_sk", + "ws_bill_customer_sk" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "sum(ws_quantity)", + "sum(ws_wholesale_cost)", + "sum(ws_sales_price)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14325" } } ], "extra_info": { "Expressions": [ - "ws_sold_year", - "ws_item_sk", - "ws_customer_sk", - "ws_qty", - "ws_wc", - "ws_sp" + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14325" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Join Type": "LEFT", + "Conditions": [ + "(ss_sold_year = ws_sold_year)", + "(ss_item_sk = ws_item_sk)", + "(ss_customer_sk = ws_customer_sk)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "57691" } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_sold_year = ws_sold_year)", - "(ss_item_sk = ws_item_sk)", - "(ss_customer_sk = ws_customer_sk)" - ], - "Estimated Cardinality": "11534" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_wholesale_cost", - "cs_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(cs_order_number = cr_order_number)", - "(cs_item_sk = cr_item_sk)" - ], - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "(cr_order_number IS NULL)", - "Estimated Cardinality": "28731" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_year" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Join Type": "ANTI", + "Conditions": [ + "(cs_order_number = cr_order_number)", + "(cs_item_sk = cr_item_sk)" + ], + "Estimated Cardinality": "28731" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Estimated Cardinality": "2921" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "5744" + "Expressions": [ + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" + ], + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "#2", - "#3", - "#4", - "__internal_compress_integral_utinyint(#5, 2000)" - ], - "Estimated Cardinality": "5744" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "28731" } } ], "extra_info": { - "Groups": [ - "d_year", - "cs_item_sk", - "cs_bill_customer_sk" - ], "Expressions": [ - "sum(cs_quantity)", - "sum(cs_wholesale_cost)", - "sum(cs_sales_price)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "28731" } } ], "extra_info": { + "Groups": [ + "d_year", + "cs_item_sk", + "cs_bill_customer_sk" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "sum(cs_quantity)", + "sum(cs_wholesale_cost)", + "sum(cs_sales_price)" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "28730" } } ], "extra_info": { "Expressions": [ - "cs_sold_year", - "cs_item_sk", - "cs_customer_sk", - "cs_qty", - "cs_wc", - "cs_sp" + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "28730" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Join Type": "LEFT", + "Conditions": [ + "(ss_sold_year = cs_sold_year)", + "(ss_item_sk = cs_item_sk)", + "(ss_customer_sk = cs_customer_sk)" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_sold_year = cs_sold_year)", - "(ss_item_sk = cs_item_sk)", - "(ss_customer_sk = cs_customer_sk)" - ], - "Estimated Cardinality": "11534" + "Expressions": "((COALESCE(ws_qty, 0) > 0) OR (COALESCE(cs_qty, 0) > 0))", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": "((COALESCE(ws_qty, 0) > 0) OR (COALESCE(cs_qty, 0) > 0))", - "Estimated Cardinality": "2306" + "Expressions": "", + "Estimated Cardinality": "11538" } } ], @@ -1412,7 +1201,7 @@ logical_opt [ "ws_sp", "cs_sp" ], - "Estimated Cardinality": "2306" + "Estimated Cardinality": "11538" } } ], @@ -1429,7 +1218,7 @@ logical_opt [ "other_chan_wholesale_cost", "other_chan_sales_price" ], - "Estimated Cardinality": "2306" + "Estimated Cardinality": "11538" } } ], @@ -1474,103 +1263,94 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_ticket_number", - "ss_quantity", - "ss_wholesale_cost", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_item_sk", - "sr_ticket_number" - ], - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ss_ticket_number = sr_ticket_number", - "ss_item_sk = sr_item_sk" - ], - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_customer_sk", + "ss_ticket_number", + "ss_quantity", + "ss_wholesale_cost", + "ss_sales_price" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expression": "(sr_ticket_number IS NULL)", - "Estimated Cardinality": "57692" + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_ticket_number" + ], + "Estimated Cardinality": "28576" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Join Type": "ANTI", + "Conditions": [ + "ss_ticket_number = sr_ticket_number", + "ss_item_sk = sr_item_sk" ], "Estimated Cardinality": "57692" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", "Projections": [ - "d_date_sk", - "d_year" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", "#2", "#3", "#4", - "__internal_compress_integral_utinyint(#5, 2000)" + "#5" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -1583,7 +1363,7 @@ physical_plan [ "ss_wholesale_cost", "ss_sales_price" ], - "Estimated Cardinality": "11535" + "Estimated Cardinality": "57692" } } ], @@ -1598,20 +1378,20 @@ physical_plan [ "sum(#4)", "sum(#5)" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57691" } }, { @@ -1630,68 +1410,43 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_bill_customer_sk", - "ws_order_number", - "ws_quantity", - "ws_wholesale_cost", - "ws_sales_price" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "wr_item_sk", - "wr_order_number" - ], - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ws_order_number = wr_order_number", - "ws_item_sk = wr_item_sk" - ], - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_bill_customer_sk", + "ws_order_number", + "ws_quantity", + "ws_wholesale_cost", + "ws_sales_price" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expression": "(wr_order_number IS NULL)", - "Estimated Cardinality": "14326" + "Function": "Vortex Scan", + "Projections": [ + "wr_item_sk", + "wr_order_number" + ], + "Estimated Cardinality": "7037" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Join Type": "ANTI", + "Conditions": [ + "ws_order_number = wr_order_number", + "ws_item_sk = wr_item_sk" ], "Estimated Cardinality": "14326" } @@ -1701,32 +1456,35 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2000", + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ "d_date_sk", "d_year" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", "#2", "#3", "#4", - "__internal_compress_integral_utinyint(#5, 2000)" + "__internal_compress_integral_utinyint(#5, 1900)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -1739,7 +1497,7 @@ physical_plan [ "ws_wholesale_cost", "ws_sales_price" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } } ], @@ -1754,20 +1512,20 @@ physical_plan [ "sum(#4)", "sum(#5)" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14325" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14325" } } ], @@ -1778,7 +1536,7 @@ physical_plan [ "ss_item_sk = ws_item_sk", "ss_customer_sk = ws_customer_sk" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "57691" } }, { @@ -1797,103 +1555,94 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk", - "cs_order_number", - "cs_quantity", - "cs_wholesale_cost", - "cs_sales_price" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cr_item_sk", - "cr_order_number" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "cs_order_number = cr_order_number", - "cs_item_sk = cr_item_sk" - ], - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk", + "cs_order_number", + "cs_quantity", + "cs_wholesale_cost", + "cs_sales_price" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expression": "(cr_order_number IS NULL)", - "Estimated Cardinality": "28731" + "Function": "Vortex Scan", + "Projections": [ + "cr_item_sk", + "cr_order_number" + ], + "Estimated Cardinality": "14275" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Join Type": "ANTI", + "Conditions": [ + "cs_order_number = cr_order_number", + "cs_item_sk = cr_item_sk" ], "Estimated Cardinality": "28731" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": [ + "d_date_sk", + "d_year" + ], + "Estimated Cardinality": "14609" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", "Projections": [ - "d_date_sk", - "d_year" + "#0", + "#1", + "__internal_compress_integral_utinyint(#1, 1900)" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "5744" + "Estimated Cardinality": "28731" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", "#2", "#3", "#4", - "__internal_compress_integral_utinyint(#5, 2000)" + "#5" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "28731" } } ], @@ -1906,7 +1655,7 @@ physical_plan [ "cs_wholesale_cost", "cs_sales_price" ], - "Estimated Cardinality": "5744" + "Estimated Cardinality": "28731" } } ], @@ -1921,20 +1670,20 @@ physical_plan [ "sum(#4)", "sum(#5)" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "28730" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2000)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "__internal_decompress_integral_bigint(#0, 1900)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "5743" + "Estimated Cardinality": "28730" } } ], @@ -1945,13 +1694,13 @@ physical_plan [ "ss_item_sk = cs_item_sk", "ss_customer_sk = cs_customer_sk" ], - "Estimated Cardinality": "11534" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Expression": "((COALESCE(ws_qty, 0) > 0) OR (COALESCE(cs_qty, 0) > 0))", - "Estimated Cardinality": "2306" + "Estimated Cardinality": "11538" } } ], @@ -1969,7 +1718,7 @@ physical_plan [ "ws_sp", "cs_sp" ], - "Estimated Cardinality": "2306" + "Estimated Cardinality": "11538" } } ], @@ -1986,24 +1735,25 @@ physical_plan [ "other_chan_wholesale_cost", "other_chan_sales_price" ], - "Estimated Cardinality": "2306" + "Estimated Cardinality": "11538" } } ], "extra_info": { "Top": "100", "Order By": [ - "ss.ss_sold_year ASC", - "ss.ss_item_sk ASC", - "ss.ss_customer_sk ASC", - "ss.ss_qty DESC", - "ss.ss_wc DESC", - "ss.ss_sp DESC", - "(COALESCE(ws.ws_qty, 0) + COALESCE(cs.cs_qty, 0)) ASC", - "(COALESCE(ws.ws_wc, 0) + COALESCE(cs.cs_wc, 0)) ASC", - "(COALESCE(ws.ws_sp, 0) + COALESCE(cs.cs_sp, 0)) ASC", - "round(((ss.ss_qty * 1.00) / (COALESCE(ws.ws_qty, 0) + COALESCE(cs.cs_qty, 0))), 2) ASC" - ] + "ss_sold_year ASC", + "ss_item_sk ASC", + "ss_customer_sk ASC", + "store_qty DESC", + "store_wholesale_cost DESC", + "store_sales_price DESC", + "other_chan_qty ASC", + "other_chan_wholesale_cost ASC", + "other_chan_sales_price ASC", + "ratio ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q79.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q79.slt.no index efaf1b64db2..0af61653c94 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q79.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q79.slt.no @@ -343,11 +343,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_last_name", - "memory.main.customer.c_first_name", - "main.\"substring\"(ms.s_city, 1, 30)", - "ms.profit", - "ms.ss_ticket_number" + "c_last_name", + "c_first_name", + "\"substring\"(s_city, 1, 30)", + "profit", + "ss_ticket_number" ] } } @@ -371,13 +371,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -386,95 +386,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_coupon_amt", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", - "($.d_dow = 1i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(200i64 <= $.s_number_employees <= 295i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_city" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -486,90 +405,95 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(200i64 <= $.s_number_employees <= 295i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "($.d_dow = 1i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 1)" - ], - "Estimated Cardinality": "57677" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "s_city" - ], "Expressions": [ - "sum(ss_coupon_amt)", - "sum(ss_net_profit)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], "extra_info": { + "Groups": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "s_city" + ], "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "sum(ss_coupon_amt)", + "sum(ss_net_profit)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": [ - "ss_ticket_number", - "ss_customer_sk", - "s_city", - "amt", - "profit" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "10000" } } @@ -577,7 +501,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } } ], @@ -590,7 +514,7 @@ logical_opt [ "amt", "profit" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } } ], @@ -614,16 +538,16 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -632,41 +556,21 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_customer_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_ticket_number", - "ss_coupon_amt", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_dow=1", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_customer_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_ticket_number", + "ss_coupon_amt", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" } }, { @@ -674,19 +578,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(200i64 <= $.s_number_employees <= 295i64)", - "Projections": [ - "s_store_sk", - "s_city" - ], - "Estimated Cardinality": "1" + "Filters": "(($.hd_dep_count = 6i64) or ($.hd_vehicle_count > 2i32))", + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "57692" } }, { @@ -694,83 +595,95 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(($.hd_dep_count = 6i64) or ($.hd_vehicle_count > 2i32))", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Filters": "(200i64 <= $.s_number_employees <= 295i64)", + "Projections": [ + "s_store_sk", + "s_city" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([1999i64, 2000i64, 2001i64], $.d_year, opts=sql_null_semantics)", + "($.d_dow = 1i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 1)" - ], - "Estimated Cardinality": "57677" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "ss_addr_sk", - "s_city", - "ss_coupon_amt", - "ss_net_profit" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "CAST(#2 AS SMALLINT)", + "#3", + "#4", + "#5", + "#6" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "#0", - "#1", - "#2", - "#3" - ], - "Aggregates": [ - "sum(#4)", - "sum(#5)" + "Projections": [ + "ss_ticket_number", + "ss_customer_sk", + "ss_addr_sk", + "s_city", + "ss_coupon_amt", + "ss_net_profit" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", - "#3", - "#4", - "#5" + "Groups": [ + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "57677" + "Aggregates": [ + "sum(#4)", + "sum(#5)" + ], + "Estimated Cardinality": "57691" } } ], "extra_info": { "Projections": [ - "ss_ticket_number", - "ss_customer_sk", - "s_city", - "amt", - "profit" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", + "#3", + "#4", + "#5" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } }, { @@ -790,7 +703,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_customer_sk = c_customer_sk", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } } ], @@ -803,19 +716,20 @@ physical_plan [ "amt", "profit" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer.c_last_name ASC", - "memory.main.customer.c_first_name ASC", - "main.\"substring\"(ms.s_city, 1, 30) ASC", - "ms.profit ASC", - "ms.ss_ticket_number ASC" - ] + "c_last_name ASC", + "c_first_name ASC", + "\"substring\"(s_city, 1, 30) ASC", + "profit ASC", + "ss_ticket_number ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q8.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q8.slt.no index 6fb0934ff07..3122b51b041 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q8.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q8.slt.no @@ -820,7 +820,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.store.s_store_name" + "Order By": "s_store_name" } } ], @@ -837,10 +837,10 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", @@ -849,266 +849,279 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_qoy = 2i64)", - "($.d_year = 1998i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "DISTINCT", + "name": "AGGREGATE", "children": [ { - "name": "INTERSECT", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - }, - { - "name": "CHUNK_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "0" - } - } - ], - "extra_info": { - "Join Type": "MARK", - "Conditions": "(\"substring\"(ca_zip, 1, 5) = #0)", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": "IN (...)", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": "ca_zip", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": "ca_zip", - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "DISTINCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "INTERSECT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } + }, + { + "name": "CHUNK_GET", + "children": [], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "400" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "MARK", + "Conditions": "(\"substring\"(ca_zip, 1, 5) = #0)", "Estimated Cardinality": "5000" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_zip" - ], - "Estimated Cardinality": "5000" + "Expressions": "IN (...)", + "Estimated Cardinality": "1000" } - }, + } + ], + "extra_info": { + "Expressions": "ca_zip", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": "ca_zip", + "Estimated Cardinality": "1000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.c_preferred_cust_flag = \"Y\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ca_address_sk = c_current_addr_sk)", + "Estimated Cardinality": "2000" + } + } + ], "extra_info": { - "Filters": "($.c_preferred_cust_flag = \"Y\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "400" + "Groups": "ca_zip", + "Expressions": "count_star()", + "Estimated Cardinality": "1648" } } ], "extra_info": { - "Expressions": "c_current_addr_sk", - "Estimated Cardinality": "400" + "Expressions": "(count_star() > 10)", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ca_address_sk = c_current_addr_sk)", - "Estimated Cardinality": "1000" + "Expressions": "ca_zip", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Expressions": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)" - ], - "Estimated Cardinality": "1000" + "Expressions": "ca_zip", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Groups": "ca_zip", - "Expressions": "count_star()", - "Estimated Cardinality": "906" + "Expressions": "", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "906" + "Expressions": "#0", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Expressions": "(count_star() > 10)", - "Estimated Cardinality": "181" + "Expressions": "", + "Estimated Cardinality": "318", + "Distinct Targets": "ca_zip" } } ], "extra_info": { "Expressions": "ca_zip", - "Estimated Cardinality": "181" + "Estimated Cardinality": "318" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ca_zip", - "Estimated Cardinality": "181" + "Join Type": "INNER", + "Conditions": "(\"substring\"(ca_zip, 1, 2) = \"substring\"(s_zip, 1, 2))", + "Estimated Cardinality": "318" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "181" + "Expressions": [ + "#0", + "CAST(#1 AS TINYINT)", + "#2" + ], + "Estimated Cardinality": "318" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "181", - "Distinct Targets": "ca_zip" + "Groups": [ + "#1", + "#2" + ], + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ca_zip", - "Estimated Cardinality": "181" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "1" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 1998i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Groups": "#0", + "Expressions": "sum(ss_net_profit) EXPORT_STATE", "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "s_store_sk", - "s_store_name", - "s_zip" + "CAST(#0 AS BIGINT)", + "#1" ], "Estimated Cardinality": "1" } @@ -1116,22 +1129,24 @@ logical_opt [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "(\"substring\"(ca_zip, 1, 2) = \"substring\"(s_zip, 1, 2))", - "Estimated Cardinality": "181" + "Conditions": "(#0 = #0)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "10439537" + "Groups": "#0", + "Expressions": "combine_aggr(#2, #1)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "s_store_name", - "Expressions": "sum(ss_net_profit)", - "Estimated Cardinality": "288463" + "Expressions": [ + "#0", + "finalize(#1)" + ], + "Estimated Cardinality": "1" } } ], @@ -1140,13 +1155,13 @@ logical_opt [ "s_store_name", "sum(ss_net_profit)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "1" } } ] @@ -1155,244 +1170,341 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_store_sk", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_qoy=2" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "ca_zip", - "Estimated Cardinality": "5000" - } - }, - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - } - ], - "extra_info": { - "Join Type": "MARK", - "Conditions": "\"substring\"(ca_zip, 1, 5) = #0", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expression": "IN (...)", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Projections": "ca_zip", - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { "name": "HASH_GROUP_BY", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "FILTER", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "ca_zip", + "Estimated Cardinality": "5000" + } + }, + { + "name": "COLUMN_DATA_SCAN", + "children": [], + "extra_info": { + "Estimated Cardinality": "400" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "\"substring\"(ca_zip, 1, 5) = #0", + "Estimated Cardinality": "5000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_zip" - ], - "Estimated Cardinality": "5000" + "Expression": "IN (...)", + "Estimated Cardinality": "1000" } - }, + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Projections": "ca_zip", + "Estimated Cardinality": "1000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "FILTER", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ca_address_sk", + "ca_zip" + ], + "Estimated Cardinality": "5000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.c_preferred_cust_flag = \"Y\")", + "Projections": "c_current_addr_sk", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ca_address_sk = c_current_addr_sk", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Projections": "ca_zip", + "Estimated Cardinality": "2000" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "count_star()", + "Estimated Cardinality": "1648" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "c_preferred_cust_flag='Y'", - "Projections": "c_current_addr_sk", - "Estimated Cardinality": "400" + "Expression": "(count_star() > 10)", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ca_address_sk = c_current_addr_sk", - "Estimated Cardinality": "1000" + "Projections": "#0", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Projections": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)" - ], - "Estimated Cardinality": "1000" + "Projections": "ca_zip", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Projections": "ca_zip", - "Estimated Cardinality": "1000" + "Join Type": "SEMI", + "Conditions": "#0 IS NOT DISTINCT FROM #0", + "Estimated Cardinality": "329" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "count_star()", - "Estimated Cardinality": "906" + "Aggregates": "", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Expression": "(count_star() > 10)", - "Estimated Cardinality": "181" + "Projections": "ca_zip", + "Estimated Cardinality": "329" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "181" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "318" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_store_sk", + "s_store_name", + "s_zip" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": "ca_zip", - "Estimated Cardinality": "181" + "Join Type": "INNER", + "Conditions": "\"substring\"(ca_zip, 1, 2) = \"substring\"(s_zip, 1, 2)", + "Estimated Cardinality": "318" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "#0 IS NOT DISTINCT FROM #0", - "Estimated Cardinality": "181" + "Projections": [ + "#0", + "CAST(#1 AS TINYINT)", + "#2" + ], + "Estimated Cardinality": "318" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "181" + "Projections": [ + "#1", + "#2" + ], + "Estimated Cardinality": "318" } } ], "extra_info": { - "Projections": "ca_zip", - "Estimated Cardinality": "181" + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "181" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "1" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PERFECT_HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_store_sk", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_qoy = 2i64)", + "($.d_year = 1998i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS TINYINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "sum(#1) EXPORT_STATE", + "Estimated Cardinality": "1" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "s_store_sk", - "s_store_name", - "s_zip" + "CAST(#0 AS BIGINT)", + "#1" ], "Estimated Cardinality": "1" } @@ -1400,37 +1512,41 @@ physical_plan [ ], "extra_info": { "Join Type": "INNER", - "Conditions": "\"substring\"(ca_zip, 1, 2) = \"substring\"(s_zip, 1, 2)", - "Estimated Cardinality": "181" + "Conditions": "#0 = #0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "10439537" + "Projections": [ + "#0", + "#2", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "s_store_name", - "ss_net_profit" - ], - "Estimated Cardinality": "10439537" + "Groups": "#0", + "Aggregates": "combine_aggr(#1, #2)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "sum(#1)", - "Estimated Cardinality": "288463" + "Projections": [ + "#0", + "finalize(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.store.s_store_name ASC" + "Order By": "s_store_name ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q80.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q80.slt.no index 82eb09a8b0f..a5906f6c7f9 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q80.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q80.slt.no @@ -1210,8 +1210,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "x.channel", - "x.id" + "channel", + "id" ] } } @@ -1247,38 +1247,47 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "UNION", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "UNION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -1286,92 +1295,68 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.p_channel_tv = \"N\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_promo_sk = p_promo_sk)", + "Estimated Cardinality": "57692" } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ticket_number", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "28576" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_ticket_number", - "sr_return_amt", - "sr_net_loss" - ], - "Estimated Cardinality": "28576" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_item_sk = sr_item_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.p_channel_tv = \"N\")", + "Filters": "", "Function": "Vortex Scan", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "11538" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_promo_sk = p_promo_sk)", - "Estimated Cardinality": "48077" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -1386,68 +1371,41 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "48077" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_id" + "Join Type": "RIGHT", + "Conditions": [ + "(sr_item_sk = ss_item_sk)", + "(sr_ticket_number = ss_ticket_number)" ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "48077" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" + "Estimated Cardinality": "11538" } } ], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "360" + "Groups": "s_store_id", + "Expressions": [ + "sum(ss_ext_sales_price)", + "sum(COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00))", + "sum((CAST(ss_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(sr_net_loss AS DECIMAL(12,2)), 0.00)))" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "48077" + "Expressions": [ + "store_id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "1" } } ], @@ -1456,265 +1414,165 @@ logical_opt [ "#0", "#1", "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" + "#3" ], - "Estimated Cardinality": "48077" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "s_store_id", "Expressions": [ - "sum(ss_ext_sales_price)", - "sum(COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00))", - "sum((CAST(ss_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(sr_net_loss AS DECIMAL(12,2)), 0.00)))" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "44284" + "Estimated Cardinality": "1" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "44284" - } - } - ], - "extra_info": { - "Expressions": [ - "store_id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "44284" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "44284" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "44284" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + }, { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_catalog_page_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_order_number", - "cs_ext_sales_price", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" + "Filters": "($.cp_catalog_page_sk <= 9827i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "11718" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.p_channel_tv = \"N\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_promo_sk = p_promo_sk)", + "Estimated Cardinality": "28731" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "14275" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "cr_item_sk", - "cr_order_number", - "cr_return_amount", - "cr_net_loss" - ], - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(cs_item_sk = cr_item_sk)", - "(cs_order_number = cr_order_number)" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.p_channel_tv = \"N\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(cs_item_sk = i_item_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(cp_catalog_page_sk = cs_catalog_page_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_promo_sk = p_promo_sk)", - "Estimated Cardinality": "23942" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "23942" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.cp_catalog_page_sk <= 9827i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "11718" + "Conditions": "(d_date_sk = cs_sold_date_sk)", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Expressions": [ - "cp_catalog_page_sk", - "cp_catalog_page_id" + "Join Type": "RIGHT", + "Conditions": [ + "(cr_item_sk = cs_item_sk)", + "(cr_order_number = cs_order_number)" ], - "Estimated Cardinality": "11718" + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_catalog_page_sk = cp_catalog_page_sk)", - "Estimated Cardinality": "23942" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "360" + "Groups": "cp_catalog_page_id", + "Expressions": [ + "sum(cs_ext_sales_price)", + "sum(COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00))", + "sum((CAST(cs_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(cr_net_loss AS DECIMAL(12,2)), 0.00)))" + ], + "Estimated Cardinality": "4541" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_item_sk = i_item_sk)", - "Estimated Cardinality": "23942" + "Expressions": [ + "catalog_page_id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "4541" } } ], @@ -1723,265 +1581,165 @@ logical_opt [ "#0", "#1", "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" + "#3" ], - "Estimated Cardinality": "23942" + "Estimated Cardinality": "4541" } } ], "extra_info": { - "Groups": "cp_catalog_page_id", "Expressions": [ - "sum(cs_ext_sales_price)", - "sum(COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00))", - "sum((CAST(cs_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(cr_net_loss AS DECIMAL(12,2)), 0.00)))" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "22053" + "Estimated Cardinality": "4541" } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "22053" - } - } - ], - "extra_info": { - "Expressions": [ - "catalog_page_id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "22053" - } - } - ], - "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "22053" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "22053" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.p_channel_tv = \"N\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Join Type": "INNER", + "Conditions": "(ws_promo_sk = p_promo_sk)", + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_web_site_sk", - "ws_promo_sk", - "ws_order_number", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", "Function": "Vortex Scan", - "Estimated Cardinality": "7037" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": [ - "wr_item_sk", - "wr_order_number", - "wr_return_amt", - "wr_net_loss" - ], - "Estimated Cardinality": "7037" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "2865" } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ws_item_sk = wr_item_sk)", - "(ws_order_number = wr_order_number)" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.p_channel_tv = \"N\")", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Expressions": "p_promo_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_promo_sk = p_promo_sk)", - "Estimated Cardinality": "11938" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_web_site_sk = web_site_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "RIGHT", + "Conditions": [ + "(wr_item_sk = ws_item_sk)", + "(wr_order_number = ws_order_number)" + ], + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "11938" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Expressions": [ - "web_site_sk", - "web_site_id" - ], - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_web_site_sk = web_site_sk)", - "Estimated Cardinality": "11938" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "2865" } } ], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "360" + "Groups": "web_site_id", + "Expressions": [ + "sum(ws_ext_sales_price)", + "sum(COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00))", + "sum((CAST(ws_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(wr_net_loss AS DECIMAL(12,2)), 0.00)))" + ], + "Estimated Cardinality": "3" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "11938" + "Expressions": [ + "web_site_id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "3" } } ], @@ -1990,163 +1748,411 @@ logical_opt [ "#0", "#1", "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" + "#3" ], - "Estimated Cardinality": "11938" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Groups": "web_site_id", "Expressions": [ - "sum(ws_ext_sales_price)", - "sum(COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00))", - "sum((CAST(ws_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(wr_net_loss AS DECIMAL(12,2)), 0.00)))" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "10996" + "Expressions": "", + "Estimated Cardinality": "4545" } } ], "extra_info": { "Expressions": [ - "web_site_id", - "sales", - "returns_", - "profit" + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "4545" } } ], "extra_info": { + "Groups": [ + "channel", + "id" + ], "Expressions": [ - "#0", - "#1", - "#2", - "#3" + "sum(sales) EXPORT_STATE", + "sum(returns_) EXPORT_STATE", + "sum(profit) EXPORT_STATE" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "2272" } } ], "extra_info": { "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "2272" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "77333" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "2272" } - } - ], - "extra_info": { - "Groups": [ - "channel", - "id" - ], - "Expressions": [ - "sum(sales)", - "sum(returns_)", - "sum(profit)" - ], - "Estimated Cardinality": "67379" - } - } - ], - "extra_info": { - "Expressions": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "67379" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "100" - } - } -] -physical_plan [ - { - "name": "TOP_N", - "children": [ - { - "name": "HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { - "name": "UNION", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "177", + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": [ + "combine_aggr(#2)", + "combine_aggr(#3)", + "combine_aggr(#4)" + ], + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Expressions": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "1136" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "1136" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "177", + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" + ], + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_181", + "Table Index": "181", + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "CTE Name": "__grouping_sets_cte_177", + "Table Index": "177", + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "Expressions": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "3409" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "100" + } + } +] +physical_plan [ + { + "name": "TOP_N", + "children": [ + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_ticket_number", + "sr_return_amt", + "sr_net_loss" + ], + "Estimated Cardinality": "28576" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_store_sk", + "ss_promo_sk", + "ss_ticket_number", + "ss_ext_sales_price", + "ss_net_profit" + ], + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.p_channel_tv = \"N\")", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ss_promo_sk = p_promo_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ticket_number", - "ss_ext_sales_price", - "ss_net_profit" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "11538" } }, { @@ -2155,22 +2161,17 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "sr_item_sk", - "sr_ticket_number", - "sr_return_amt", - "sr_net_loss" + "s_store_sk", + "s_store_id" ], - "Estimated Cardinality": "28576" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ss_item_sk = sr_item_sk", - "ss_ticket_number = sr_ticket_number" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_store_sk = s_store_sk", + "Estimated Cardinality": "11538" } }, { @@ -2178,163 +2179,338 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "p_channel_tv='N'", - "Projections": "p_promo_sk", - "Estimated Cardinality": "1" + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_promo_sk = p_promo_sk", - "Estimated Cardinality": "48077" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "11538" } - }, + } + ], + "extra_info": { + "Join Type": "RIGHT", + "Conditions": [ + "sr_item_sk = ss_item_sk", + "sr_ticket_number = ss_ticket_number" + ], + "Estimated Cardinality": "11538" + } + } + ], + "extra_info": { + "Projections": [ + "s_store_id", + "ss_ext_sales_price", + "COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00)", + "(CAST(ss_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(sr_net_loss AS DECIMAL(12,2)), 0.00))" + ], + "Estimated Cardinality": "11538" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "channel", + "id", + "sales", + "returns_", + "profit" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Projections": [ + "cr_item_sk", + "cr_order_number", + "cr_return_amount", + "cr_net_loss" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "14275" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.cp_catalog_page_sk <= 9827i64)", + "Projections": [ + "cp_catalog_page_sk", + "cp_catalog_page_id" + ], + "Estimated Cardinality": "11718" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_catalog_page_sk", + "cs_item_sk", + "cs_promo_sk", + "cs_order_number", + "cs_ext_sales_price", + "cs_net_profit" + ], + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.p_channel_tv = \"N\")", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_promo_sk = p_promo_sk", + "Estimated Cardinality": "28731" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cs_item_sk = i_item_sk", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "cp_catalog_page_sk = cs_catalog_page_sk", + "Estimated Cardinality": "5746" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "d_date_sk = cs_sold_date_sk", + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "48077" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_store_sk", - "s_store_id" + "Join Type": "RIGHT", + "Conditions": [ + "cr_item_sk = cs_item_sk", + "cr_order_number = cs_order_number" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "48077" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Projections": "i_item_sk", - "Estimated Cardinality": "360" + "Projections": [ + "cp_catalog_page_id", + "cs_ext_sales_price", + "COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00)", + "(CAST(cs_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(cr_net_loss AS DECIMAL(12,2)), 0.00))" + ], + "Estimated Cardinality": "5746" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "48077" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)" + ], + "Estimated Cardinality": "4541" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "48077" + "Estimated Cardinality": "4541" } - } - ], - "extra_info": { - "Projections": [ - "s_store_id", - "ss_ext_sales_price", - "COALESCE(CAST(sr_return_amt AS DECIMAL(12,2)), 0.00)", - "(CAST(ss_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(sr_net_loss AS DECIMAL(12,2)), 0.00))" - ], - "Estimated Cardinality": "48077" - } - } - ], - "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)" - ], - "Estimated Cardinality": "44284" - } - } - ], - "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "44284" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_GROUP_BY", - "children": [ - { - "name": "PROJECTION", - "children": [ + }, { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-08-23 <= $.d_date <= 2000-09-22)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "wr_item_sk", + "wr_order_number", + "wr_return_amt", + "wr_net_loss" + ], + "Estimated Cardinality": "7037" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_web_site_sk", + "ws_promo_sk", + "ws_order_number", + "ws_ext_sales_price", + "ws_net_profit" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.p_channel_tv = \"N\")", + "Projections": "p_promo_sk", + "Estimated Cardinality": "6" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_promo_sk = p_promo_sk", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_catalog_page_sk", - "cs_item_sk", - "cs_promo_sk", - "cs_order_number", - "cs_ext_sales_price", - "cs_net_profit" - ], - "Estimated Cardinality": "143657" + "Join Type": "INNER", + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "2865" } }, { @@ -2343,131 +2519,83 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cr_item_sk", - "cr_order_number", - "cr_return_amount", - "cr_net_loss" + "web_site_sk", + "web_site_id" ], - "Estimated Cardinality": "14275" + "Estimated Cardinality": "3" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "cs_item_sk = cr_item_sk", - "cs_order_number = cr_order_number" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "p_channel_tv='N'", - "Projections": "p_promo_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "ws_web_site_sk = web_site_sk", + "Estimated Cardinality": "2865" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_promo_sk = p_promo_sk", - "Estimated Cardinality": "23942" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" + "Join Type": "RIGHT", + "Conditions": [ + "wr_item_sk = ws_item_sk", + "wr_order_number = ws_order_number" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "2865" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", - "Estimated Cardinality": "23942" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.cp_catalog_page_sk <= 9827i64)", - "Projections": [ - "cp_catalog_page_sk", - "cp_catalog_page_id" - ], - "Estimated Cardinality": "11718" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "2865" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_catalog_page_sk = cp_catalog_page_sk", - "Estimated Cardinality": "23942" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Projections": "i_item_sk", - "Estimated Cardinality": "360" + "Projections": [ + "web_site_id", + "ws_ext_sales_price", + "COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00)", + "(CAST(ws_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(wr_net_loss AS DECIMAL(12,2)), 0.00))" + ], + "Estimated Cardinality": "2865" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_item_sk = i_item_sk", - "Estimated Cardinality": "23942" + "Groups": "#0", + "Aggregates": [ + "sum(#1)", + "sum(#2)", + "sum(#3)" + ], + "Estimated Cardinality": "3" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" + "channel", + "id", + "sales", + "returns_", + "profit" ], - "Estimated Cardinality": "23942" + "Estimated Cardinality": "3" } } ], - "extra_info": { - "Projections": [ - "cp_catalog_page_id", - "cs_ext_sales_price", - "COALESCE(CAST(cr_return_amount AS DECIMAL(12,2)), 0.00)", - "(CAST(cs_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(cr_net_loss AS DECIMAL(12,2)), 0.00))" - ], - "Estimated Cardinality": "23942" - } + "extra_info": {} } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)" + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "22053" + "Estimated Cardinality": "4545" } } ], @@ -2479,195 +2607,199 @@ physical_plan [ "returns_", "profit" ], - "Estimated Cardinality": "22053" + "Estimated Cardinality": "4545" } - }, + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "sum(#2) EXPORT_STATE", + "sum(#3) EXPORT_STATE", + "sum(#4) EXPORT_STATE" + ], + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "2272" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "177", + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": [ + "combine_aggr(#1)", + "combine_aggr(#2)", + "combine_aggr(#3)" + ], + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "1136" + } + }, + { + "name": "UNION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "UNGROUPED_AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_web_site_sk", - "ws_promo_sk", - "ws_order_number", - "ws_ext_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "wr_item_sk", - "wr_order_number", - "wr_return_amt", - "wr_net_loss" - ], - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ws_item_sk = wr_item_sk", - "ws_order_number = wr_order_number" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "p_channel_tv='N'", - "Projections": "p_promo_sk", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_promo_sk = p_promo_sk", - "Estimated Cardinality": "11938" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-08-23 <= $.d_date <= 2000-09-22)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "11938" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "web_site_sk", - "web_site_id" - ], - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_web_site_sk = web_site_sk", - "Estimated Cardinality": "11938" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.i_current_price > decimal128(5000, precision=7, scale=2))", - "Projections": "i_item_sk", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "11938" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_compress_integral_usmallint(#5, 1)" - ], - "Estimated Cardinality": "11938" + "CTE Index": "181", + "Estimated Cardinality": "1136" } } ], "extra_info": { "Projections": [ - "web_site_id", - "ws_ext_sales_price", - "COALESCE(CAST(wr_return_amt AS DECIMAL(12,2)), 0.00)", - "(CAST(ws_net_profit AS DECIMAL(13,2)) - COALESCE(CAST(wr_net_loss AS DECIMAL(12,2)), 0.00))" + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "11938" + "Estimated Cardinality": "1136" } } ], "extra_info": { - "Groups": "#0", "Aggregates": [ - "sum(#1)", - "sum(#2)", - "sum(#3)" + "combine_aggr(#0)", + "combine_aggr(#1)", + "combine_aggr(#2)" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "1" } } ], "extra_info": { "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "finalize(#1)", + "finalize(#2)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "181", + "Estimated Cardinality": "1136" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "finalize(#2)", + "finalize(#3)" + ], + "Estimated Cardinality": "1136" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "177", + "Estimated Cardinality": "2272" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "finalize(#2)", + "finalize(#3)", + "finalize(#4)" ], - "Estimated Cardinality": "10996" + "Estimated Cardinality": "2272" } } ], @@ -2675,37 +2807,28 @@ physical_plan [ } ], "extra_info": { - "Projections": [ - "channel", - "id", - "sales", - "returns_", - "profit" - ], - "Estimated Cardinality": "77333" + "CTE Name": "__grouping_sets_cte_181", + "Table Index": "181", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3409" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": [ - "sum(#2)", - "sum(#3)", - "sum(#4)" - ], - "Estimated Cardinality": "67379" + "CTE Name": "__grouping_sets_cte_177", + "Table Index": "177", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3409" } } ], "extra_info": { "Top": "100", "Order By": [ - "x.channel ASC", - "x.id ASC" - ] + "channel ASC", + "id ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q81.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q81.slt.no index 7d00f186c63..1eb277d9a3c 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q81.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q81.slt.no @@ -371,8 +371,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -410,22 +409,22 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.customer.c_customer_id", - "memory.main.customer.c_salutation", - "memory.main.customer.c_first_name", - "memory.main.customer.c_last_name", - "memory.main.customer_address.ca_street_number", - "memory.main.customer_address.ca_street_name", - "memory.main.customer_address.ca_street_type", - "memory.main.customer_address.ca_suite_number", - "memory.main.customer_address.ca_city", - "memory.main.customer_address.ca_county", - "memory.main.customer_address.ca_state", - "memory.main.customer_address.ca_zip", - "memory.main.customer_address.ca_country", - "memory.main.customer_address.ca_gmt_offset", - "memory.main.customer_address.ca_location_type", - "ctr1.ctr_total_return" + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "ca_street_number", + "ca_street_name", + "ca_street_type", + "ca_suite_number", + "ca_city", + "ca_county", + "ca_state", + "ca_zip", + "ca_country", + "ca_gmt_offset", + "ca_location_type", + "ctr_total_return" ] } } @@ -461,7 +460,7 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -469,87 +468,53 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "5000" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "5000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_returned_date_sk", - "cr_returning_customer_sk", - "cr_returning_addr_sk", - "cr_return_amt_inc_tax" - ], "Estimated Cardinality": "14275" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450852i64 <= $.d_date_sk <= 2452907i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "2921" + "Conditions": "(cr_returning_addr_sk = ca_address_sk)", + "Estimated Cardinality": "14275" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ca_address_sk = cr_returning_addr_sk)", - "Estimated Cardinality": "2921" + "Conditions": "(cr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "14275" } } ], "extra_info": { "Expressions": [ - "#0", - "__internal_compress_integral_usmallint(#1, 2)", - "#2" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14275" } } ], @@ -559,17 +524,17 @@ logical_opt [ "ca_state" ], "Expressions": "sum(cr_return_amt_inc_tax)", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 2)", + "CAST(#0 AS BIGINT)", "#1", "#2" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } } ], @@ -579,110 +544,148 @@ logical_opt [ "ctr_state", "ctr_total_return" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "CTE Index": "0", + "Estimated Cardinality": "14272" } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_customer_id", - "c_current_addr_sk", - "c_salutation", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.c_customer_sk >= 2i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.ca_state = \"GA\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": [ + "ca_address_sk", + "ca_street_number", + "ca_street_name", + "ca_street_type", + "ca_suite_number", + "ca_city", + "ca_county", + "ca_state", + "ca_zip", + "ca_country", + "ca_gmt_offset", + "ca_location_type" + ], + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Filters": "($.ca_state = \"GA\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "2000" } } ], "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_street_number", - "ca_street_name", - "ca_street_type", - "ca_suite_number", - "ca_city", - "ca_county", - "ca_state", - "ca_zip", - "ca_country", - "ca_gmt_offset", - "ca_location_type" - ], - "Estimated Cardinality": "200" + "Join Type": "INNER", + "Conditions": "(ctr_customer_sk = c_customer_sk)", + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2000" - } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" + "Expressions": [ + "#0", + "#1", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_customer_sk = ctr_customer_sk)", - "Estimated Cardinality": "584" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16" + ], + "Estimated Cardinality": "2854" } }, { "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", @@ -691,79 +694,189 @@ logical_opt [ "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" + "CTE Index": "60", + "Estimated Cardinality": "2854" } }, { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "14272" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "2854" + } + } + ], + "extra_info": { + "Groups": "#[28.1]", + "Expressions": "", + "Estimated Cardinality": "1427" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1427" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ctr_state = ctr_state)", + "Estimated Cardinality": "2854" + } + } + ], + "extra_info": { + "Groups": "ctr_state", + "Expressions": "avg(ctr_total_return)", + "Estimated Cardinality": "1427" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "572" + "Expressions": [ + "(avg(ctr_total_return) * 1.2)", + "ctr_state" + ], + "Estimated Cardinality": "1427" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ctr_state = ctr_state)", - "Estimated Cardinality": "117" + "Conditions": [ + "(ctr_state IS NOT DISTINCT FROM ctr_state)", + "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Groups": "ctr_state", - "Expressions": "avg(ctr_total_return)", - "Estimated Cardinality": "58" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { "Expressions": [ - "(avg(ctr_total_return) * 1.2)", - "ctr_state" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15" ], - "Estimated Cardinality": "58" + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(ctr_state IS NOT DISTINCT FROM ctr_state)" + "CTE Name": "__duckdb_delim_60", + "Table Index": "60", + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Expressions": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "584" + "Expressions": [ + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "ca_street_number", + "ca_street_name", + "ca_street_type", + "ca_suite_number", + "ca_city", + "ca_county", + "ca_state", + "ca_zip", + "ca_country", + "ca_gmt_offset", + "ca_location_type", + "ctr_total_return" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Expressions": [ - "c_customer_id", - "c_salutation", - "c_first_name", - "c_last_name", - "ca_street_number", - "ca_street_name", - "ca_street_type", - "ca_suite_number", - "ca_city", - "ca_county", - "ca_state", - "ca_zip", - "ca_country", - "ca_gmt_offset", - "ca_location_type", - "ctr_total_return" - ], - "Estimated Cardinality": "584" + "Expressions": "", + "Estimated Cardinality": "100" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15" + ], "Estimated Cardinality": "100" } } @@ -794,18 +907,6 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "5000" - } - }, { "name": "HASH_JOIN", "children": [ @@ -828,33 +929,49 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=2000", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "5000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "2921" + "Conditions": "cr_returning_addr_sk = ca_address_sk", + "Estimated Cardinality": "14275" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.d_year = 2000i64)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ca_address_sk = cr_returning_addr_sk", - "Estimated Cardinality": "2921" + "Conditions": "cr_returned_date_sk = d_date_sk", + "Estimated Cardinality": "14275" } } ], "extra_info": { "Projections": [ - "#0", - "__internal_compress_integral_usmallint(#1, 2)", - "#2" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14275" } } ], @@ -864,7 +981,7 @@ physical_plan [ "ca_state", "cr_return_amt_inc_tax" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "14275" } } ], @@ -874,17 +991,17 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 2)", + "CAST(#0 AS BIGINT)", "#1", "#2" ], - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } }, { @@ -894,14 +1011,22 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "14272" + } + }, { "name": "HASH_JOIN", "children": [ @@ -910,6 +1035,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "($.c_customer_sk >= 2i64)", "Projections": [ "c_customer_sk", "c_customer_id", @@ -926,7 +1052,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_state='GA'", + "Filters": "($.ca_state = \"GA\")", "Projections": [ "ca_address_sk", "ca_street_number", @@ -941,7 +1067,7 @@ physical_plan [ "ca_gmt_offset", "ca_location_type" ], - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], @@ -950,30 +1076,50 @@ physical_plan [ "Conditions": "c_current_addr_sk = ca_address_sk", "Estimated Cardinality": "2000" } - }, - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2920" - } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_customer_sk = ctr_customer_sk", - "Estimated Cardinality": "584" + "Conditions": "ctr_customer_sk = c_customer_sk", + "Estimated Cardinality": "2854" } - }, + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15", + "#16", + "#2", + "#3", + "#4", + "#5" + ], + "Estimated Cardinality": "2854" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "CTE Index": "60", + "Estimated Cardinality": "2854" } }, { @@ -993,22 +1139,41 @@ physical_plan [ "children": [], "extra_info": { "CTE Index": "0", - "Estimated Cardinality": "2920" + "Estimated Cardinality": "14272" } }, { - "name": "DELIM_SCAN", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "60", + "Estimated Cardinality": "2854" + } + } + ], + "extra_info": { + "Projections": "#[28.1]", + "Estimated Cardinality": "2854" + } + } + ], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "572" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "1427" } } ], "extra_info": { - "Join Type": "INNER", + "Join Type": "SEMI", "Conditions": "ctr_state = ctr_state", - "Estimated Cardinality": "117" + "Estimated Cardinality": "2854" } } ], @@ -1017,14 +1182,14 @@ physical_plan [ "ctr_state", "ctr_total_return" ], - "Estimated Cardinality": "117" + "Estimated Cardinality": "2854" } } ], "extra_info": { "Groups": "#0", "Aggregates": "avg(#1)", - "Estimated Cardinality": "58" + "Estimated Cardinality": "1427" } } ], @@ -1033,89 +1198,102 @@ physical_plan [ "(avg(ctr_total_return) * 1.2)", "ctr_state" ], - "Estimated Cardinality": "58" + "Estimated Cardinality": "1427" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_state IS NOT DISTINCT FROM ctr_state", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#15", - "Aggregates": "", - "Estimated Cardinality": "572" + "Join Type": "INNER", + "Conditions": [ + "ctr_state IS NOT DISTINCT FROM ctr_state", + "CAST(ctr_total_return AS DOUBLE) > SUBQUERY" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "ctr_state IS NOT DISTINCT FROM ctr_state", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9", + "#10", + "#11", + "#12", + "#13", + "#14", + "#15" + ], + "Estimated Cardinality": "2854" } } ], "extra_info": { - "Expression": "(CAST(ctr_total_return AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "584" + "CTE Name": "__duckdb_delim_60", + "Table Index": "60", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "2854" } } ], "extra_info": { "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8", - "#9", - "#10", - "#11", - "#12", - "#13", - "#14", - "#15" + "c_customer_id", + "c_salutation", + "c_first_name", + "c_last_name", + "ca_street_number", + "ca_street_name", + "ca_street_type", + "ca_suite_number", + "ca_city", + "ca_county", + "ca_state", + "ca_zip", + "ca_country", + "ca_gmt_offset", + "ca_location_type", + "ctr_total_return" ], - "Estimated Cardinality": "584" + "Estimated Cardinality": "2854" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.customer.c_customer_id ASC", - "memory.main.customer.c_salutation ASC", - "memory.main.customer.c_first_name ASC", - "memory.main.customer.c_last_name ASC", - "memory.main.customer_address.ca_street_number ASC", - "memory.main.customer_address.ca_street_name ASC", - "memory.main.customer_address.ca_street_type ASC", - "memory.main.customer_address.ca_suite_number ASC", - "memory.main.customer_address.ca_city ASC", - "memory.main.customer_address.ca_county ASC", - "memory.main.customer_address.ca_state ASC", - "memory.main.customer_address.ca_zip ASC", - "memory.main.customer_address.ca_country ASC", - "memory.main.customer_address.ca_gmt_offset ASC", - "memory.main.customer_address.ca_location_type ASC", - "ctr1.ctr_total_return ASC" - ] + "c_customer_id ASC", + "c_salutation ASC", + "c_first_name ASC", + "c_last_name ASC", + "ca_street_number ASC", + "ca_street_name ASC", + "ca_street_type ASC", + "ca_suite_number ASC", + "ca_city ASC", + "ca_county ASC", + "ca_state ASC", + "ca_zip ASC", + "ca_country ASC", + "ca_gmt_offset ASC", + "ca_location_type ASC", + "ctr_total_return ASC" + ], + "Estimated Cardinality": "100" } } ], "extra_info": { "CTE Name": "customer_total_return", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "100" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q82.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q82.slt.no index 8deae7ff61b..a9373e5af87 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q82.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q82.slt.no @@ -248,7 +248,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.item.i_item_id" + "Order By": "i_item_id" } } ], @@ -265,160 +265,89 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_item_sk", - "Estimated Cardinality": "288464" + "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", + "Function": "Vortex Scan", + "Estimated Cardinality": "46980" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", - "Function": "Vortex Scan", - "Estimated Cardinality": "46980" - } - } - ], - "extra_info": { - "Expressions": [ - "inv_date_sk", - "inv_item_sk" - ], - "Estimated Cardinality": "46980" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-05-25 <= $.d_date <= 2000-07-24)", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_date_sk = d_date_sk)", - "Estimated Cardinality": "46980" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([129i64, 270i64, 821i64, 423i64], $.i_manufact_id, opts=sql_null_semantics)", - "(decimal128(6200, precision=7, scale=2) <= $.i_current_price <= decimal128(9200, precision=7, scale=2))" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price" - ], - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(inv_item_sk = i_item_sk)", - "Estimated Cardinality": "46980" + "Filters": [ + "vortex.list.contains([129i64, 270i64, 821i64, 423i64], $.i_manufact_id, opts=sql_null_semantics)", + "(decimal128(6200, precision=7, scale=2) <= $.i_current_price <= decimal128(9200, precision=7, scale=2))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "37644552" + "Conditions": "(inv_item_sk = i_item_sk)", + "Estimated Cardinality": "9396" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(2000-05-25 <= $.d_date <= 2000-07-24)", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "37644552" + "Join Type": "INNER", + "Conditions": "(inv_date_sk = d_date_sk)", + "Estimated Cardinality": "9396" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "i_current_price" - ], - "Expressions": "", - "Estimated Cardinality": "24884920" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "1505782" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2" + "Groups": [ + "i_item_id", + "i_item_desc", + "i_current_price" ], - "Estimated Cardinality": "24884920" + "Expressions": "", + "Estimated Cardinality": "1479176" } } ], @@ -428,7 +357,7 @@ logical_opt [ "i_item_desc", "i_current_price" ], - "Estimated Cardinality": "24884920" + "Estimated Cardinality": "1479176" } } ], @@ -449,56 +378,33 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "ss_item_sk", + "Estimated Cardinality": "288464" + } + }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "ss_item_sk", - "Estimated Cardinality": "288464" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", - "Projections": [ - "inv_date_sk", - "inv_item_sk" - ], - "Estimated Cardinality": "46980" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-05-25 <= $.d_date <= 2000-07-24)", - "(2450815i64 <= $.d_date_sk <= 2452635i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "inv_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Filters": "(100i32 <= $.inv_quantity_on_hand <= 500i32)", + "Projections": [ + "inv_date_sk", + "inv_item_sk" + ], "Estimated Cardinality": "46980" } }, @@ -524,25 +430,34 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "inv_item_sk = i_item_sk", - "Estimated Cardinality": "46980" + "Estimated Cardinality": "9396" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-05-25 <= $.d_date <= 2000-07-24)", + "(2450815i64 <= $.d_date_sk <= 2452635i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "37644552" + "Conditions": "inv_date_sk = d_date_sk", + "Estimated Cardinality": "9396" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3" - ], - "Estimated Cardinality": "37644552" + "Join Type": "INNER", + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "1505782" } } ], @@ -552,7 +467,7 @@ physical_plan [ "i_item_desc", "i_current_price" ], - "Estimated Cardinality": "37644552" + "Estimated Cardinality": "1505782" } } ], @@ -563,13 +478,14 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "24884920" + "Estimated Cardinality": "1479176" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.item.i_item_id ASC" + "Order By": "i_item_id ASC", + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q83.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q83.slt.no index 75d9f1b043a..9471bd67671 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q83.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q83.slt.no @@ -1096,8 +1096,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sr_items.item_id", - "sr_items.sr_item_qty" + "item_id", + "sr_item_qty" ] } } @@ -1139,22 +1139,40 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450821i64 <= $.d_date_sk <= 2452820i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -1162,40 +1180,6 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_returned_date_sk", - "sr_item_sk", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450821i64 <= $.d_date_sk <= 2452820i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], "Estimated Cardinality": "73049" } }, @@ -1203,591 +1187,338 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_week_seq", + "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_week_seq = #0)", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": "d_date", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "SEMI", - "Conditions": "(d_date = #0)", + "Conditions": "(d_week_seq = #0)", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Expressions": "d_date", "Estimated Cardinality": "14609" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(sr_item_sk = i_item_sk)", + "Join Type": "SEMI", + "Conditions": "(d_date = #0)", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(sr_return_quantity)", - "Estimated Cardinality": "11437" + "Join Type": "INNER", + "Conditions": "(sr_returned_date_sk = d_date_sk)", + "Estimated Cardinality": "5715" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" } } ], "extra_info": { - "Expressions": [ - "item_id", - "sr_item_qty" - ], - "Estimated Cardinality": "11437" + "Join Type": "INNER", + "Conditions": "(sr_item_sk = i_item_sk)", + "Estimated Cardinality": "5715" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "11437" + "Groups": "i_item_id", + "Expressions": "sum(sr_return_quantity)", + "Estimated Cardinality": "1724" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450852i64 <= $.d_date_sk <= 2452907i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(d_date_sk = cr_returned_date_sk)", + "Estimated Cardinality": "14275" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_returned_date_sk", - "cr_item_sk", - "cr_return_quantity" - ], - "Estimated Cardinality": "14275" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cr_item_sk = i_item_sk)", - "Estimated Cardinality": "14275" - } - }, - { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450852i64 <= $.d_date_sk <= 2452907i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_week_seq = #0)", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date", + "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_date = #0)", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(cr_returned_date_sk = d_date_sk)", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450852)" - ], + "Join Type": "SEMI", + "Conditions": "(d_week_seq = #0)", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(cr_return_quantity)", - "Estimated Cardinality": "9144" + "Expressions": "d_date", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "9144" + "Join Type": "SEMI", + "Conditions": "(d_date = #0)", + "Estimated Cardinality": "2855" } } ], "extra_info": { - "Expressions": [ - "item_id", - "cr_item_qty" - ], - "Estimated Cardinality": "9144" + "Join Type": "INNER", + "Conditions": "(i_item_sk = cr_item_sk)", + "Estimated Cardinality": "2855" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "9144" + "Groups": "i_item_id", + "Expressions": "sum(cr_return_quantity)", + "Estimated Cardinality": "1431" } }, { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(2450865i64 <= $.d_date_sk <= 2452974i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "73049" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_week_seq = #0)", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date", + "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(d_date = #0)", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Expressions": [ - "wr_returned_date_sk", - "wr_item_sk", - "wr_return_quantity" - ], - "Estimated Cardinality": "7037" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id" - ], - "Estimated Cardinality": "1800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(wr_item_sk = i_item_sk)", - "Estimated Cardinality": "7037" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_date_sk = wr_returned_date_sk)", + "Expressions": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 2450865)", - "#1", - "#2" - ], + "Join Type": "SEMI", + "Conditions": "(d_week_seq = #0)", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": "i_item_id", - "Expressions": "sum(wr_return_quantity)", - "Estimated Cardinality": "6154" + "Expressions": "d_date", + "Estimated Cardinality": "14609" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(2450865i64 <= $.d_date_sk <= 2452974i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "73049" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(d_date_sk = wr_returned_date_sk)", + "Estimated Cardinality": "7037" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "6154" + "Join Type": "RIGHT_SEMI", + "Conditions": "(#0 = d_date)", + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expressions": [ - "item_id", - "wr_item_qty" - ], - "Estimated Cardinality": "6154" + "Join Type": "INNER", + "Conditions": "(i_item_sk = wr_item_sk)", + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "6154" + "Groups": "i_item_id", + "Expressions": "sum(wr_return_quantity)", + "Estimated Cardinality": "976" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(item_id = item_id)", - "Estimated Cardinality": "7996" + "Estimated Cardinality": "775" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(item_id = item_id)", - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], @@ -1799,7 +1530,7 @@ logical_opt [ "cr_item_qty", "wr_item_qty" ], - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], @@ -1814,7 +1545,7 @@ logical_opt [ "wr_dev", "average" ], - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], @@ -1921,7 +1652,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "sr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "5715" } }, { @@ -1940,7 +1671,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "sr_item_sk = i_item_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "5715" } } ], @@ -1949,14 +1680,14 @@ physical_plan [ "i_item_id", "sr_return_quantity" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "5715" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "11437" + "Estimated Cardinality": "1724" } }, { @@ -1969,8 +1700,20 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, { "name": "HASH_JOIN", "children": [ @@ -1982,12 +1725,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(2450852i64 <= $.d_date_sk <= 2452907i64)", "Projections": [ - "cr_returned_date_sk", - "cr_item_sk", - "cr_return_quantity" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "14275" + "Estimated Cardinality": "73049" } }, { @@ -1996,16 +1739,17 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_item_id" + "cr_returned_date_sk", + "cr_item_sk", + "cr_return_quantity" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "14275" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cr_item_sk = i_item_sk", + "Conditions": "d_date_sk = cr_returned_date_sk", "Estimated Cardinality": "14275" } }, @@ -2017,68 +1761,42 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450852i64 <= $.d_date_sk <= 2452907i64)", "Projections": [ - "d_date_sk", - "d_date" + "d_date", + "d_week_seq" ], "Estimated Cardinality": "73049" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", - "Projections": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "d_week_seq = #0", + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", + "Projections": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "SEMI", - "Conditions": "d_date = #0", + "Conditions": "d_week_seq = #0", "Estimated Cardinality": "14609" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "cr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "SEMI", + "Conditions": "d_date = #0", + "Estimated Cardinality": "2855" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "__internal_compress_integral_usmallint(#2, 2450852)" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "i_item_sk = cr_item_sk", + "Estimated Cardinality": "2855" } } ], @@ -2087,14 +1805,14 @@ physical_plan [ "i_item_id", "cr_return_quantity" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "2855" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "9144" + "Estimated Cardinality": "1431" } }, { @@ -2104,8 +1822,20 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_item_id" + ], + "Estimated Cardinality": "1800" + } + }, { "name": "HASH_JOIN", "children": [ @@ -2117,50 +1847,27 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(2450865i64 <= $.d_date_sk <= 2452974i64)", "Projections": [ - "d_date_sk", - "d_date" + "d_date", + "d_week_seq" ], "Estimated Cardinality": "73049" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "d_date", - "d_week_seq" - ], - "Estimated Cardinality": "73049" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", - "Projections": "d_week_seq", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "SEMI", - "Conditions": "d_week_seq = #0", + "Function": "Vortex Scan", + "Filters": "vortex.list.contains([2000-06-30, 2000-09-27, 2000-11-17], $.d_date, opts=sql_null_semantics)", + "Projections": "d_week_seq", "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "SEMI", - "Conditions": "d_date = #0", + "Conditions": "d_week_seq = #0", "Estimated Cardinality": "14609" } }, @@ -2172,12 +1879,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(2450865i64 <= $.d_date_sk <= 2452974i64)", "Projections": [ - "wr_returned_date_sk", - "wr_item_sk", - "wr_return_quantity" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "7037" + "Estimated Cardinality": "73049" } }, { @@ -2186,34 +1893,32 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_item_id" + "wr_returned_date_sk", + "wr_item_sk", + "wr_return_quantity" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "7037" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "wr_item_sk = i_item_sk", + "Conditions": "d_date_sk = wr_returned_date_sk", "Estimated Cardinality": "7037" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "d_date_sk = wr_returned_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "RIGHT_SEMI", + "Conditions": "#0 = d_date", + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 2450865)", - "#1", - "#2" - ], - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "i_item_sk = wr_item_sk", + "Estimated Cardinality": "1407" } } ], @@ -2222,28 +1927,28 @@ physical_plan [ "i_item_id", "wr_return_quantity" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "1407" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "6154" + "Estimated Cardinality": "976" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "item_id = item_id", - "Estimated Cardinality": "7996" + "Estimated Cardinality": "775" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "item_id = item_id", - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], @@ -2255,7 +1960,7 @@ physical_plan [ "cr_item_qty", "wr_item_qty" ], - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], @@ -2270,16 +1975,17 @@ physical_plan [ "wr_dev", "average" ], - "Estimated Cardinality": "12996" + "Estimated Cardinality": "743" } } ], "extra_info": { "Top": "100", "Order By": [ - "sr_items.item_id ASC", - "sr_items.sr_item_qty ASC" - ] + "item_id ASC", + "sr_item_qty ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q84.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q84.slt.no index 95cb87010ef..a5e9d5f93b6 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q84.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q84.slt.no @@ -269,7 +269,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.customer.c_customer_id" + "Order By": "customer_id" } } ], @@ -289,20 +289,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "cd_demo_sk", + "Filters": "(7i64 <= $.cd_demo_sk <= 192051i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "192080" } }, @@ -310,31 +301,22 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(7i64 <= $.sr_cdemo_sk <= 192051i64)", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "28576" + "Estimated Cardinality": "7200" } - } - ], - "extra_info": { - "Expressions": "sr_cdemo_sk", - "Estimated Cardinality": "28576" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -342,118 +324,72 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "7200" - } - } - ], - "extra_info": { - "Expressions": [ - "hd_demo_sk", - "hd_income_band_sk" - ], - "Estimated Cardinality": "7200" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_id", - "c_current_cdemo_sk", - "c_current_hdemo_sk", - "c_current_addr_sk", - "c_first_name", - "c_last_name" - ], "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_city = \"Edgewood\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "(7i64 <= $.sr_cdemo_sk <= 192051i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_current_addr_sk = ca_address_sk)", - "Estimated Cardinality": "2000" + "Conditions": "(c_current_cdemo_sk = sr_cdemo_sk)", + "Estimated Cardinality": "1487" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(hd_demo_sk = c_current_hdemo_sk)", - "Estimated Cardinality": "2000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.ib_lower_bound >= 38128i64)", - "($.ib_upper_bound <= 88128i32)" - ], + "Filters": "($.ca_city = \"Edgewood\")", "Function": "Vortex Scan", - "Estimated Cardinality": "4" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "ib_income_band_sk", - "Estimated Cardinality": "4" + "Join Type": "INNER", + "Conditions": "(c_current_addr_sk = ca_address_sk)", + "Estimated Cardinality": "297" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(hd_income_band_sk = ib_income_band_sk)", - "Estimated Cardinality": "2000" + "Conditions": "(hd_demo_sk = c_current_hdemo_sk)", + "Estimated Cardinality": "297" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.ib_lower_bound >= 38128i64)", + "($.ib_upper_bound <= 88128i32)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(sr_cdemo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "5715" + "Conditions": "(hd_income_band_sk = ib_income_band_sk)", + "Estimated Cardinality": "59" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "109777" + "Estimated Cardinality": "59" } } ], @@ -462,13 +398,13 @@ logical_opt [ "customer_id", "customername" ], - "Estimated Cardinality": "109777" + "Estimated Cardinality": "59" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "59" } } ] @@ -495,34 +431,24 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(7i64 <= $.sr_cdemo_sk <= 192051i64)", - "Projections": "sr_cdemo_sk", - "Estimated Cardinality": "28576" - } - }, { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "hd_demo_sk", + "hd_income_band_sk" + ], + "Estimated Cardinality": "7200" + } + }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "hd_demo_sk", - "hd_income_band_sk" - ], - "Estimated Cardinality": "7200" - } - }, { "name": "HASH_JOIN", "children": [ @@ -547,57 +473,67 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_city='Edgewood'", - "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "(7i64 <= $.sr_cdemo_sk <= 192051i64)", + "Projections": "sr_cdemo_sk", + "Estimated Cardinality": "28576" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_current_addr_sk = ca_address_sk", - "Estimated Cardinality": "2000" + "Conditions": "c_current_cdemo_sk = sr_cdemo_sk", + "Estimated Cardinality": "1487" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.ca_city = \"Edgewood\")", + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "hd_demo_sk = c_current_hdemo_sk", - "Estimated Cardinality": "2000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "($.ib_lower_bound >= 38128i64)", - "($.ib_upper_bound <= 88128i32)" - ], - "Projections": "ib_income_band_sk", - "Estimated Cardinality": "4" + "Conditions": "c_current_addr_sk = ca_address_sk", + "Estimated Cardinality": "297" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "hd_income_band_sk = ib_income_band_sk", - "Estimated Cardinality": "2000" + "Conditions": "hd_demo_sk = c_current_hdemo_sk", + "Estimated Cardinality": "297" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.ib_lower_bound >= 38128i64)", + "($.ib_upper_bound <= 88128i32)" + ], + "Projections": "ib_income_band_sk", + "Estimated Cardinality": "4" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "sr_cdemo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "5715" + "Conditions": "hd_income_band_sk = ib_income_band_sk", + "Estimated Cardinality": "59" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "cd_demo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "109777" + "Estimated Cardinality": "59" } } ], @@ -606,13 +542,14 @@ physical_plan [ "customer_id", "customername" ], - "Estimated Cardinality": "109777" + "Estimated Cardinality": "59" } } ], "extra_info": { "Top": "100", - "Order By": "memory.main.customer.c_customer_id ASC" + "Order By": "customer_id ASC", + "Estimated Cardinality": "59" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q85.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q85.slt.no index 088c9e2b058..8ba982fb5eb 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q85.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q85.slt.no @@ -443,10 +443,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "main.\"substring\"(memory.main.reason.r_reason_desc, 1, 20)", - "avg(memory.main.web_sales.ws_quantity)", - "avg(memory.main.web_returns.wr_refunded_cash)", - "avg(memory.main.web_returns.wr_fee)" + "\"substring\"(r_reason_desc, 1, 20)", + "avg1", + "avg2", + "avg(wr_fee)" ] } } @@ -464,240 +464,75 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "192080" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], - "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" - ], - "Estimated Cardinality": "192080" - } - }, - { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "192080" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Advanced Degree\")) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\"))) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"2 yr Degree\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"S\")) or ($.cd_marital_status = \"W\"))", + "((($.cd_education_status = \"Advanced Degree\") or ($.cd_education_status = \"College\")) or ($.cd_education_status = \"2 yr Degree\"))", + "(19i64 <= $.cd_demo_sk <= 192069i64)" ], - "Estimated Cardinality": "192080" + "Function": "Vortex Scan", + "Estimated Cardinality": "38416" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_web_page_sk", - "ws_order_number", - "ws_quantity", - "ws_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 2000i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "14322" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" - } - } - ], - "extra_info": { - "Expressions": [ - "wr_item_sk", - "wr_refunded_cdemo_sk", - "wr_refunded_addr_sk", - "wr_returning_cdemo_sk", - "wr_reason_sk", - "wr_order_number", - "wr_fee", - "wr_refunded_cash" - ], - "Estimated Cardinality": "7037" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_country = \"United States\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(wr_refunded_addr_sk = ca_address_sk)", - "Estimated Cardinality": "1407" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Expressions": [ - "r_reason_sk", - "r_reason_desc" - ], - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(wr_reason_sk = r_reason_sk)", - "Estimated Cardinality": "1407" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ws_item_sk = wr_item_sk)", - "(ws_order_number = wr_order_number)" - ], - "Estimated Cardinality": "2864" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "((((ws_net_profit >= 100.00) AND (ws_net_profit <= 200.00)) AND ((ca_state = 'IN') OR (ca_state = 'OH') OR (ca_state = 'NJ'))) OR (((ws_net_profit >= 150.00) AND (ws_net_profit <= 300.00)) AND ((ca_state = 'WI') OR (ca_state = 'CT') OR (ca_state = 'KY'))) OR (((ws_net_profit >= 50.00) AND (ws_net_profit <= 250.00)) AND ((ca_state = 'LA') OR (ca_state = 'IA') OR (ca_state = 'AR'))))", - "Estimated Cardinality": "2864" + "Filters": [ + "(((($.ws_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ws_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ws_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(20000, precision=7, scale=2))))", + "(((($.ws_net_profit >= decimal128(10000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(20000, precision=7, scale=2))) or (($.ws_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(30000, precision=7, scale=2)))) or (($.ws_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(25000, precision=7, scale=2))))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14326" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -705,80 +540,108 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "6" + "Estimated Cardinality": "7037" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "((vortex.list.contains([\"IN\", \"OH\", \"NJ\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"WI\", \"CT\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"LA\", \"IA\", \"AR\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "wp_web_page_sk", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "(wr_refunded_addr_sk = ca_address_sk)", + "Estimated Cardinality": "1407" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_web_page_sk = wp_web_page_sk)", - "Estimated Cardinality": "2864" + "Conditions": [ + "(ws_item_sk = wr_item_sk)", + "(ws_order_number = wr_order_number)", + "((((ws_net_profit >= 100.00) AND (ws_net_profit <= 200.00)) AND (ca_state IN ('IN', 'OH', 'NJ'))) OR (((ws_net_profit >= 150.00) AND (ws_net_profit <= 300.00)) AND (ca_state IN ('WI', 'CT', 'KY'))) OR (((ws_net_profit >= 50.00) AND (ws_net_profit <= 250.00)) AND (ca_state IN ('LA', 'IA', 'AR'))))" + ], + "Estimated Cardinality": "573" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cd_demo_sk = wr_refunded_cdemo_sk)", - "Estimated Cardinality": "78188" + "Conditions": [ + "(cd_demo_sk = wr_refunded_cdemo_sk)", + "((((ws_sales_price >= 100.00) AND (ws_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR (((ws_sales_price >= 50.00) AND (ws_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR (((ws_sales_price >= 150.00) AND (ws_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))" + ], + "Estimated Cardinality": "114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "3" } } ], "extra_info": { - "Expressions": "((((ws_sales_price >= 100.00) AND (ws_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR (((ws_sales_price >= 50.00) AND (ws_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR (((ws_sales_price >= 150.00) AND (ws_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))", - "Estimated Cardinality": "78188" + "Join Type": "INNER", + "Conditions": "(wr_reason_sk = r_reason_sk)", + "Estimated Cardinality": "114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "6" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(cd_demo_sk = wr_returning_cdemo_sk)", - "(cd_education_status = cd_education_status)", - "(cd_marital_status = cd_marital_status)" - ], - "Estimated Cardinality": "78188" + "Conditions": "(ws_web_page_sk = wp_web_page_sk)", + "Estimated Cardinality": "114" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_uinteger(#0, 19)", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "78188" + "Join Type": "INNER", + "Conditions": "(d_date_sk = ws_sold_date_sk)", + "Estimated Cardinality": "114" } } ], "extra_info": { - "Groups": "r_reason_desc", - "Expressions": [ - "avg(ws_quantity)", - "avg(wr_refunded_cash)", - "avg(wr_fee)" + "Join Type": "INNER", + "Conditions": [ + "(cd_demo_sk = wr_returning_cdemo_sk)", + "(cd_education_status = cd_education_status)", + "(cd_marital_status = cd_marital_status)" ], - "Estimated Cardinality": "47584" + "Estimated Cardinality": "114" } } ], "extra_info": { + "Groups": "r_reason_desc", "Expressions": [ - "#0", - "#1", - "#2", - "#3" + "avg(ws_quantity)", + "avg(wr_refunded_cash)", + "avg(wr_fee)" ], - "Estimated Cardinality": "47584" + "Estimated Cardinality": "3" } } ], @@ -789,13 +652,13 @@ logical_opt [ "avg2", "avg(wr_fee)" ], - "Estimated Cardinality": "47584" + "Estimated Cardinality": "3" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "3" } } ] @@ -813,8 +676,22 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", + "Projections": [ + "cd_demo_sk", + "cd_marital_status", + "cd_education_status" + ], + "Estimated Cardinality": "192080" + } + }, { "name": "HASH_JOIN", "children": [ @@ -823,20 +700,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", - "Projections": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" + "Filters": [ + "($.d_year = 2000i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "192080" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } }, { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", @@ -846,224 +722,160 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "(19i64 <= $.cd_demo_sk <= 192069i64)", + "Filters": [ + "(((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Advanced Degree\")) or (($.cd_marital_status = \"S\") and ($.cd_education_status = \"College\"))) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"2 yr Degree\")))", + "((($.cd_marital_status = \"M\") or ($.cd_marital_status = \"S\")) or ($.cd_marital_status = \"W\"))", + "((($.cd_education_status = \"Advanced Degree\") or ($.cd_education_status = \"College\")) or ($.cd_education_status = \"2 yr Degree\"))", + "(19i64 <= $.cd_demo_sk <= 192069i64)" + ], "Projections": [ "cd_demo_sk", "cd_marital_status", "cd_education_status" ], - "Estimated Cardinality": "192080" + "Estimated Cardinality": "38416" } }, { "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_web_page_sk", - "ws_order_number", - "ws_quantity", - "ws_sales_price", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "d_year=2000", - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "14322" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "wr_item_sk", - "wr_refunded_cdemo_sk", - "wr_refunded_addr_sk", - "wr_returning_cdemo_sk", - "wr_reason_sk", - "wr_order_number", - "wr_fee", - "wr_refunded_cash" - ], - "Estimated Cardinality": "7037" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_country='United States'", - "Projections": [ - "ca_address_sk", - "ca_state" - ], - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "wr_refunded_addr_sk = ca_address_sk", - "Estimated Cardinality": "1407" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "r_reason_sk", - "r_reason_desc" - ], - "Estimated Cardinality": "3" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "wr_reason_sk = r_reason_sk", - "Estimated Cardinality": "1407" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ws_item_sk = wr_item_sk", - "ws_order_number = wr_order_number" - ], - "Estimated Cardinality": "2864" - } - } - ], - "extra_info": { - "Expression": "((((ws_net_profit >= 100.00) AND (ws_net_profit <= 200.00)) AND ((ca_state = 'IN') OR (ca_state = 'OH') OR (ca_state = 'NJ'))) OR (((ws_net_profit >= 150.00) AND (ws_net_profit <= 300.00)) AND ((ca_state = 'WI') OR (ca_state = 'CT') OR (ca_state = 'KY'))) OR (((ws_net_profit >= 50.00) AND (ws_net_profit <= 250.00)) AND ((ca_state = 'LA') OR (ca_state = 'IA') OR (ca_state = 'AR'))))", - "Estimated Cardinality": "2864" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((($.ws_sales_price >= decimal128(10000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(15000, precision=7, scale=2))) or (($.ws_sales_price >= decimal128(5000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(10000, precision=7, scale=2)))) or (($.ws_sales_price >= decimal128(15000, precision=7, scale=2)) and ($.ws_sales_price <= decimal128(20000, precision=7, scale=2))))", + "(((($.ws_net_profit >= decimal128(10000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(20000, precision=7, scale=2))) or (($.ws_net_profit >= decimal128(15000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(30000, precision=7, scale=2)))) or (($.ws_net_profit >= decimal128(5000, precision=7, scale=2)) and ($.ws_net_profit <= decimal128(25000, precision=7, scale=2))))" + ], "Projections": [ - "#0", - "#1", - "#2", - "#4", - "#5", - "#6", - "#7", - "#9" + "ws_sold_date_sk", + "ws_item_sk", + "ws_web_page_sk", + "ws_order_number", + "ws_quantity", + "ws_sales_price", + "ws_net_profit" ], - "Estimated Cardinality": "2864" + "Estimated Cardinality": "14326" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "wr_item_sk", + "wr_refunded_cdemo_sk", + "wr_refunded_addr_sk", + "wr_returning_cdemo_sk", + "wr_reason_sk", + "wr_order_number", + "wr_fee", + "wr_refunded_cash" + ], + "Estimated Cardinality": "7037" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "((vortex.list.contains([\"IN\", \"OH\", \"NJ\"], $.ca_state, opts=sql_null_semantics) or vortex.list.contains([\"WI\", \"CT\", \"KY\"], $.ca_state, opts=sql_null_semantics)) or vortex.list.contains([\"LA\", \"IA\", \"AR\"], $.ca_state, opts=sql_null_semantics))", + "($.ca_country = \"United States\")" + ], + "Projections": [ + "ca_address_sk", + "ca_state" + ], + "Estimated Cardinality": "1000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": "wp_web_page_sk", - "Estimated Cardinality": "6" + "Join Type": "INNER", + "Conditions": "wr_refunded_addr_sk = ca_address_sk", + "Estimated Cardinality": "1407" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_page_sk = wp_web_page_sk", - "Estimated Cardinality": "2864" + "Conditions": [ + "ws_item_sk = wr_item_sk", + "ws_order_number = wr_order_number", + "((((ws_net_profit >= 100.00) AND (ws_net_profit <= 200.00)) AND (ca_state IN ('IN', 'OH', 'NJ'))) OR (((ws_net_profit >= 150.00) AND (ws_net_profit <= 300.00)) AND (ca_state IN ('WI', 'CT', 'KY'))) OR (((ws_net_profit >= 50.00) AND (ws_net_profit <= 250.00)) AND (ca_state IN ('LA', 'IA', 'AR'))))" + ], + "Estimated Cardinality": "573" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cd_demo_sk = wr_refunded_cdemo_sk", - "Estimated Cardinality": "78188" + "Conditions": [ + "cd_demo_sk = wr_refunded_cdemo_sk", + "((((ws_sales_price >= 100.00) AND (ws_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR (((ws_sales_price >= 50.00) AND (ws_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR (((ws_sales_price >= 150.00) AND (ws_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))" + ], + "Estimated Cardinality": "114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "r_reason_sk", + "r_reason_desc" + ], + "Estimated Cardinality": "3" } } ], "extra_info": { - "Expression": "((((ws_sales_price >= 100.00) AND (ws_sales_price <= 150.00)) AND (cd_marital_status = 'M') AND (cd_education_status = 'Advanced Degree')) OR (((ws_sales_price >= 50.00) AND (ws_sales_price <= 100.00)) AND (cd_marital_status = 'S') AND (cd_education_status = 'College')) OR (((ws_sales_price >= 150.00) AND (ws_sales_price <= 200.00)) AND (cd_marital_status = 'W') AND (cd_education_status = '2 yr Degree')))", - "Estimated Cardinality": "78188" + "Join Type": "INNER", + "Conditions": "wr_reason_sk = r_reason_sk", + "Estimated Cardinality": "114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "wp_web_page_sk", + "Estimated Cardinality": "6" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#4", - "#5", - "#6", - "#7" - ], - "Estimated Cardinality": "78188" + "Join Type": "INNER", + "Conditions": "ws_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "114" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "cd_demo_sk = wr_returning_cdemo_sk", - "cd_education_status = cd_education_status", - "cd_marital_status = cd_marital_status" - ], - "Estimated Cardinality": "78188" + "Conditions": "d_date_sk = ws_sold_date_sk", + "Estimated Cardinality": "114" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_uinteger(#0, 19)", - "#1", - "#2", - "#3", - "#4", - "#5", - "#6" + "Join Type": "INNER", + "Conditions": [ + "cd_demo_sk = wr_returning_cdemo_sk", + "cd_education_status = cd_education_status", + "cd_marital_status = cd_marital_status" ], - "Estimated Cardinality": "78188" + "Estimated Cardinality": "114" } } ], @@ -1074,7 +886,7 @@ physical_plan [ "wr_refunded_cash", "wr_fee" ], - "Estimated Cardinality": "78188" + "Estimated Cardinality": "114" } } ], @@ -1085,7 +897,7 @@ physical_plan [ "avg(#2)", "avg(#3)" ], - "Estimated Cardinality": "47584" + "Estimated Cardinality": "3" } } ], @@ -1096,18 +908,19 @@ physical_plan [ "avg2", "avg(wr_fee)" ], - "Estimated Cardinality": "47584" + "Estimated Cardinality": "3" } } ], "extra_info": { "Top": "100", "Order By": [ - "main.\"substring\"(memory.main.reason.r_reason_desc, 1, 20) ASC", - "avg(memory.main.web_sales.ws_quantity) ASC", - "avg(memory.main.web_returns.wr_refunded_cash) ASC", - "avg(memory.main.web_returns.wr_fee) ASC" - ] + "\"substring\"(r_reason_desc, 1, 20) ASC", + "avg1 ASC", + "avg2 ASC", + "avg(wr_fee) ASC" + ], + "Estimated Cardinality": "3" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q86.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q86.slt.no index d23dd83cdda..f1cce1f45a8 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q86.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q86.slt.no @@ -220,7 +220,7 @@ logical_plan [ } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = CAST(0 AS BIGINT))) THEN (i_category) ELSE CAST(NULL AS VARCHAR) END ORDER BY sum(ws_net_paid) DESC NULLS LAST)" + "Expressions": "rank() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = CAST(0 AS BIGINT))) THEN (i_category) ELSE CAST(NULL AS VARCHAR) END ORDER BY sum(ws_net_paid) DESC NULLS LAST)" } } ], @@ -238,9 +238,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "(GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class))", + "lochierarchy", "#[21.5]", - "rank() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (memory.main.item.i_category) ELSE NULL END ORDER BY sum(memory.main.web_sales.ws_net_paid) DESC)" + "rank_within_parent" ] } } @@ -275,39 +275,45 @@ logical_opt [ "name": "WINDOW", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1800" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_net_paid" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -322,60 +328,225 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" + "Groups": [ + "i_category", + "i_class" + ], + "Expressions": "sum(ws_net_paid) EXPORT_STATE", + "Estimated Cardinality": "35816" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "35816" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "35816" + } + } + ], + "extra_info": { + "Groups": "#0", + "Expressions": "combine_aggr(#2)", + "Estimated Cardinality": "17908" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1800" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "17908" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "17908" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "combine_aggr(#1)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "1", + "1", + "1", + "1", + "1", + "1", + "1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "17908" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "0", + "1", + "0", + "1", + "1", + "0", + "1" + ], + "Estimated Cardinality": "17908" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "35816" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "finalize(#2)", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "Estimated Cardinality": "35816" + } + } + ], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "53725" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_class", - "i_category" - ], - "Estimated Cardinality": "1800" + "CTE Name": "__grouping_sets_cte_33", + "Table Index": "33", + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "71632" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8", + "#9" + ], + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Groups": [ - "i_category", - "i_class" - ], - "Expressions": "sum(ws_net_paid)", - "Estimated Cardinality": "71631" + "CTE Name": "__grouping_sets_cte_29", + "Table Index": "29", + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Expressions": "RANK() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (i_category) ELSE NULL END ORDER BY sum(ws_net_paid) DESC NULLS LAST)", - "Estimated Cardinality": "71631" + "Expressions": "rank() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (i_category) ELSE NULL::VARCHAR END ORDER BY sum(ws_net_paid) DESC NULLS LAST)", + "Estimated Cardinality": "53725" } } ], @@ -386,9 +557,9 @@ logical_opt [ "i_class", "lochierarchy", "rank_within_parent", - "CASE WHEN (((GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)) = 0)) THEN (i_category) ELSE NULL END" + "CASE WHEN (((GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)) = 0)) THEN (i_category) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "53725" } } ], @@ -427,27 +598,50 @@ physical_plan [ "name": "WINDOW", "children": [ { - "name": "HASH_GROUP_BY", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_net_paid" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "i_item_sk", + "i_class", + "i_category" + ], + "Estimated Cardinality": "1800" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_net_paid" - ], + "Join Type": "INNER", + "Conditions": "ws_item_sk = i_item_sk", "Estimated Cardinality": "71632" } }, @@ -470,50 +664,188 @@ physical_plan [ "Conditions": "ws_sold_date_sk = d_date_sk", "Estimated Cardinality": "71632" } - }, + } + ], + "extra_info": { + "Projections": [ + "i_category", + "i_class", + "ws_net_paid" + ], + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Groups": [ + "#0", + "#1" + ], + "Aggregates": "sum(#2) EXPORT_STATE", + "Estimated Cardinality": "35816" + } + }, + { + "name": "CTE", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "35816" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "i_item_sk", - "i_class", - "i_category" + "#0", + "#2" ], - "Estimated Cardinality": "1800" + "Estimated Cardinality": "35816" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "71632" + "Groups": "#0", + "Aggregates": "combine_aggr(#1)", + "Estimated Cardinality": "17908" } + }, + { + "name": "UNION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "17908" + } + } + ], + "extra_info": { + "Projections": "#1", + "Estimated Cardinality": "17908" + } + } + ], + "extra_info": { + "Aggregates": "combine_aggr(#0)", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": [ + "NULL::VARCHAR", + "NULL::VARCHAR", + "finalize(#0)", + "1", + "1", + "1", + "1", + "1", + "1", + "1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "33", + "Estimated Cardinality": "17908" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "NULL::VARCHAR", + "finalize(#1)", + "0", + "1", + "0", + "1", + "1", + "0", + "1" + ], + "Estimated Cardinality": "17908" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "29", + "Estimated Cardinality": "35816" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "finalize(#2)", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "Estimated Cardinality": "35816" + } + } + ], + "extra_info": {} } ], "extra_info": { - "Projections": [ - "i_category", - "i_class", - "ws_net_paid" - ], - "Estimated Cardinality": "71632" + "CTE Name": "__grouping_sets_cte_33", + "Table Index": "33", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "sum(#2)", - "Estimated Cardinality": "71631" + "CTE Name": "__grouping_sets_cte_29", + "Table Index": "29", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "53725" } } ], "extra_info": { - "Projections": "RANK() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (i_category) ELSE NULL END ORDER BY sum(ws_net_paid) DESC NULLS LAST)" + "Projections": "rank() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (i_category) ELSE NULL::VARCHAR END ORDER BY sum(ws_net_paid) DESC NULLS LAST)", + "Estimated Cardinality": "53725" } } ], @@ -531,7 +863,7 @@ physical_plan [ "#9", "#10" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "53725" } } ], @@ -542,19 +874,20 @@ physical_plan [ "i_class", "lochierarchy", "rank_within_parent", - "CASE WHEN (((GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)) = 0)) THEN (i_category) ELSE NULL END" + "CASE WHEN (((GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)) = 0)) THEN (i_category) ELSE NULL::VARCHAR END" ], - "Estimated Cardinality": "71631" + "Estimated Cardinality": "53725" } } ], "extra_info": { "Top": "100", "Order By": [ - "(GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)) DESC", + "lochierarchy DESC", "#5 ASC", - "rank() OVER (PARTITION BY (GROUPING(memory.main.item.i_category) + GROUPING(memory.main.item.i_class)), CASE WHEN ((GROUPING(memory.main.item.i_class) = 0)) THEN (memory.main.item.i_category) ELSE NULL END ORDER BY sum(memory.main.web_sales.ws_net_paid) DESC) ASC" - ] + "rank_within_parent ASC" + ], + "Estimated Cardinality": "100" } } ], diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q87.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q87.slt.no index 6f895332c28..089b48bff8e 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q87.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q87.slt.no @@ -650,13 +650,13 @@ logical_opt [ "name": "DISTINCT", "children": [ { - "name": "EXCEPT", + "name": "PROJECTION", "children": [ { - "name": "DISTINCT", + "name": "EXCEPT", "children": [ { - "name": "EXCEPT", + "name": "PROJECTION", "children": [ { "name": "DISTINCT", @@ -665,113 +665,228 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "EXCEPT", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", + "name": "DISTINCT", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_customer_sk = c_customer_sk)", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" + } + } + ], "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Expressions": [ + "c_last_name", + "c_first_name", + "d_date" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ - "d_date_sk", + "Expressions": "", + "Estimated Cardinality": "288463", + "Distinct Targets": [ + "c_last_name", + "c_first_name", "d_date" - ], - "Estimated Cardinality": "14609" + ] } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "288463" } }, { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "DISTINCT", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "10000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_bill_customer_sk = c_customer_sk)", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" + } + } + ], + "extra_info": { + "Expressions": [ + "c_last_name", + "c_first_name", + "d_date" + ], + "Estimated Cardinality": "143657" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Expressions": "", + "Estimated Cardinality": "143656", + "Distinct Targets": [ + "c_last_name", + "c_first_name", + "d_date" + ] } } ], "extra_info": { "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "143656" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_customer_sk = c_customer_sk)", - "Estimated Cardinality": "288464" + "Expressions": "", + "Estimated Cardinality": "288463" } } ], "extra_info": { "Expressions": [ - "c_last_name", - "c_first_name", - "d_date" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "288464", + "Estimated Cardinality": "288462", "Distinct Targets": [ "c_last_name", "c_first_name", "d_date" ] } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "288462" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "DISTINCT", "children": [ @@ -785,60 +900,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk" - ], - "Estimated Cardinality": "143657" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -850,95 +919,11 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_first_name", - "c_last_name" - ], - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "c_last_name", - "c_first_name", - "d_date" - ], - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "143657", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "288464", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] - } - }, - { - "name": "DISTINCT", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(ws_bill_customer_sk = c_customer_sk)", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_bill_customer_sk" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -953,80 +938,62 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "d_date_sk", - "d_date" - ], - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "71632" } } ], "extra_info": { "Expressions": [ - "c_customer_sk", + "c_last_name", "c_first_name", - "c_last_name" + "d_date" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "71632" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_bill_customer_sk = c_customer_sk)", - "Estimated Cardinality": "71632" + "Expressions": "", + "Estimated Cardinality": "71631", + "Distinct Targets": [ + "c_last_name", + "c_first_name", + "d_date" + ] } } ], "extra_info": { "Expressions": [ - "c_last_name", - "c_first_name", - "d_date" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "71632" + "Estimated Cardinality": "71631" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "71632", - "Distinct Targets": [ - "c_last_name", - "c_first_name", - "d_date" - ] + "Estimated Cardinality": "288462" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "288464" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "288462" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "288464", + "Estimated Cardinality": "288461", "Distinct Targets": [ "c_last_name", "c_first_name", @@ -1108,21 +1075,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_date" + "c_customer_sk", + "c_first_name", + "c_last_name" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Conditions": "ss_customer_sk = c_customer_sk", "Estimated Cardinality": "288464" } }, @@ -1131,18 +1095,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "c_customer_sk", - "c_first_name", - "c_last_name" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_customer_sk = c_customer_sk", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } } @@ -1209,21 +1176,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], "Projections": [ - "d_date_sk", - "d_date" + "c_customer_sk", + "c_first_name", + "c_last_name" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", + "Conditions": "cs_bill_customer_sk = c_customer_sk", "Estimated Cardinality": "143657" } }, @@ -1232,18 +1196,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], "Projections": [ - "c_customer_sk", - "c_first_name", - "c_last_name" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_bill_customer_sk = c_customer_sk", + "Conditions": "cs_sold_date_sk = d_date_sk", "Estimated Cardinality": "143657" } } @@ -1286,7 +1253,7 @@ physical_plan [ "#1 IS NOT DISTINCT FROM #1", "#2 IS NOT DISTINCT FROM #2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], @@ -1297,7 +1264,7 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], @@ -1307,7 +1274,7 @@ physical_plan [ "c_first_name", "d_date" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } } ], @@ -1318,7 +1285,7 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288463" } }, { @@ -1353,21 +1320,18 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], "Projections": [ - "d_date_sk", - "d_date" + "c_customer_sk", + "c_first_name", + "c_last_name" ], - "Estimated Cardinality": "14609" + "Estimated Cardinality": "10000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Conditions": "ws_bill_customer_sk = c_customer_sk", "Estimated Cardinality": "71632" } }, @@ -1376,18 +1340,21 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Projections": [ - "c_customer_sk", - "c_first_name", - "c_last_name" + "d_date_sk", + "d_date" ], - "Estimated Cardinality": "10000" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_bill_customer_sk = c_customer_sk", + "Conditions": "ws_sold_date_sk = d_date_sk", "Estimated Cardinality": "71632" } } @@ -1430,7 +1397,7 @@ physical_plan [ "#1 IS NOT DISTINCT FROM #1", "#2 IS NOT DISTINCT FROM #2" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288462" } } ], @@ -1441,7 +1408,7 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288462" } } ], @@ -1451,7 +1418,7 @@ physical_plan [ "c_first_name", "d_date" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288462" } } ], @@ -1462,12 +1429,13 @@ physical_plan [ "#2" ], "Aggregates": "", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "288462" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q88.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q88.slt.no index 2b3e030a88a..0b70e23a7e5 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q88.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q88.slt.no @@ -1794,59 +1794,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 11i64)", - "($.t_minute >= 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -1862,29 +1817,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 11i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -1916,59 +1887,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 12i64)", - "($.t_minute < 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -1984,29 +1910,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 12i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2044,59 +1986,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 11i64)", - "($.t_minute < 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2112,29 +2009,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 11i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2172,59 +2085,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 10i64)", - "($.t_minute >= 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2240,29 +2108,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 10i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2300,59 +2184,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 10i64)", - "($.t_minute < 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2368,29 +2207,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 10i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2428,59 +2283,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 9i64)", - "($.t_minute >= 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2496,29 +2306,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 9i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2556,59 +2382,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 9i64)", - "($.t_minute < 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2624,29 +2405,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 9i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2678,65 +2475,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 8i64)", - "($.t_minute >= 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "57692" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -2752,29 +2504,45 @@ logical_opt [ } ], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Join Type": "INNER", + "Conditions": "(ss_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.t_hour = 8i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "57692" + "Conditions": "(ss_sold_time_sk = t_time_sk)", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], @@ -2867,15 +2635,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=11", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -2885,36 +2657,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 11i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } }, { @@ -2947,15 +2725,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=12", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -2965,36 +2747,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 12i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3030,15 +2818,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=11", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3048,36 +2840,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 11i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3113,15 +2911,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=10", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3131,36 +2933,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 10i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3196,15 +3004,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=10", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3214,36 +3026,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 10i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3279,15 +3097,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=9", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3297,36 +3119,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 9i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3362,15 +3190,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=9", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3380,36 +3212,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 9i64)", + "($.t_minute < 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -3445,15 +3283,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=8", - "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", + "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", + "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + ], + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_time_sk = t_time_sk", + "Conditions": "ss_hdemo_sk = hd_demo_sk", "Estimated Cardinality": "57692" } }, @@ -3463,36 +3305,42 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(((($.hd_dep_count = 4i64) and ($.hd_vehicle_count <= 6i32)) or (($.hd_dep_count = 2i64) and ($.hd_vehicle_count <= 4i32))) or (($.hd_dep_count = 0i64) and ($.hd_vehicle_count <= 2i32)))", - "((($.hd_dep_count = 4i64) or ($.hd_dep_count = 2i64)) or ($.hd_dep_count = 0i64))", - "((($.hd_vehicle_count <= 6i32) or ($.hd_vehicle_count <= 4i32)) or ($.hd_vehicle_count <= 2i32))" + "($.t_hour = 8i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" ], - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "57692" + "Conditions": "ss_sold_time_sk = t_time_sk", + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57692" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q89.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q89.slt.no index 4e6279f2708..91bf3c5f634 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q89.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q89.slt.no @@ -312,7 +312,7 @@ logical_plan [ "extra_info": { "Order By": [ "#[34.8]", - "tmp1.s_store_name", + "s_store_name", "i_category", "i_class", "i_brand", @@ -357,19 +357,19 @@ logical_opt [ "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "WINDOW", "children": [ { - "name": "WINDOW", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -378,94 +378,14 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_store_sk", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.d_year = 1999i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "2921" - } - } - ], - "extra_info": { - "Expressions": [ - "d_date_sk", - "d_moy" - ], - "Estimated Cardinality": "2921" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "57677" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": [ - "s_store_sk", - "s_store_name", - "s_company_name" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "57677" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -481,89 +401,98 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "i_item_sk", - "i_brand", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "57677" + "Conditions": "(ss_store_sk = s_store_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "#0", - "__internal_compress_integral_utinyint(#1, 1)", - "#2", - "#3", - "#4", - "#5", - "#6" - ], - "Estimated Cardinality": "57677" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": [ - "i_category", - "i_class", - "i_brand", - "s_store_name", - "s_company_name", - "d_moy" + "Expressions": [ + "#1", + "#2", + "#3", + "#0", + "#4", + "#5", + "CAST(#6 AS TINYINT)" ], - "Expressions": "sum(ss_sales_price)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "__internal_decompress_integral_bigint(#5, 1)", - "#6" + "Groups": [ + "i_category", + "i_class", + "i_brand", + "s_store_name", + "s_company_name", + "d_moy" ], - "Estimated Cardinality": "57677" + "Expressions": "sum(ss_sales_price)", + "Estimated Cardinality": "57688" } } ], "extra_info": { - "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name)", - "Estimated Cardinality": "57677" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "CAST(#5 AS BIGINT)", + "#6" + ], + "Estimated Cardinality": "57688" } } ], "extra_info": { - "Expressions": [ - "i_category", - "i_class", - "i_brand", - "s_store_name", - "s_company_name", - "d_moy", - "sum_sales", - "avg_monthly_sales" - ], - "Estimated Cardinality": "57677" + "Expressions": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name)", + "Estimated Cardinality": "57688" } } ], "extra_info": { - "Expressions": "(CASE WHEN ((avg_monthly_sales != 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "57677" + "Expressions": "(CASE WHEN ((avg_monthly_sales != 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "11537" } } ], @@ -579,7 +508,7 @@ logical_opt [ "avg_monthly_sales", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "11537" } } ], @@ -663,19 +592,25 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "d_year=1999", + "Filters": [ + "((vortex.list.contains([\"Books\", \"Electronics\", \"Sports\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"computers\", \"stereo\", \"football\"], $.i_class, opts=sql_null_semantics)) or (vortex.list.contains([\"Men\", \"Jewelry\", \"Women\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"shirts\", \"birdal\", \"dresses\"], $.i_class, opts=sql_null_semantics)))", + "(vortex.list.contains([\"Books\", \"Electronics\", \"Sports\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Men\", \"Jewelry\", \"Women\"], $.i_category, opts=sql_null_semantics))", + "(vortex.list.contains([\"computers\", \"stereo\", \"football\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"shirts\", \"birdal\", \"dresses\"], $.i_class, opts=sql_null_semantics))" + ], "Projections": [ - "d_date_sk", - "d_moy" + "i_item_sk", + "i_brand", + "i_class", + "i_category" ], - "Estimated Cardinality": "2921" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" } }, { @@ -695,7 +630,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } }, { @@ -704,38 +639,35 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "((vortex.list.contains([\"Books\", \"Electronics\", \"Sports\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"computers\", \"stereo\", \"football\"], $.i_class, opts=sql_null_semantics)) or (vortex.list.contains([\"Men\", \"Jewelry\", \"Women\"], $.i_category, opts=sql_null_semantics) and vortex.list.contains([\"shirts\", \"birdal\", \"dresses\"], $.i_class, opts=sql_null_semantics)))", - "(vortex.list.contains([\"Books\", \"Electronics\", \"Sports\"], $.i_category, opts=sql_null_semantics) or vortex.list.contains([\"Men\", \"Jewelry\", \"Women\"], $.i_category, opts=sql_null_semantics))", - "(vortex.list.contains([\"computers\", \"stereo\", \"football\"], $.i_class, opts=sql_null_semantics) or vortex.list.contains([\"shirts\", \"birdal\", \"dresses\"], $.i_class, opts=sql_null_semantics))" + "($.d_year = 1999i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], "Projections": [ - "i_item_sk", - "i_brand", - "i_class", - "i_category" + "d_date_sk", + "d_moy" ], - "Estimated Cardinality": "360" + "Estimated Cardinality": "14609" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", - "Estimated Cardinality": "57677" + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Projections": [ - "#0", - "__internal_compress_integral_utinyint(#1, 1)", + "#1", "#2", "#3", + "#0", "#4", "#5", - "#6" + "CAST(#6 AS TINYINT)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], @@ -749,7 +681,7 @@ physical_plan [ "d_moy", "ss_sales_price" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57692" } } ], @@ -763,7 +695,7 @@ physical_plan [ "#5" ], "Aggregates": "sum(#6)", - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57688" } } ], @@ -774,15 +706,16 @@ physical_plan [ "#2", "#3", "#4", - "__internal_decompress_integral_bigint(#5, 1)", + "CAST(#5 AS BIGINT)", "#6" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57688" } } ], "extra_info": { - "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name)" + "Projections": "avg(sum(ss_sales_price)) OVER (PARTITION BY i_category, i_brand, s_store_name, s_company_name)", + "Estimated Cardinality": "57688" } } ], @@ -797,13 +730,13 @@ physical_plan [ "#6", "#7" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "57688" } } ], "extra_info": { - "Expression": "(CASE WHEN ((avg_monthly_sales != 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL END > 0.1)", - "Estimated Cardinality": "57677" + "Expression": "(CASE WHEN ((avg_monthly_sales != 0.0)) THEN ((abs((CAST(sum_sales AS DOUBLE) - avg_monthly_sales)) / avg_monthly_sales)) ELSE NULL::DOUBLE END > 0.1)", + "Estimated Cardinality": "11537" } } ], @@ -819,7 +752,7 @@ physical_plan [ "avg_monthly_sales", "(CAST(sum_sales AS DOUBLE) - avg_monthly_sales)" ], - "Estimated Cardinality": "57677" + "Estimated Cardinality": "11537" } } ], @@ -827,7 +760,7 @@ physical_plan [ "Top": "100", "Order By": [ "#8 ASC", - "tmp1.s_store_name ASC", + "s_store_name ASC", "i_category ASC", "i_class ASC", "i_brand ASC", @@ -835,7 +768,8 @@ physical_plan [ "d_moy ASC", "sum_sales ASC", "avg_monthly_sales ASC" - ] + ], + "Estimated Cardinality": "100" } } ], diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q9.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q9.slt.no index d77172efed7..024c00207a7 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q9.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q9.slt.no @@ -148,204 +148,6 @@ logical_plan [ "Expressions": "(r_reason_sk = CAST(1 AS BIGINT))" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_sold_time_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_cdemo_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ticket_number", - "ss_quantity", - "ss_wholesale_cost", - "ss_list_price", - "ss_sales_price", - "ss_ext_discount_amt", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_ext_list_price", - "ss_ext_tax", - "ss_coupon_amt", - "ss_net_paid", - "ss_net_paid_inc_tax", - "ss_net_profit" - ] - } - } - ], - "extra_info": { - "Expressions": [ - "(ss_quantity >= CAST(1 AS BIGINT))", - "(ss_quantity <= CAST(20 AS BIGINT))" - ] - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": "count_star()" - } - } - ], - "extra_info": { - "Expressions": "count_star()" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[20.0])", - "count_star()" - ] - } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[208.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[208.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_sold_time_sk", - "ss_item_sk", - "ss_customer_sk", - "ss_cdemo_sk", - "ss_hdemo_sk", - "ss_addr_sk", - "ss_store_sk", - "ss_promo_sk", - "ss_ticket_number", - "ss_quantity", - "ss_wholesale_cost", - "ss_list_price", - "ss_sales_price", - "ss_ext_discount_amt", - "ss_ext_sales_price", - "ss_ext_wholesale_cost", - "ss_ext_list_price", - "ss_ext_tax", - "ss_coupon_amt", - "ss_net_paid", - "ss_net_paid_inc_tax", - "ss_net_profit" - ] - } - } - ], - "extra_info": { - "Expressions": [ - "(ss_quantity >= CAST(1 AS BIGINT))", - "(ss_quantity <= CAST(20 AS BIGINT))" - ] - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)" - } - } - ], - "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[33.0])", - "count_star()" - ] - } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[211.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[211.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ { "name": "PROJECTION", "children": [ @@ -406,42 +208,19 @@ logical_plan [ ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[46.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[214.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[214.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -494,50 +273,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(21 AS BIGINT))", - "(ss_quantity <= CAST(40 AS BIGINT))" + "(ss_quantity >= CAST(1 AS BIGINT))", + "(ss_quantity <= CAST(20 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[59.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[217.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[217.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -590,50 +346,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(21 AS BIGINT))", - "(ss_quantity <= CAST(40 AS BIGINT))" + "(ss_quantity >= CAST(1 AS BIGINT))", + "(ss_quantity <= CAST(20 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[72.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[220.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[220.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -694,42 +427,19 @@ logical_plan [ ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[85.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[223.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[223.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -782,50 +492,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(41 AS BIGINT))", - "(ss_quantity <= CAST(60 AS BIGINT))" + "(ss_quantity >= CAST(21 AS BIGINT))", + "(ss_quantity <= CAST(40 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[98.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[226.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[226.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -878,50 +565,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(41 AS BIGINT))", - "(ss_quantity <= CAST(60 AS BIGINT))" + "(ss_quantity >= CAST(21 AS BIGINT))", + "(ss_quantity <= CAST(40 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[111.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[229.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[229.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -982,42 +646,19 @@ logical_plan [ ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[124.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[232.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[232.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1070,50 +711,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(61 AS BIGINT))", - "(ss_quantity <= CAST(80 AS BIGINT))" + "(ss_quantity >= CAST(41 AS BIGINT))", + "(ss_quantity <= CAST(60 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[137.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[235.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[235.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1166,50 +784,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(61 AS BIGINT))", - "(ss_quantity <= CAST(80 AS BIGINT))" + "(ss_quantity >= CAST(41 AS BIGINT))", + "(ss_quantity <= CAST(60 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[150.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[238.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[238.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1270,42 +865,19 @@ logical_plan [ ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[163.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[241.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[241.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1358,50 +930,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(81 AS BIGINT))", - "(ss_quantity <= CAST(100 AS BIGINT))" + "(ss_quantity >= CAST(61 AS BIGINT))", + "(ss_quantity <= CAST(80 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Expressions": "count_star()" + "Expressions": "avg(ss_ext_discount_amt)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[176.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[244.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[244.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1454,50 +1003,27 @@ logical_plan [ ], "extra_info": { "Expressions": [ - "(ss_quantity >= CAST(81 AS BIGINT))", - "(ss_quantity <= CAST(100 AS BIGINT))" + "(ss_quantity >= CAST(61 AS BIGINT))", + "(ss_quantity <= CAST(80 AS BIGINT))" ] } } ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)" + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#[189.0])", - "count_star()" - ] + "Expressions": "" } - } - ], - "extra_info": { - "Expressions": [ - "CASE WHEN ((#[247.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[247.0] END" - ] - } - } - ], - "extra_info": { - "Expressions": "" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ + }, { "name": "PROJECTION", "children": [ @@ -1558,29 +1084,158 @@ logical_plan [ ], "extra_info": { "Groups": "", - "Expressions": "avg(ss_net_paid)" + "Expressions": "count_star()" + } + } + ], + "extra_info": { + "Expressions": "count_star()" + } + } + ], + "extra_info": { + "Expressions": "" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan" + } + } + ], + "extra_info": { + "Expressions": [ + "ss_sold_date_sk", + "ss_sold_time_sk", + "ss_item_sk", + "ss_customer_sk", + "ss_cdemo_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_promo_sk", + "ss_ticket_number", + "ss_quantity", + "ss_wholesale_cost", + "ss_list_price", + "ss_sales_price", + "ss_ext_discount_amt", + "ss_ext_sales_price", + "ss_ext_wholesale_cost", + "ss_ext_list_price", + "ss_ext_tax", + "ss_coupon_amt", + "ss_net_paid", + "ss_net_paid_inc_tax", + "ss_net_profit" + ] + } + } + ], + "extra_info": { + "Expressions": [ + "(ss_quantity >= CAST(81 AS BIGINT))", + "(ss_quantity <= CAST(100 AS BIGINT))" + ] + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": "avg(ss_ext_discount_amt)" + } + } + ], + "extra_info": { + "Expressions": "avg(ss_ext_discount_amt)" + } + } + ], + "extra_info": { + "Expressions": "" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan" + } + } + ], + "extra_info": { + "Expressions": [ + "ss_sold_date_sk", + "ss_sold_time_sk", + "ss_item_sk", + "ss_customer_sk", + "ss_cdemo_sk", + "ss_hdemo_sk", + "ss_addr_sk", + "ss_store_sk", + "ss_promo_sk", + "ss_ticket_number", + "ss_quantity", + "ss_wholesale_cost", + "ss_list_price", + "ss_sales_price", + "ss_ext_discount_amt", + "ss_ext_sales_price", + "ss_ext_wholesale_cost", + "ss_ext_list_price", + "ss_ext_tax", + "ss_coupon_amt", + "ss_net_paid", + "ss_net_paid_inc_tax", + "ss_net_profit" + ] } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)" + "Expressions": [ + "(ss_quantity >= CAST(81 AS BIGINT))", + "(ss_quantity <= CAST(100 AS BIGINT))" + ] } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#[202.0])", - "count_star()" - ] + "Expressions": "avg(ss_net_paid)" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#[250.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[250.0] END" - ] + "Expressions": "avg(ss_net_paid)" } } ], @@ -1620,61 +1275,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_ext_discount_amt", + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)", - "Estimated Cardinality": "1" + "Expressions": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)", + "Groups": "", + "Expressions": [ + "sum(ss_ext_discount_amt)", + "count(ss_ext_discount_amt)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_ext_discount_amt)", "Estimated Cardinality": "1" } }, @@ -1682,61 +1324,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_net_paid", + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Expressions": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Groups": "", + "Expressions": [ + "sum(ss_net_paid)", + "count(ss_net_paid)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_net_paid)", "Estimated Cardinality": "1" } } @@ -1759,55 +1388,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": "42", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } }, @@ -1815,61 +1419,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_ext_discount_amt", + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)", - "Estimated Cardinality": "1" + "Expressions": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)", + "Groups": "", + "Expressions": [ + "sum(ss_ext_discount_amt)", + "count(ss_ext_discount_amt)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_ext_discount_amt)", "Estimated Cardinality": "1" } } @@ -1895,61 +1486,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_net_paid", + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Expressions": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)", + "Groups": "", + "Expressions": [ + "sum(ss_net_paid)", + "count(ss_net_paid)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_net_paid)", "Estimated Cardinality": "1" } }, @@ -1963,55 +1541,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": "42", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } @@ -2028,61 +1581,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_ext_discount_amt", + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)", - "Estimated Cardinality": "1" + "Expressions": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)", + "Groups": "", + "Expressions": [ + "sum(ss_ext_discount_amt)", + "count(ss_ext_discount_amt)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_ext_discount_amt)", "Estimated Cardinality": "1" } }, @@ -2090,61 +1630,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_net_paid", + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Expressions": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)", + "Groups": "", + "Expressions": [ + "sum(ss_net_paid)", + "count(ss_net_paid)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_net_paid)", "Estimated Cardinality": "1" } } @@ -2185,55 +1712,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": "42", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } }, @@ -2241,61 +1743,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_ext_discount_amt", + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)", - "Estimated Cardinality": "1" + "Expressions": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)", + "Groups": "", + "Expressions": [ + "sum(ss_ext_discount_amt)", + "count(ss_ext_discount_amt)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_ext_discount_amt)", "Estimated Cardinality": "1" } } @@ -2312,61 +1801,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_net_paid", + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Expressions": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)", + "Groups": "", + "Expressions": [ + "sum(ss_net_paid)", + "count(ss_net_paid)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_net_paid)", "Estimated Cardinality": "1" } }, @@ -2380,55 +1856,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": "42", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } @@ -2454,61 +1905,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_ext_discount_amt", + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_ext_discount_amt)", - "Estimated Cardinality": "1" + "Expressions": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_ext_discount_amt)", + "Groups": "", + "Expressions": [ + "sum(ss_ext_discount_amt)", + "count(ss_ext_discount_amt)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_ext_discount_amt)", "Estimated Cardinality": "1" } }, @@ -2516,61 +1954,48 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ss_net_paid", + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "57692" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(ss_net_paid)", - "Estimated Cardinality": "1" + "Expressions": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "avg(ss_net_paid)", + "Groups": "", + "Expressions": [ + "sum(ss_net_paid)", + "count(ss_net_paid)" + ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "avg(ss_net_paid)", "Estimated Cardinality": "1" } } @@ -2593,55 +2018,30 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Expressions": "42", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": "", - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": "count_star()", - "Estimated Cardinality": "1" + "Expressions": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "count_star()", "Estimated Cardinality": "1" } }, @@ -2726,52 +2126,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Projections": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_ext_discount_amt", + "ss_ext_discount_amt" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } }, @@ -2785,52 +2169,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Projections": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_net_paid", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -2841,61 +2209,30 @@ physical_plan [ "name": "CROSS_PRODUCT", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Projections": "", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "42", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": "count_star()" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Projections": "", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Aggregates": "count_star()", "Estimated Cardinality": "1" } }, @@ -2909,52 +2246,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Projections": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_ext_discount_amt", + "ss_ext_discount_amt" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -2980,111 +2301,64 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(61i64 <= $.ss_quantity <= 80i64)", - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(61i64 <= $.ss_quantity <= 80i64)", + "Projections": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_net_paid", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } }, { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Projections": "", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "42", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": "count_star()" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Projections": "", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Aggregates": "count_star()", "Estimated Cardinality": "1" } } @@ -3104,52 +2378,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Projections": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_ext_discount_amt", + "ss_ext_discount_amt" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } }, @@ -3163,52 +2421,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(81i64 <= $.ss_quantity <= 100i64)", - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(81i64 <= $.ss_quantity <= 100i64)", + "Projections": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_net_paid", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -3231,61 +2473,30 @@ physical_plan [ "name": "CROSS_PRODUCT", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Projections": "", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "42", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": "count_star()" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Projections": "", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Aggregates": "count_star()", "Estimated Cardinality": "1" } }, @@ -3299,52 +2510,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Projections": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_ext_discount_amt", + "ss_ext_discount_amt" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -3364,111 +2559,64 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(21i64 <= $.ss_quantity <= 40i64)", - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(21i64 <= $.ss_quantity <= 40i64)", + "Projections": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_net_paid", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } }, { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(41i64 <= $.ss_quantity <= 60i64)", - "Projections": "", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "42", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": "count_star()" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Filters": "(41i64 <= $.ss_quantity <= 60i64)", + "Projections": "", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Aggregates": "count_star()", "Estimated Cardinality": "1" } } @@ -3494,52 +2642,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_ext_discount_amt", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Projections": "ss_ext_discount_amt", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_ext_discount_amt", + "ss_ext_discount_amt" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } }, @@ -3553,52 +2685,36 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "ss_net_paid", - "Estimated Cardinality": "57692" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Aggregates": "avg(#0)" + "Function": "Vortex Scan", + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Projections": "ss_net_paid", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": [ + "ss_net_paid", + "ss_net_paid" + ], + "Estimated Cardinality": "57692" } } ], "extra_info": { "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "sum(#0)", + "count(#1)" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", "Estimated Cardinality": "1" } } @@ -3609,61 +2725,30 @@ physical_plan [ "name": "CROSS_PRODUCT", "children": [ { - "name": "PROJECTION", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1i64 <= $.ss_quantity <= 20i64)", - "Projections": "", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Projections": "42", - "Estimated Cardinality": "57692" - } - } - ], - "extra_info": { - "Aggregates": "count_star()" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Function": "Vortex Scan", + "Filters": "(1i64 <= $.ss_quantity <= 20i64)", + "Projections": "", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": "42", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Aggregates": "count_star()", "Estimated Cardinality": "1" } }, @@ -3675,7 +2760,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "r_reason_sk=1", + "Filters": "($.r_reason_sk = 1i64)", "Projections": "", "Estimated Cardinality": "1" } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q90.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q90.slt.no index bb1a0361379..bc2fb631cb7 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q90.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q90.slt.no @@ -433,7 +433,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "CASE WHEN ((pt.pmc = 0)) THEN (NULL) ELSE (CAST(\"at\".amc AS DECIMAL(15, 4)) / CAST(pt.pmc AS DECIMAL(15, 4))) END" + "Order By": "am_pm_ratio" } } ], @@ -461,6 +461,18 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(8i64 <= $.t_hour <= 9i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -468,106 +480,54 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_time_sk", - "ws_ship_hdemo_sk", - "ws_web_page_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.hd_dep_count = 6i64)", - "($.hd_demo_sk >= 2i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "288" - } - } - ], - "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "288" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_ship_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(8i64 <= $.t_hour <= 9i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" - ], + "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "17280" + "Join Type": "INNER", + "Conditions": "(ws_web_page_sk = wp_web_page_sk)", + "Estimated Cardinality": "11938" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", + "Filters": [ + "($.hd_dep_count = 6i64)", + "($.hd_demo_sk >= 2i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "1440" } } ], "extra_info": { - "Expressions": "wp_web_page_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ws_ship_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "2388" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_web_page_sk = wp_web_page_sk)", - "Estimated Cardinality": "14326" + "Conditions": "(t_time_sk = ws_sold_time_sk)", + "Estimated Cardinality": "576" } } ], @@ -592,6 +552,18 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(19i64 <= $.t_hour <= 20i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" + } + }, { "name": "COMPARISON_JOIN", "children": [ @@ -599,106 +571,54 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ws_sold_time_sk", - "ws_ship_hdemo_sk", - "ws_web_page_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "71632" } }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.hd_dep_count = 6i64)", - "($.hd_demo_sk >= 2i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "288" - } - } - ], - "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "288" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_ship_hdemo_sk = hd_demo_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "(19i64 <= $.t_hour <= 20i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" - ], + "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "17280" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "17280" + "Join Type": "INNER", + "Conditions": "(ws_web_page_sk = wp_web_page_sk)", + "Estimated Cardinality": "11938" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", + "Filters": [ + "($.hd_dep_count = 6i64)", + "($.hd_demo_sk >= 2i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "1440" } } ], "extra_info": { - "Expressions": "wp_web_page_sk", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ws_ship_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "2388" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_web_page_sk = wp_web_page_sk)", - "Estimated Cardinality": "14326" + "Conditions": "(t_time_sk = ws_sold_time_sk)", + "Estimated Cardinality": "576" } } ], @@ -749,6 +669,19 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(8i64 <= $.t_hour <= 9i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" + ], + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" + } + }, { "name": "HASH_JOIN", "children": [ @@ -773,16 +706,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "hd_dep_count=6", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "288" + "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", + "Projections": "wp_web_page_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_ship_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "14326" + "Conditions": "ws_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "11938" } }, { @@ -791,40 +724,31 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(8i64 <= $.t_hour <= 9i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" + "($.hd_dep_count = 6i64)", + "($.hd_demo_sk >= 2i64)" ], - "Projections": "t_time_sk", - "Estimated Cardinality": "17280" + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_time_sk = t_time_sk", - "Estimated Cardinality": "14326" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", - "Projections": "wp_web_page_sk", - "Estimated Cardinality": "1" + "Conditions": "ws_ship_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "2388" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_page_sk = wp_web_page_sk", - "Estimated Cardinality": "14326" + "Conditions": "t_time_sk = ws_sold_time_sk", + "Estimated Cardinality": "576" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } }, { @@ -833,6 +757,19 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(19i64 <= $.t_hour <= 20i64)", + "(46i64 <= $.t_time_sk <= 86203i64)" + ], + "Projections": "t_time_sk", + "Estimated Cardinality": "17280" + } + }, { "name": "HASH_JOIN", "children": [ @@ -857,16 +794,16 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "hd_dep_count=6", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "288" + "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", + "Projections": "wp_web_page_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_ship_hdemo_sk = hd_demo_sk", - "Estimated Cardinality": "14326" + "Conditions": "ws_web_page_sk = wp_web_page_sk", + "Estimated Cardinality": "11938" } }, { @@ -875,40 +812,31 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "(19i64 <= $.t_hour <= 20i64)", - "(46i64 <= $.t_time_sk <= 86203i64)" + "($.hd_dep_count = 6i64)", + "($.hd_demo_sk >= 2i64)" ], - "Projections": "t_time_sk", - "Estimated Cardinality": "17280" + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_time_sk = t_time_sk", - "Estimated Cardinality": "14326" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(5000i64 <= $.wp_char_count <= 5200i64)", - "Projections": "wp_web_page_sk", - "Estimated Cardinality": "1" + "Conditions": "ws_ship_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "2388" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_page_sk = wp_web_page_sk", - "Estimated Cardinality": "14326" + "Conditions": "t_time_sk = ws_sold_time_sk", + "Estimated Cardinality": "576" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], @@ -923,7 +851,8 @@ physical_plan [ ], "extra_info": { "Top": "100", - "Order By": "CASE WHEN ((pt.pmc = 0)) THEN (NULL) ELSE (CAST(\"at\".amc AS DECIMAL(15, 4)) / CAST(pt.pmc AS DECIMAL(15, 4))) END ASC" + "Order By": "am_pm_ratio ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q91.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q91.slt.no index 5a04229f331..bbb17b58545 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q91.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q91.slt.no @@ -386,7 +386,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum(memory.main.catalog_returns.cr_net_loss)" + "Order By": "Returns_Loss" } } ] @@ -404,30 +404,16 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Unknown\")) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"Advanced Degree\")))", - "(($.cd_marital_status = \"M\") or ($.cd_marital_status = \"W\"))", - "(($.cd_education_status = \"Unknown\") or ($.cd_education_status = \"Advanced Degree\"))", - "(7i64 <= $.cd_demo_sk <= 192051i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "38416" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" + "Filters": [ + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" ], - "Estimated Cardinality": "38416" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } }, { @@ -437,94 +423,53 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "14275" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "$.hd_buy_potential like \"Unknown%\"", + "Filters": [ + "((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Unknown\")) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"Advanced Degree\")))", + "(($.cd_marital_status = \"M\") or ($.cd_marital_status = \"W\"))", + "(($.cd_education_status = \"Unknown\") or ($.cd_education_status = \"Advanced Degree\"))", + "(7i64 <= $.cd_demo_sk <= 192051i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "1440" + "Estimated Cardinality": "38416" } - } - ], - "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "1440" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": "($.c_customer_sk >= 2i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "14275" - } - } - ], - "extra_info": { - "Expressions": [ - "cr_returned_date_sk", - "cr_returning_customer_sk", - "cr_call_center_sk", - "cr_net_loss" - ], - "Estimated Cardinality": "14275" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.c_customer_sk >= 2i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "10000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_customer_sk", - "c_current_cdemo_sk", - "c_current_hdemo_sk", - "c_current_addr_sk" - ], "Estimated Cardinality": "10000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.ca_gmt_offset = decimal128(-700, precision=5, scale=2))", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Filters": "($.ca_gmt_offset = decimal128(-700, precision=5, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], @@ -533,70 +478,43 @@ logical_opt [ "Conditions": "(c_current_addr_sk = ca_address_sk)", "Estimated Cardinality": "2000" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cr_returning_customer_sk = c_customer_sk)", - "Estimated Cardinality": "2855" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": [ - "($.d_year = 1998i64)", - "($.d_moy = 11i64)", - "(2450852i64 <= $.d_date_sk <= 2452907i64)" - ], + "Filters": "$.hd_buy_potential like \"Unknown%\"", "Function": "Vortex Scan", - "Estimated Cardinality": "2921" + "Estimated Cardinality": "1440" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "2921" + "Join Type": "INNER", + "Conditions": "(c_current_hdemo_sk = hd_demo_sk)", + "Estimated Cardinality": "400" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cr_returned_date_sk = d_date_sk)", - "Estimated Cardinality": "584" + "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", + "Estimated Cardinality": "400" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(hd_demo_sk = c_current_hdemo_sk)", - "Estimated Cardinality": "584" + "Conditions": "(cr_returning_customer_sk = c_customer_sk)", + "Estimated Cardinality": "571" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cc_call_center_sk", - "cc_call_center_id", - "cc_name", - "cc_manager" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } @@ -604,14 +522,14 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(cr_call_center_sk = cc_call_center_sk)", - "Estimated Cardinality": "584" + "Estimated Cardinality": "571" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cd_demo_sk = c_current_cdemo_sk)", - "Estimated Cardinality": "2244" + "Conditions": "(d_date_sk = cr_returned_date_sk)", + "Estimated Cardinality": "571" } } ], @@ -624,7 +542,7 @@ logical_opt [ "cd_education_status" ], "Expressions": "sum(cr_net_loss)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "570" } } ], @@ -635,12 +553,13 @@ logical_opt [ "Manager", "Returns_Loss" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "570" } } ], "extra_info": { - "Order By": "sum(memory.main.catalog_returns.cr_net_loss)" + "Order By": "Returns_Loss", + "Estimated Cardinality": "570" } } ] @@ -666,17 +585,12 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Filters": [ - "((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Unknown\")) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"Advanced Degree\")))", - "(($.cd_marital_status = \"M\") or ($.cd_marital_status = \"W\"))", - "(($.cd_education_status = \"Unknown\") or ($.cd_education_status = \"Advanced Degree\"))", - "(7i64 <= $.cd_demo_sk <= 192051i64)" - ], - "Projections": [ - "cd_demo_sk", - "cd_marital_status", - "cd_education_status" + "($.d_year = 1998i64)", + "($.d_moy = 11i64)", + "(2450852i64 <= $.d_date_sk <= 2452907i64)" ], - "Estimated Cardinality": "38416" + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } }, { @@ -690,31 +604,40 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "$.hd_buy_potential like \"Unknown%\"", - "Projections": "hd_demo_sk", - "Estimated Cardinality": "1440" + "Projections": [ + "cr_returned_date_sk", + "cr_returning_customer_sk", + "cr_call_center_sk", + "cr_net_loss" + ], + "Estimated Cardinality": "14275" } }, { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "((($.cd_marital_status = \"M\") and ($.cd_education_status = \"Unknown\")) or (($.cd_marital_status = \"W\") and ($.cd_education_status = \"Advanced Degree\")))", + "(($.cd_marital_status = \"M\") or ($.cd_marital_status = \"W\"))", + "(($.cd_education_status = \"Unknown\") or ($.cd_education_status = \"Advanced Degree\"))", + "(7i64 <= $.cd_demo_sk <= 192051i64)" + ], + "Projections": [ + "cd_demo_sk", + "cd_marital_status", + "cd_education_status" + ], + "Estimated Cardinality": "38416" + } + }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cr_returned_date_sk", - "cr_returning_customer_sk", - "cr_call_center_sk", - "cr_net_loss" - ], - "Estimated Cardinality": "14275" - } - }, { "name": "HASH_JOIN", "children": [ @@ -738,9 +661,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_gmt_offset=-7.00", + "Filters": "($.ca_gmt_offset = decimal128(-700, precision=5, scale=2))", "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], @@ -749,39 +672,36 @@ physical_plan [ "Conditions": "c_current_addr_sk = ca_address_sk", "Estimated Cardinality": "2000" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "$.hd_buy_potential like \"Unknown%\"", + "Projections": "hd_demo_sk", + "Estimated Cardinality": "1440" + } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cr_returning_customer_sk = c_customer_sk", - "Estimated Cardinality": "2855" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "d_year=1998", - "d_moy=11" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "2921" + "Conditions": "c_current_hdemo_sk = hd_demo_sk", + "Estimated Cardinality": "400" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cr_returned_date_sk = d_date_sk", - "Estimated Cardinality": "584" + "Conditions": "cd_demo_sk = c_current_cdemo_sk", + "Estimated Cardinality": "400" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "hd_demo_sk = c_current_hdemo_sk", - "Estimated Cardinality": "584" + "Conditions": "cr_returning_customer_sk = c_customer_sk", + "Estimated Cardinality": "571" } }, { @@ -802,14 +722,14 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "cr_call_center_sk = cc_call_center_sk", - "Estimated Cardinality": "584" + "Estimated Cardinality": "571" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cd_demo_sk = c_current_cdemo_sk", - "Estimated Cardinality": "2244" + "Conditions": "d_date_sk = cr_returned_date_sk", + "Estimated Cardinality": "571" } } ], @@ -822,7 +742,7 @@ physical_plan [ "cd_education_status", "cr_net_loss" ], - "Estimated Cardinality": "2244" + "Estimated Cardinality": "571" } } ], @@ -835,7 +755,7 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "0" + "Estimated Cardinality": "570" } } ], @@ -846,12 +766,13 @@ physical_plan [ "Manager", "Returns_Loss" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "570" } } ], "extra_info": { - "Order By": "sum(memory.main.catalog_returns.cr_net_loss) DESC" + "Order By": "Returns_Loss DESC", + "Estimated Cardinality": "570" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q92.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q92.slt.no index 03adc1f638c..a78ec01c627 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q92.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q92.slt.no @@ -327,8 +327,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -356,7 +355,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum(memory.main.web_sales.ws_ext_discount_amt)" + "Order By": "Excess Discount Amount" } } ], @@ -376,19 +375,19 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -398,45 +397,23 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "71632" } - } - ], - "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_discount_amt" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.i_manufact_id = 350i64)", "Function": "Vortex Scan", - "Estimated Cardinality": "72" + "Estimated Cardinality": "360" } } ], "extra_info": { - "Expressions": "i_item_sk", - "Estimated Cardinality": "72" + "Join Type": "INNER", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -451,144 +428,208 @@ logical_opt [ } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Expressions": [ + "#1", + "#0" + ], "Estimated Cardinality": "14326" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "14326" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "14326" + } + }, + { + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Groups": "#[8.0]", + "Expressions": "", + "Estimated Cardinality": "7163" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "7163" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "7163" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(ws_item_sk = i_item_sk)", + "Estimated Cardinality": "14326" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "71632" + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_discount_amt" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "12984" + "Join Type": "INNER", + "Conditions": "(ws_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_item_sk = i_item_sk)", - "Estimated Cardinality": "12984" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2" + ], + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "12984" + "Groups": "i_item_sk", + "Expressions": "avg(ws_ext_discount_amt)", + "Estimated Cardinality": "7163" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 2450816)" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "12984" + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Groups": "i_item_sk", - "Expressions": "avg(ws_ext_discount_amt)", - "Estimated Cardinality": "6492" + "Expressions": [ + "(1.3 * avg(ws_ext_discount_amt))", + "i_item_sk" + ], + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "Join Type": "INNER", + "Conditions": [ + "(i_item_sk IS NOT DISTINCT FROM i_item_sk)", + "(CAST(ws_ext_discount_amt AS DOUBLE) > SUBQUERY)" ], - "Estimated Cardinality": "6492" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": [ - "(1.3 * avg(ws_ext_discount_amt))", - "i_item_sk" - ], - "Estimated Cardinality": "6492" + "Expressions": "#0", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(i_item_sk IS NOT DISTINCT FROM i_item_sk)" + "Expressions": "#0", + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expressions": "(CAST(ws_ext_discount_amt AS DOUBLE) > SUBQUERY)", + "CTE Name": "__duckdb_delim_51", + "Table Index": "51", "Estimated Cardinality": "14326" } } @@ -623,48 +664,28 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_discount_amt" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "i_manufact_id=350", - "Projections": "i_item_sk", - "Estimated Cardinality": "72" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "14326" + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_ext_discount_amt" + ], + "Estimated Cardinality": "71632" } }, { @@ -672,176 +693,235 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Filters": "($.i_manufact_id = 350i64)", + "Projections": "i_item_sk", + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", + "Conditions": "ws_item_sk = i_item_sk", "Estimated Cardinality": "14326" } }, { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#0" + ], + "Estimated Cardinality": "14326" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "14326" + } + }, + { + "name": "PROJECTION", "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "PERFECT_HASH_GROUP_BY", "children": [ { - "name": "PERFECT_HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ws_sold_date_sk", + "ws_item_sk", + "ws_ext_discount_amt" + ], + "Estimated Cardinality": "71632" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_sold_date_sk", - "ws_item_sk", - "ws_ext_discount_amt" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "DELIM_SCAN", - "children": [], + "name": "PERFECT_HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "51", + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "CAST(#1 AS SMALLINT)" + ], + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Projections": "#[8.0]", + "Estimated Cardinality": "14326" + } + } + ], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "12984" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_item_sk = i_item_sk", - "Estimated Cardinality": "12984" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(2000-01-27 <= $.d_date <= 2000-04-26)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_sold_date_sk = d_date_sk", - "Estimated Cardinality": "12984" + "Join Type": "SEMI", + "Conditions": "ws_item_sk = i_item_sk", + "Estimated Cardinality": "14326" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(2000-01-27 <= $.d_date <= 2000-04-26)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 2450816)" - ], - "Estimated Cardinality": "12984" + "Join Type": "INNER", + "Conditions": "ws_sold_date_sk = d_date_sk", + "Estimated Cardinality": "14326" } } ], "extra_info": { "Projections": [ - "i_item_sk", - "ws_ext_discount_amt" + "CAST(#0 AS SMALLINT)", + "#1", + "#2" ], - "Estimated Cardinality": "12984" + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)" + "Projections": [ + "i_item_sk", + "ws_ext_discount_amt" + ], + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" - ], - "Estimated Cardinality": "6492" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "7163" } } ], "extra_info": { "Projections": [ - "(1.3 * avg(ws_ext_discount_amt))", - "i_item_sk" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "6492" + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_item_sk IS NOT DISTINCT FROM i_item_sk", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "12984" + "Projections": [ + "(1.3 * avg(ws_ext_discount_amt))", + "i_item_sk" + ], + "Estimated Cardinality": "7163" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "i_item_sk IS NOT DISTINCT FROM i_item_sk", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Join Type": "INNER", + "Conditions": [ + "i_item_sk IS NOT DISTINCT FROM i_item_sk", + "CAST(ws_ext_discount_amt AS DOUBLE) > SUBQUERY" + ], + "Estimated Cardinality": "14326" } } ], "extra_info": { - "Expression": "(CAST(ws_ext_discount_amt AS DOUBLE) > SUBQUERY)", + "Projections": "#0", "Estimated Cardinality": "14326" } } ], "extra_info": { - "Projections": "#0", + "CTE Name": "__duckdb_delim_51", + "Table Index": "51", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "14326" } } @@ -853,13 +933,15 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "sum(memory.main.web_sales.ws_ext_discount_amt) ASC" + "Order By": "Excess Discount Amount ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q93.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q93.slt.no index 75201ef4165..8847794803d 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q93.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q93.slt.no @@ -194,8 +194,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum(t.act_sales)", - "t.ss_customer_sk" + "sumsales", + "ss_customer_sk" ] } } @@ -222,117 +222,80 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_item_sk", - "ss_customer_sk", - "ss_ticket_number", - "ss_quantity", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "28576" - } - } - ], - "extra_info": { - "Expressions": [ - "sr_item_sk", - "sr_reason_sk", - "sr_ticket_number", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ss_item_sk = sr_item_sk)", - "(ss_ticket_number = sr_ticket_number)" - ], - "Estimated Cardinality": "288464" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "28576" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.r_reason_desc = \"reason 28\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(sr_reason_sk = r_reason_sk)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "9525" } } ], "extra_info": { - "Expressions": [ - "ss_customer_sk", - "act_sales" + "Join Type": "INNER", + "Conditions": [ + "(ss_item_sk = sr_item_sk)", + "(ss_ticket_number = sr_ticket_number)" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "96154" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "96154" } } ], "extra_info": { "Groups": "ss_customer_sk", - "Expressions": "sum(act_sales)", - "Estimated Cardinality": "182344" + "Expressions": "sum(CASE WHEN ((sr_return_quantity IS NOT NULL)) THEN ((CAST((ss_quantity - sr_return_quantity) AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2)))) ELSE (CAST(ss_quantity AS DECIMAL(26,0)) * CAST(ss_sales_price AS DECIMAL(26,2))) END)", + "Estimated Cardinality": "9999" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], @@ -341,7 +304,7 @@ logical_opt [ "ss_customer_sk", "sumsales" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], @@ -368,81 +331,76 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ss_item_sk", + "ss_customer_sk", + "ss_ticket_number", + "ss_quantity", + "ss_sales_price" + ], + "Estimated Cardinality": "288464" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_item_sk", - "ss_customer_sk", - "ss_ticket_number", - "ss_quantity", - "ss_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "sr_item_sk", - "sr_reason_sk", - "sr_ticket_number", - "sr_return_quantity" - ], - "Estimated Cardinality": "28576" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ss_item_sk = sr_item_sk", - "ss_ticket_number = sr_ticket_number" + "Function": "Vortex Scan", + "Projections": [ + "sr_item_sk", + "sr_reason_sk", + "sr_ticket_number", + "sr_return_quantity" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "28576" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.r_reason_desc = \"reason 28\")", + "Projections": "r_reason_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "sr_reason_sk = r_reason_sk", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "9525" } } ], "extra_info": { - "Projections": [ - "ss_customer_sk", - "act_sales" + "Join Type": "INNER", + "Conditions": [ + "ss_item_sk = sr_item_sk", + "ss_ticket_number = sr_ticket_number" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "96154" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "96154" } } ], @@ -451,32 +409,33 @@ physical_plan [ "ss_customer_sk", "act_sales" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "96154" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "182344" + "Estimated Cardinality": "9999" } } ], "extra_info": { "Top": "100", "Order By": [ - "sum(t.act_sales) ASC", - "t.ss_customer_sk ASC" - ] + "sumsales ASC", + "ss_customer_sk ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q94.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q94.slt.no index c5acf30049c..2820bf6c1a7 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q94.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q94.slt.no @@ -350,8 +350,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -438,8 +437,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -478,7 +476,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT ws1.ws_order_number)" + "Order By": "order count" } } ], @@ -495,243 +493,483 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - }, - { - "name": "DELIM_GET", - "children": [], + "name": "CTE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999-02-01 <= $.d_date <= 1999-04-02)", + "(2450820i64 <= $.d_date_sk <= 2452762i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "($.ca_state = \"IL\")", + "($.ca_address_sk <= 4998i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_ship_addr_sk = ca_address_sk)", + "Estimated Cardinality": "14332" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.web_company_name = \"pri\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_web_site_sk = web_site_sk)", + "Estimated Cardinality": "4777" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(d_date_sk = ws_ship_date_sk)", + "Estimated Cardinality": "4777" + } + } + ], + "extra_info": { + "Expressions": [ + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4777" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "4777" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "66", + "Estimated Cardinality": "4777" + } + }, + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": { + "Expressions": "" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": [ + "(ws_warehouse_sk IS NOT DISTINCT FROM ws_warehouse_sk)", + "(ws_order_number IS NOT DISTINCT FROM ws_order_number)" + ], + "Estimated Cardinality": "4777" + } + } + ], + "extra_info": { + "Expressions": "SUBQUERY", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "955" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "14325" + "CTE Name": "__duckdb_delim_66", + "Table Index": "66", + "Estimated Cardinality": "955" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ws_order_number = ws_order_number)", - "(ws_warehouse_sk != ws_warehouse_sk)" + "Expressions": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "594926" + "Estimated Cardinality": "955" } } ], "extra_info": { "Expressions": [ - "ws_warehouse_sk", - "ws_order_number" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "594926" + "Estimated Cardinality": "955" } - } - ], - "extra_info": { - "Expressions": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "594926" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_ship_date_sk", - "ws_ship_addr_sk", - "ws_web_site_sk", - "ws_warehouse_sk", - "ws_order_number", - "ws_ext_ship_cost", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "955" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Groups": "#[72.17]", + "Expressions": "", + "Estimated Cardinality": "477" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "477" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "477" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(wr_order_number = ws_order_number)", + "Estimated Cardinality": "1407" + } + } + ], + "extra_info": { + "Expressions": "ws_order_number", + "Estimated Cardinality": "1407" + } + } + ], "extra_info": { - "Filters": [ - "($.ca_state = \"IL\")", - "($.ca_address_sk <= 4998i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Join Type": "MARK", + "Conditions": "(ws_order_number IS NOT DISTINCT FROM ws_order_number)", + "Estimated Cardinality": "955" } } ], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_ship_addr_sk = ca_address_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999-02-01 <= $.d_date <= 1999-04-02)", - "(2450820i64 <= $.d_date_sk <= 2452762i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" + "Expressions": "(NOT SUBQUERY)", + "Estimated Cardinality": "191" } } ], "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "191" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_ship_date_sk = d_date_sk)", - "Estimated Cardinality": "14326" - } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": { - "Expressions": "" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "191" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_web_site_sk = web_site_sk)", - "Estimated Cardinality": "14326" + "CTE Name": "__duckdb_delim_75", + "Table Index": "75", + "Estimated Cardinality": "191" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "(ws_warehouse_sk IS NOT DISTINCT FROM ws_warehouse_sk)", - "(ws_order_number IS NOT DISTINCT FROM ws_order_number)" + "Expressions": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "2865" + "Estimated Cardinality": "191" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "191" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "CROSS_PRODUCT", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "7037" + "CTE Index": "82", + "Estimated Cardinality": "191" } - }, + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(ws_ext_ship_cost)", + "sum(ws_net_profit)" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ { - "name": "DELIM_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Groups": "ws_order_number", + "Expressions": "", + "Estimated Cardinality": "95" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2808" + "Expressions": "42", + "Estimated Cardinality": "95" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(wr_order_number = ws_order_number)", - "Estimated Cardinality": "2808" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ws_order_number", - "Estimated Cardinality": "2808" + "Expressions": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "ws_order_number", - "Estimated Cardinality": "2808" + "Expressions": "", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "(ws_order_number IS NOT DISTINCT FROM ws_order_number)", - "Estimated Cardinality": "573" + "Expressions": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", - "Expressions": [ - "count(DISTINCT ws_order_number)", - "sum(ws_ext_ship_cost)", - "sum(ws_net_profit)" - ], + "CTE Name": "__aggregate_cte_82", + "Table Index": "82", "Estimated Cardinality": "1" } } @@ -757,20 +995,33 @@ physical_plan [ "name": "TOP_N", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "CTE", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "CTE", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "PROJECTION", "children": [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999-02-01 <= $.d_date <= 1999-04-02)", + "(2450820i64 <= $.d_date_sk <= 2452762i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ @@ -799,16 +1050,19 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "ca_state='IL'", + "Filters": [ + "($.ca_state = \"IL\")", + "($.ca_address_sk <= 4998i64)" + ], "Projections": "ca_address_sk", - "Estimated Cardinality": "200" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ws_ship_addr_sk = ca_address_sk", - "Estimated Cardinality": "14326" + "Estimated Cardinality": "14332" } }, { @@ -816,132 +1070,109 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1999-02-01 <= $.d_date <= 1999-04-02)", - "(2450820i64 <= $.d_date_sk <= 2452762i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Filters": "($.web_company_name = \"pri\")", + "Projections": "web_site_sk", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_ship_date_sk = d_date_sk", - "Estimated Cardinality": "14326" + "Conditions": "ws_web_site_sk = web_site_sk", + "Estimated Cardinality": "4777" } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_site_sk = web_site_sk", - "Estimated Cardinality": "14326" + "Conditions": "d_date_sk = ws_ship_date_sk", + "Estimated Cardinality": "4777" } - }, + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "4777" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "14325" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ws_order_number = ws_order_number", - "ws_warehouse_sk != ws_warehouse_sk" - ], - "Estimated Cardinality": "594926" + "CTE Index": "66", + "Estimated Cardinality": "4777" } + }, + { + "name": "EMPTY_RESULT", + "children": [], + "extra_info": {} } ], "extra_info": { - "Projections": [ - "ws_warehouse_sk", - "ws_order_number" + "Join Type": "MARK", + "Conditions": [ + "ws_warehouse_sk IS NOT DISTINCT FROM ws_warehouse_sk", + "ws_order_number IS NOT DISTINCT FROM ws_order_number" ], - "Estimated Cardinality": "594926" + "Estimated Cardinality": "4777" } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "ws_warehouse_sk IS NOT DISTINCT FROM ws_warehouse_sk", - "ws_order_number IS NOT DISTINCT FROM ws_order_number" - ], - "Estimated Cardinality": "2865" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": [ - "#0", - "#1" - ], - "Aggregates": "", - "Estimated Cardinality": "14325" + "Expression": "SUBQUERY", + "Estimated Cardinality": "955" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "ws_warehouse_sk IS NOT DISTINCT FROM ws_warehouse_sk", - "ws_order_number IS NOT DISTINCT FROM ws_order_number" + "Projections": [ + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "2865", - "Delim Index": "1" + "Estimated Cardinality": "955" } - }, + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_66", + "Table Index": "66", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "955" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "HASH_JOIN", + "name": "FILTER", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "573" - } - }, - { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "955" + } + }, { "name": "HASH_JOIN", "children": [ @@ -955,73 +1186,206 @@ physical_plan [ } }, { - "name": "DELIM_SCAN", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "75", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Projections": "#[72.17]", + "Estimated Cardinality": "955" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "477" + } + } + ], "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "2808" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "477" } } ], "extra_info": { - "Join Type": "INNER", + "Join Type": "SEMI", "Conditions": "wr_order_number = ws_order_number", - "Estimated Cardinality": "2808" + "Estimated Cardinality": "1407" } } ], "extra_info": { - "Projections": "ws_order_number", - "Estimated Cardinality": "2808" + "Join Type": "MARK", + "Conditions": "ws_order_number IS NOT DISTINCT FROM ws_order_number", + "Estimated Cardinality": "955" } } ], "extra_info": { - "Join Type": "ANTI", - "Conditions": "ws_order_number IS NOT DISTINCT FROM ws_order_number", - "Estimated Cardinality": "573" + "Expression": "(NOT SUBQUERY)", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "CTE Name": "__duckdb_delim_75", + "Table Index": "75", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "191" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": [ + "ws_ext_ship_cost", + "ws_net_profit" + ], + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "sum(#1)" + ], + "Estimated Cardinality": "1" } }, { - "name": "HASH_GROUP_BY", - "children": [], + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "82", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": "ws_order_number", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "95" + } + } + ], + "extra_info": { + "Projections": "42", + "Estimated Cardinality": "95" + } + } + ], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "2808" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], - "extra_info": { - "Join Type": "ANTI", - "Conditions": "ws_order_number IS NOT DISTINCT FROM ws_order_number", - "Estimated Cardinality": "573", - "Delim Index": "2" - } + "extra_info": {} } ], "extra_info": { "Projections": [ - "ws_order_number", - "ws_ext_ship_cost", - "ws_net_profit" + "#2", + "#0", + "#1" ], - "Estimated Cardinality": "573" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "count(DISTINCT #0)", - "sum(#1)", - "sum(#2)" - ] + "CTE Name": "__aggregate_cte_82", + "Table Index": "82", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "count(DISTINCT ws1.ws_order_number) ASC" + "Order By": "order count ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q95.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q95.slt.no index 07f66091dd1..32207c2a35f 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q95.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q95.slt.no @@ -524,7 +524,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "count(DISTINCT ws1.ws_order_number)" + "Order By": "order count" } } ], @@ -544,296 +544,335 @@ logical_opt [ "name": "CTE", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(ws_order_number = ws_order_number)", - "(ws_warehouse_sk != ws_warehouse_sk)" - ], - "Estimated Cardinality": "2974925" - } - } - ], - "extra_info": { - "Expressions": "ws_order_number", - "Estimated Cardinality": "2974925" - } - } - ], + "name": "EMPTY_RESULT", + "children": [], "extra_info": { - "Expressions": "#0" + "Expressions": "" } }, { - "name": "TOP_N", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "TOP_N", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "CTE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999-02-01 <= $.d_date <= 1999-04-02)", - "(2450820i64 <= $.d_date_sk <= 2452762i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999-02-01 <= $.d_date <= 1999-04-02)", + "(2450820i64 <= $.d_date_sk <= 2452762i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2974925" - } - }, - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "855190" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "7037" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ws_order_number = wr_order_number)", + "Estimated Cardinality": "1002995" + } + } + ], + "extra_info": { + "Expressions": "wr_order_number", + "Estimated Cardinality": "1002995" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "855190" + } + } + ], + "extra_info": { + "Expressions": "ws_order_number", + "Estimated Cardinality": "855190" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "71632" + } + } + ], + "extra_info": { + "Join Type": "RIGHT_SEMI", + "Conditions": "(#0 = ws_order_number)", + "Estimated Cardinality": "14326" + } + } + ], + "extra_info": { + "Join Type": "RIGHT_SEMI", + "Conditions": "(#0 = ws_order_number)", + "Estimated Cardinality": "2865" + } + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "", + "Filters": [ + "($.ca_state = \"IL\")", + "($.ca_address_sk <= 4998i64)" + ], "Function": "Vortex Scan", - "Estimated Cardinality": "7037" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": "wr_order_number", - "Estimated Cardinality": "7037" + "Join Type": "INNER", + "Conditions": "(ws_ship_addr_sk = ca_address_sk)", + "Estimated Cardinality": "573" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.web_company_name = \"pri\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ws_order_number = wr_order_number)", - "Estimated Cardinality": "2974925" + "Conditions": "(ws_web_site_sk = web_site_sk)", + "Estimated Cardinality": "191" } } ], "extra_info": { - "Expressions": "wr_order_number", - "Estimated Cardinality": "2974925" + "Join Type": "INNER", + "Conditions": "(d_date_sk = ws_ship_date_sk)", + "Estimated Cardinality": "191" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#1", + "#2", + "#3" + ], + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "191" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "CTE_SCAN", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2974925" + "CTE Index": "78", + "Estimated Cardinality": "191" } } ], "extra_info": { - "Expressions": "ws_order_number", - "Estimated Cardinality": "2974925" + "Groups": "", + "Expressions": [ + "sum(ws_ext_ship_cost)", + "sum(ws_net_profit)" + ], + "Estimated Cardinality": "1" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "COMPARISON_JOIN", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Expressions": [ - "ws_ship_date_sk", - "ws_ship_addr_sk", - "ws_web_site_sk", - "ws_order_number", - "ws_ext_ship_cost", - "ws_net_profit" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "78", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "191" + } + } + ], "extra_info": { - "Filters": [ - "($.ca_state = \"IL\")", - "($.ca_address_sk <= 4998i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "200" + "Groups": "ws_order_number", + "Expressions": "", + "Estimated Cardinality": "95" } } ], "extra_info": { - "Expressions": "ca_address_sk", - "Estimated Cardinality": "200" + "Expressions": "42", + "Estimated Cardinality": "95" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_ship_addr_sk = ca_address_sk)", - "Estimated Cardinality": "14326" + "Groups": "", + "Expressions": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "(#0 = ws_order_number)", - "Estimated Cardinality": "2865" + "Expressions": "#0", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "(#0 = ws_order_number)", - "Estimated Cardinality": "573" + "Expressions": "", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(d_date_sk = ws_ship_date_sk)", - "Estimated Cardinality": "573" - } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": { - "Expressions": "" + "Expressions": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ws_web_site_sk = web_site_sk)", - "Estimated Cardinality": "573" + "CTE Name": "__aggregate_cte_78", + "Table Index": "78", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "count(DISTINCT ws_order_number)", - "sum(ws_ext_ship_cost)", - "sum(ws_net_profit)" + "order count", + "total shipping cost", + "total net profit" ], "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "order count", - "total shipping cost", - "total net profit" - ], + "Expressions": "", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": "", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "1" } } @@ -850,56 +889,15 @@ physical_plan [ "name": "CTE", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ws_warehouse_sk", - "ws_order_number" - ], - "Estimated Cardinality": "71632" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "ws_order_number = ws_order_number", - "ws_warehouse_sk != ws_warehouse_sk" - ], - "Estimated Cardinality": "2974925" - } - } - ], - "extra_info": { - "Projections": "ws_order_number", - "Estimated Cardinality": "2974925" - } + "name": "EMPTY_RESULT", + "children": [], + "extra_info": {} }, { "name": "TOP_N", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "CTE", "children": [ { "name": "PROJECTION", @@ -907,75 +905,75 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999-02-01 <= $.d_date <= 1999-04-02)", + "(2450820i64 <= $.d_date_sk <= 2452762i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } + }, { "name": "HASH_JOIN", "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1999-02-01 <= $.d_date <= 1999-04-02)", - "(2450820i64 <= $.d_date_sk <= 2452762i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - }, { "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2974925" - } - }, - { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "855190" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "wr_order_number", + "Estimated Cardinality": "7037" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": "wr_order_number", - "Estimated Cardinality": "7037" + "Join Type": "INNER", + "Conditions": "ws_order_number = wr_order_number", + "Estimated Cardinality": "1002995" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_order_number = wr_order_number", - "Estimated Cardinality": "2974925" - } - } - ], - "extra_info": { - "Projections": "wr_order_number", - "Estimated Cardinality": "2974925" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "2974925" + "Projections": "wr_order_number", + "Estimated Cardinality": "1002995" } }, { "name": "HASH_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "855190" + } + }, { "name": "READ_VORTEX", "children": [], @@ -991,21 +989,11 @@ physical_plan [ ], "Estimated Cardinality": "71632" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "ca_state='IL'", - "Projections": "ca_address_sk", - "Estimated Cardinality": "200" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ws_ship_addr_sk = ca_address_sk", + "Join Type": "RIGHT_SEMI", + "Conditions": "#0 = ws_order_number", "Estimated Cardinality": "14326" } } @@ -1015,62 +1003,186 @@ physical_plan [ "Conditions": "#0 = ws_order_number", "Estimated Cardinality": "2865" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.ca_state = \"IL\")", + "($.ca_address_sk <= 4998i64)" + ], + "Projections": "ca_address_sk", + "Estimated Cardinality": "1000" + } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "#0 = ws_order_number", + "Join Type": "INNER", + "Conditions": "ws_ship_addr_sk = ca_address_sk", "Estimated Cardinality": "573" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.web_company_name = \"pri\")", + "Projections": "web_site_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "d_date_sk = ws_ship_date_sk", - "Estimated Cardinality": "573" + "Conditions": "ws_web_site_sk = web_site_sk", + "Estimated Cardinality": "191" } - }, - { - "name": "EMPTY_RESULT", - "children": [], - "extra_info": {} } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ws_web_site_sk = web_site_sk", - "Estimated Cardinality": "573" + "Conditions": "d_date_sk = ws_ship_date_sk", + "Estimated Cardinality": "191" } } ], "extra_info": { "Projections": [ - "ws_order_number", - "ws_ext_ship_cost", - "ws_net_profit" + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "573" + "Estimated Cardinality": "191" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "CROSS_PRODUCT", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "78", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": [ + "ws_ext_ship_cost", + "ws_net_profit" + ], + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "sum(#1)" + ], + "Estimated Cardinality": "1" + } + }, + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "78", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Projections": "ws_order_number", + "Estimated Cardinality": "191" + } + } + ], + "extra_info": { + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "95" + } + } + ], + "extra_info": { + "Projections": "42", + "Estimated Cardinality": "95" + } + } + ], + "extra_info": { + "Aggregates": "count_star()", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": {} + } + ], + "extra_info": { + "Projections": [ + "#2", + "#0", + "#1" + ], + "Estimated Cardinality": "1" } } ], "extra_info": { - "Aggregates": [ - "count(DISTINCT #0)", - "sum(#1)", - "sum(#2)" - ] + "CTE Name": "__aggregate_cte_78", + "Table Index": "78", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "count(DISTINCT ws1.ws_order_number) ASC" + "Order By": "order count ASC", + "Estimated Cardinality": "1" } } ], "extra_info": { "CTE Name": "ws_wh", "Table Index": "0", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "1" } } diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q96.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q96.slt.no index 44b3d805043..d8c86c882f7 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q96.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q96.slt.no @@ -248,43 +248,21 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ss_sold_time_sk", - "ss_hdemo_sk", - "ss_store_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.hd_dep_count = 7i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "288" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "hd_demo_sk", - "Estimated Cardinality": "288" + "Filters": "($.hd_dep_count = 7i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "1440" } } ], @@ -295,46 +273,39 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.t_hour = 20i64)", - "($.t_minute >= 30i64)", - "(28803i64 <= $.t_time_sk <= 75598i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "3456" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "t_time_sk", - "Estimated Cardinality": "3456" + "Filters": [ + "($.t_hour = 20i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_sold_time_sk = t_time_sk)", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Expressions": "" + "Filters": "($.s_store_name = \"ese\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ss_store_sk = s_store_sk)", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "21303" } } ], @@ -391,9 +362,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "hd_dep_count=7", + "Filters": "($.hd_dep_count = 7i64)", "Projections": "hd_demo_sk", - "Estimated Cardinality": "288" + "Estimated Cardinality": "1440" } } ], @@ -408,39 +379,50 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "t_hour=20", + "Filters": [ + "($.t_hour = 20i64)", + "($.t_minute >= 30i64)", + "(28803i64 <= $.t_time_sk <= 75598i64)" + ], "Projections": "t_time_sk", - "Estimated Cardinality": "3456" + "Estimated Cardinality": "17280" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_sold_time_sk = t_time_sk", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "21303" } }, { - "name": "EMPTY_RESULT", + "name": "READ_VORTEX", "children": [], - "extra_info": {} + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.s_store_name = \"ese\")", + "Projections": "s_store_sk", + "Estimated Cardinality": "1" + } } ], "extra_info": { "Join Type": "INNER", "Conditions": "ss_store_sk = s_store_sk", - "Estimated Cardinality": "11538" + "Estimated Cardinality": "21303" } } ], "extra_info": { - "Aggregates": "count_star()" + "Aggregates": "count_star()", + "Estimated Cardinality": "1" } } ], "extra_info": { "Top": "100", - "Order By": "count_star() ASC" + "Order By": "count_star() ASC", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q97.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q97.slt.no index 71783637044..0c86c4975ea 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q97.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q97.slt.no @@ -389,281 +389,181 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "LIMIT", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 2450816)" - ], - "Estimated Cardinality": "288464" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "288464" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": [ - "ss_customer_sk", - "ss_item_sk" + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Expressions": "", - "Estimated Cardinality": "288463" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" - ], - "Estimated Cardinality": "288463" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "288464" } } ], "extra_info": { "Expressions": [ - "customer_sk", - "item_sk" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" + "Groups": [ + "ss_customer_sk", + "ss_item_sk" ], - "Estimated Cardinality": "288463" + "Expressions": "", + "Estimated Cardinality": "286044" } - }, + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" + ], + "Estimated Cardinality": "286044" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(cs_sold_date_sk = d_date_sk)", - "Estimated Cardinality": "143657" - } - } - ], - "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 2450815)" - ], - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "143657" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Groups": [ - "cs_bill_customer_sk", - "cs_item_sk" + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" ], - "Expressions": "", - "Estimated Cardinality": "143656" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" - ], - "Estimated Cardinality": "143656" + "Join Type": "INNER", + "Conditions": "(cs_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "143657" } } ], "extra_info": { "Expressions": [ - "customer_sk", - "item_sk" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "143656" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" + "Groups": [ + "cs_bill_customer_sk", + "cs_item_sk" ], - "Estimated Cardinality": "143656" + "Expressions": "", + "Estimated Cardinality": "143055" } } ], "extra_info": { - "Join Type": "FULL", - "Conditions": [ - "(customer_sk = customer_sk)", - "(item_sk = item_sk)" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "143055" } } ], "extra_info": { - "Expressions": [ - "(customer_sk IS NOT NULL)", - "customer_sk", - "customer_sk" + "Join Type": "FULL", + "Conditions": [ + "(customer_sk = customer_sk)", + "(item_sk = item_sk)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "286044" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "sum(CASE WHEN ((#0 AND (customer_sk IS NULL))) THEN (1) ELSE 0 END)", - "sum(CASE WHEN (((customer_sk IS NULL) AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END)", - "sum(CASE WHEN ((#0 AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END)" + "(customer_sk IS NOT NULL)", + "customer_sk", + "customer_sk" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "286044" } } ], "extra_info": { - "Expressions": "" + "Groups": "", + "Expressions": [ + "sum(CASE WHEN ((#0 AND (customer_sk IS NULL))) THEN (1) ELSE 0 END)", + "sum(CASE WHEN (((customer_sk IS NULL) AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END)", + "sum(CASE WHEN ((#0 AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END)" + ], + "Estimated Cardinality": "1" } } ], @@ -679,232 +579,227 @@ logical_opt [ ] physical_plan [ { - "name": "STREAMING_LIMIT", + "name": "UNGROUPED_AGGREGATE", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_customer_sk" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_customer_sk" + ], "Estimated Cardinality": "288464" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 2450816)" - ], + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", "Estimated Cardinality": "288464" } } ], "extra_info": { "Projections": [ - "ss_customer_sk", - "ss_item_sk" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], "Estimated Cardinality": "288464" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" + "Projections": [ + "ss_customer_sk", + "ss_item_sk" ], - "Aggregates": "", - "Estimated Cardinality": "288463" + "Estimated Cardinality": "288464" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "288463" + "Aggregates": "", + "Estimated Cardinality": "286044" } - }, + } + ], + "extra_info": { + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" + ], + "Estimated Cardinality": "286044" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "cs_sold_date_sk", - "cs_bill_customer_sk", - "cs_item_sk" - ], - "Estimated Cardinality": "143657" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450815i64 <= $.d_date_sk <= 2452652i64)" - ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "cs_sold_date_sk = d_date_sk", + "Function": "Vortex Scan", + "Projections": [ + "cs_sold_date_sk", + "cs_bill_customer_sk", + "cs_item_sk" + ], "Estimated Cardinality": "143657" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450815i64 <= $.d_date_sk <= 2452652i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" + } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 2450815)" - ], + "Join Type": "INNER", + "Conditions": "cs_sold_date_sk = d_date_sk", "Estimated Cardinality": "143657" } } ], "extra_info": { "Projections": [ - "cs_bill_customer_sk", - "cs_item_sk" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], "Estimated Cardinality": "143657" } } ], "extra_info": { - "Groups": [ - "#0", - "#1" + "Projections": [ + "cs_bill_customer_sk", + "cs_item_sk" ], - "Aggregates": "", - "Estimated Cardinality": "143656" + "Estimated Cardinality": "143657" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)" + "Groups": [ + "#0", + "#1" ], - "Estimated Cardinality": "143656" + "Aggregates": "", + "Estimated Cardinality": "143055" } } ], "extra_info": { - "Join Type": "FULL", - "Conditions": [ - "customer_sk = customer_sk", - "item_sk = item_sk" + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "143055" } } ], "extra_info": { - "Projections": [ - "(customer_sk IS NOT NULL)", - "customer_sk", - "customer_sk" + "Join Type": "FULL", + "Conditions": [ + "customer_sk = customer_sk", + "item_sk = item_sk" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "286044" } } ], "extra_info": { "Projections": [ - "CASE WHEN ((#0 AND (customer_sk IS NULL))) THEN (1) ELSE 0 END", - "CASE WHEN (((customer_sk IS NULL) AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END", - "CASE WHEN ((#0 AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END" + "(customer_sk IS NOT NULL)", + "customer_sk", + "customer_sk" ], - "Estimated Cardinality": "288463" + "Estimated Cardinality": "286044" } } ], "extra_info": { - "Aggregates": [ - "sum(#0)", - "sum(#1)", - "sum(#2)" - ] + "Projections": [ + "CASE WHEN ((#0 AND (customer_sk IS NULL))) THEN (1) ELSE 0 END", + "CASE WHEN (((customer_sk IS NULL) AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END", + "CASE WHEN ((#0 AND (customer_sk IS NOT NULL))) THEN (1) ELSE 0 END" + ], + "Estimated Cardinality": "286044" } } ], - "extra_info": {} + "extra_info": { + "Aggregates": [ + "sum(#0)", + "sum(#1)", + "sum(#2)" + ], + "Estimated Cardinality": "1" + } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q98.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q98.slt.no index 7f547747a3d..61bd9c0ab93 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q98.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q98.slt.no @@ -230,11 +230,11 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.item.i_category", - "memory.main.item.i_class", - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "((sum(memory.main.store_sales.ss_ext_sales_price) * 100.0000) / sum(sum(memory.main.store_sales.ss_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class))" + "i_category", + "i_class", + "i_item_id", + "i_item_desc", + "revenueratio" ] } } @@ -250,146 +250,75 @@ logical_opt [ "name": "WINDOW", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "288464" - } - } - ], - "extra_info": { - "Expressions": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Function": "Vortex Scan", - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Expressions": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_item_sk = i_item_sk)", - "Estimated Cardinality": "288464" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], - "extra_info": { - "Expressions": "d_date_sk", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "288464" } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Function": "Vortex Scan", + "Estimated Cardinality": "360" + } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450816)" + "Join Type": "INNER", + "Conditions": "(ss_item_sk = i_item_sk)", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" ], - "Estimated Cardinality": "288464" + "Function": "Vortex Scan", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Groups": [ - "i_item_id", - "i_item_desc", - "i_category", - "i_class", - "i_current_price" - ], - "Expressions": "sum(ss_ext_sales_price)", - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "(ss_sold_date_sk = d_date_sk)", + "Estimated Cardinality": "57692" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5" + "Groups": [ + "i_item_id", + "i_item_desc", + "i_category", + "i_class", + "i_current_price" ], - "Estimated Cardinality": "288464" + "Expressions": "sum(ss_ext_sales_price)", + "Estimated Cardinality": "57691" } } ], "extra_info": { "Expressions": "sum(sum(ss_ext_sales_price)) OVER (PARTITION BY i_class)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], @@ -403,18 +332,19 @@ logical_opt [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Order By": [ - "memory.main.item.i_category", - "memory.main.item.i_class", - "memory.main.item.i_item_id", - "memory.main.item.i_item_desc", - "((sum(memory.main.store_sales.ss_ext_sales_price) * 100.0000) / sum(sum(memory.main.store_sales.ss_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class))" - ] + "i_category", + "i_class", + "i_item_id", + "i_item_desc", + "revenueratio" + ], + "Estimated Cardinality": "57691" } } ] @@ -438,48 +368,21 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ss_sold_date_sk", - "ss_item_sk", - "ss_ext_sales_price" - ], - "Estimated Cardinality": "288464" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", - "Projections": [ - "i_item_sk", - "i_item_id", - "i_item_desc", - "i_current_price", - "i_class", - "i_category" - ], - "Estimated Cardinality": "360" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ss_item_sk = i_item_sk", + "Function": "Vortex Scan", + "Projections": [ + "ss_sold_date_sk", + "ss_item_sk", + "ss_ext_sales_price" + ], "Estimated Cardinality": "288464" } }, @@ -488,33 +391,43 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": [ - "(1999-02-22 <= $.d_date <= 1999-03-24)", - "(2450816i64 <= $.d_date_sk <= 2452642i64)" + "Filters": "vortex.list.contains([\"Sports\", \"Books\", \"Home\"], $.i_category, opts=sql_null_semantics)", + "Projections": [ + "i_item_sk", + "i_item_id", + "i_item_desc", + "i_current_price", + "i_class", + "i_category" ], - "Projections": "d_date_sk", - "Estimated Cardinality": "14609" + "Estimated Cardinality": "360" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ss_sold_date_sk = d_date_sk", - "Estimated Cardinality": "288464" + "Conditions": "ss_item_sk = i_item_sk", + "Estimated Cardinality": "57692" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(1999-02-22 <= $.d_date <= 1999-03-24)", + "(2450816i64 <= $.d_date_sk <= 2452642i64)" + ], + "Projections": "d_date_sk", + "Estimated Cardinality": "14609" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "#3", - "#4", - "#5", - "__internal_compress_integral_usmallint(#6, 2450816)" - ], - "Estimated Cardinality": "288464" + "Join Type": "INNER", + "Conditions": "ss_sold_date_sk = d_date_sk", + "Estimated Cardinality": "57692" } } ], @@ -527,7 +440,7 @@ physical_plan [ "i_current_price", "ss_ext_sales_price" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57692" } } ], @@ -540,12 +453,13 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], "extra_info": { - "Projections": "sum(sum(ss_ext_sales_price)) OVER (PARTITION BY i_class)" + "Projections": "sum(sum(ss_ext_sales_price)) OVER (PARTITION BY i_class)", + "Estimated Cardinality": "57691" } } ], @@ -559,7 +473,7 @@ physical_plan [ "#5", "#6" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], @@ -573,18 +487,19 @@ physical_plan [ "itemrevenue", "revenueratio" ], - "Estimated Cardinality": "288464" + "Estimated Cardinality": "57691" } } ], "extra_info": { "Order By": [ - "memory.main.item.i_category ASC", - "memory.main.item.i_class ASC", - "memory.main.item.i_item_id ASC", - "memory.main.item.i_item_desc ASC", - "((sum(memory.main.store_sales.ss_ext_sales_price) * 100.0000) / sum(sum(memory.main.store_sales.ss_ext_sales_price)) OVER (PARTITION BY memory.main.item.i_class)) ASC" - ] + "i_category ASC", + "i_class ASC", + "i_item_id ASC", + "i_item_desc ASC", + "revenueratio ASC" + ], + "Estimated Cardinality": "57691" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q99.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q99.slt.no index b5d42495899..6f718f4a9a6 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/plans/q99.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/plans/q99.slt.no @@ -363,9 +363,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sq1.w_substr", - "memory.main.ship_mode.sm_type", - "lower(memory.main.call_center.cc_name)" + "w_substr", + "sm_type", + "cc_name_lower" ] } } @@ -401,26 +401,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "143657" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cs_sold_date_sk", - "cs_ship_date_sk", - "cs_call_center_sk", - "cs_ship_mode_sk", - "cs_warehouse_sk" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "143657" } }, @@ -428,31 +413,19 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "w_warehouse_sk", - "w_warehouse_name" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1" } } ], "extra_info": { "Expressions": [ - "w_substr", - "w_warehouse_sk" + "w_warehouse_sk", + "w_warehouse_name" ], "Estimated Cardinality": "1" } @@ -465,79 +438,46 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "20" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "sm_ship_mode_sk", - "sm_type" - ], - "Estimated Cardinality": "20" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_ship_mode_sk = sm_ship_mode_sk)", + "Conditions": "(cs_call_center_sk = cc_call_center_sk)", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "cc_call_center_sk", - "cc_name" - ], - "Estimated Cardinality": "1" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "20" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(cs_call_center_sk = cc_call_center_sk)", + "Conditions": "(cs_ship_mode_sk = sm_ship_mode_sk)", "Estimated Cardinality": "143657" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "(1200i64 <= $.d_month_seq <= 1211i64)", - "(2450817i64 <= $.d_date_sk <= 2452740i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "14609" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "d_date_sk", + "Filters": [ + "(1200i64 <= $.d_month_seq <= 1211i64)", + "(2450817i64 <= $.d_date_sk <= 2452740i64)" + ], + "Function": "Vortex Scan", "Estimated Cardinality": "14609" } } @@ -551,10 +491,10 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "w_substr", - "sm_type", - "cc_name", - "(cs_ship_date_sk - cs_sold_date_sk)" + "w_warehouse_name", + "#4", + "#3", + "(#1 - #0)" ], "Estimated Cardinality": "143657" } @@ -563,8 +503,8 @@ logical_opt [ "extra_info": { "Groups": [ "w_substr", - "sm_type", - "cc_name" + "#1", + "#2" ], "Expressions": [ "sum(CASE WHEN ((#3 <= 30)) THEN (1) ELSE 0 END)", @@ -573,7 +513,7 @@ logical_opt [ "sum(CASE WHEN (((#3 > 90) AND (#3 <= 120))) THEN (1) ELSE 0 END)", "sum(CASE WHEN ((#3 > 120)) THEN (1) ELSE 0 END)" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "18" } } ], @@ -588,13 +528,13 @@ logical_opt [ "91-120 days", ">120 days" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "18" } } ], "extra_info": { "Expressions": "", - "Estimated Cardinality": "100" + "Estimated Cardinality": "18" } } ] @@ -642,25 +582,13 @@ physical_plan [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "w_warehouse_sk", - "w_warehouse_name" - ], - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", "Projections": [ - "w_substr", - "w_warehouse_sk" + "w_warehouse_sk", + "w_warehouse_name" ], "Estimated Cardinality": "1" } @@ -678,16 +606,16 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "sm_ship_mode_sk", - "sm_type" + "cc_call_center_sk", + "cc_name" ], - "Estimated Cardinality": "20" + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_ship_mode_sk = sm_ship_mode_sk", + "Conditions": "cs_call_center_sk = cc_call_center_sk", "Estimated Cardinality": "143657" } }, @@ -697,16 +625,16 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "cc_call_center_sk", - "cc_name" + "sm_ship_mode_sk", + "sm_type" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "20" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "cs_call_center_sk = cc_call_center_sk", + "Conditions": "cs_ship_mode_sk = sm_ship_mode_sk", "Estimated Cardinality": "143657" } }, @@ -733,10 +661,10 @@ physical_plan [ ], "extra_info": { "Projections": [ - "w_substr", - "sm_type", - "cc_name", - "(cs_ship_date_sk - cs_sold_date_sk)" + "w_warehouse_name", + "#4", + "#3", + "(#1 - #0)" ], "Estimated Cardinality": "143657" } @@ -745,8 +673,8 @@ physical_plan [ "extra_info": { "Projections": [ "w_substr", - "sm_type", - "cc_name", + "#1", + "#2", "CASE WHEN ((#3 <= 30)) THEN (1) ELSE 0 END", "CASE WHEN (((#3 > 30) AND (#3 <= 60))) THEN (1) ELSE 0 END", "CASE WHEN (((#3 > 60) AND (#3 <= 90))) THEN (1) ELSE 0 END", @@ -770,7 +698,7 @@ physical_plan [ "sum(#6)", "sum(#7)" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "18" } } ], @@ -785,17 +713,18 @@ physical_plan [ "91-120 days", ">120 days" ], - "Estimated Cardinality": "143657" + "Estimated Cardinality": "18" } } ], "extra_info": { "Top": "100", "Order By": [ - "sq1.w_substr ASC", - "memory.main.ship_mode.sm_type ASC", - "lower(memory.main.call_center.cc_name) ASC" - ] + "w_substr ASC", + "sm_type ASC", + "cc_name_lower ASC" + ], + "Estimated Cardinality": "18" } } ] diff --git a/vortex-sqllogictest/slt/tpcds/duckdb/results/q9.slt.no b/vortex-sqllogictest/slt/tpcds/duckdb/results/q9.slt.no index 601e7647dc7..46215b42414 100644 --- a/vortex-sqllogictest/slt/tpcds/duckdb/results/q9.slt.no +++ b/vortex-sqllogictest/slt/tpcds/duckdb/results/q9.slt.no @@ -70,4 +70,4 @@ SELECT CASE FROM reason WHERE r_reason_sk = 1 ; ---- -360.36244323597 1030.431489038098 1727.681323255987 267.128745971775 3087.216814544512 +360.36244323597 1030.431489038098 1727.681323255987 267.128745971775 3087.216814544511 diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q1.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q1.slt.no index 3407ec36a4e..a03474438d1 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q1.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q1.slt.no @@ -113,8 +113,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.lineitem.l_returnflag", - "memory.main.lineitem.l_linestatus" + "l_returnflag", + "l_linestatus" ] } } @@ -127,65 +127,83 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.l_shipdate <= 1998-09-02)", + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" + } + } + ], "extra_info": { - "Filters": "($.l_shipdate <= 1998-09-02)", - "Function": "Vortex Scan", + "Expressions": [ + "l_quantity", + "l_extendedprice", + "l_discount", + "l_tax", + "l_returnflag", + "l_linestatus" + ], "Estimated Cardinality": "120114" } } ], "extra_info": { "Expressions": [ + "l_returnflag", + "l_linestatus", "l_quantity", "l_extendedprice", - "l_discount", + "(l_extendedprice * (1.00 - l_discount))", "l_tax", - "l_returnflag", - "l_linestatus" + "l_discount" ], "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expressions": [ + "Groups": [ "l_returnflag", - "l_linestatus", - "l_quantity", - "l_extendedprice", - "(l_extendedprice * (1.00 - l_discount))", - "l_tax", - "l_discount" + "l_linestatus" ], - "Estimated Cardinality": "120114" + "Expressions": [ + "sum(l_quantity)", + "sum(l_extendedprice)", + "sum(#4)", + "sum((#4 * (1.00 + l_tax)))", + "avg(l_discount)", + "count_star()" + ], + "Estimated Cardinality": "120113" } } ], "extra_info": { - "Groups": [ - "l_returnflag", - "l_linestatus" - ], "Expressions": [ - "sum(l_quantity)", - "sum(l_extendedprice)", - "sum(#4)", - "sum((#4 * (1.00 + l_tax)))", - "avg(l_quantity)", - "avg(l_extendedprice)", - "avg(l_discount)", - "count_star()" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#7 AS DOUBLE))", + "\"/\"(CAST(#3 AS DOUBLE), CAST(#7 AS DOUBLE))", + "#6", + "#7" ], "Estimated Cardinality": "120113" } @@ -210,9 +228,10 @@ logical_opt [ ], "extra_info": { "Order By": [ - "memory.main.lineitem.l_returnflag", - "memory.main.lineitem.l_linestatus" - ] + "l_returnflag", + "l_linestatus" + ], + "Estimated Cardinality": "120113" } } ] @@ -221,27 +240,44 @@ physical_plan [ "name": "ORDER_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.l_shipdate <= 1998-09-02)", + "Projections": [ + "l_quantity", + "l_extendedprice", + "l_discount", + "l_tax", + "l_returnflag", + "l_linestatus" + ], + "Estimated Cardinality": "120114" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.l_shipdate <= 1998-09-02)", "Projections": [ + "l_returnflag", + "l_linestatus", "l_quantity", "l_extendedprice", - "l_discount", + "(l_extendedprice * (1.00 - l_discount))", "l_tax", - "l_returnflag", - "l_linestatus" + "l_discount" ], "Estimated Cardinality": "120114" } @@ -253,8 +289,8 @@ physical_plan [ "l_linestatus", "l_quantity", "l_extendedprice", - "(l_extendedprice * (1.00 - l_discount))", - "l_tax", + "#4", + "(#4 * (1.00 + l_tax))", "l_discount" ], "Estimated Cardinality": "120114" @@ -262,35 +298,34 @@ physical_plan [ } ], "extra_info": { - "Projections": [ - "l_returnflag", - "l_linestatus", - "l_quantity", - "l_extendedprice", - "#4", - "(#4 * (1.00 + l_tax))", - "l_quantity", - "l_extendedprice", - "l_discount" + "Groups": [ + "#0", + "#1" + ], + "Aggregates": [ + "sum(#2)", + "sum(#3)", + "sum(#4)", + "sum(#5)", + "avg(#6)", + "count_star()" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "120113" } } ], "extra_info": { - "Groups": [ + "Projections": [ "#0", - "#1" - ], - "Aggregates": [ - "sum(#2)", - "sum(#3)", - "sum(#4)", - "sum(#5)", - "avg(#6)", - "avg(#7)", - "avg(#8)", - "count_star()" + "#1", + "#2", + "#3", + "#4", + "#5", + "\"/\"(CAST(#2 AS DOUBLE), CAST(#7 AS DOUBLE))", + "\"/\"(CAST(#3 AS DOUBLE), CAST(#7 AS DOUBLE))", + "#6", + "#7" ], "Estimated Cardinality": "120113" } @@ -298,9 +333,10 @@ physical_plan [ ], "extra_info": { "Order By": [ - "memory.main.lineitem.l_returnflag ASC", - "memory.main.lineitem.l_linestatus ASC" - ] + "l_returnflag ASC", + "l_linestatus ASC" + ], + "Estimated Cardinality": "120113" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q10.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q10.slt.no index 6d47ce559d7..223a2d911d8 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q10.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q10.slt.no @@ -223,7 +223,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount)))" + "Order By": "revenue" } } ], @@ -251,11 +251,20 @@ logical_opt [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.l_returnflag = \"R\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -265,24 +274,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "15000" } - } - ], - "extra_info": { - "Expressions": [ - "c_custkey", - "c_name", - "c_address", - "c_nationkey", - "c_phone", - "c_acctbal", - "c_comment" - ], - "Estimated Cardinality": "15000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -294,86 +286,40 @@ logical_opt [ } ], "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_nationkey = n_nationkey)", - "Estimated Cardinality": "15000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1993-10-01 <= $.o_orderdate < 1994-01-01)", - "Function": "Vortex Scan", - "Estimated Cardinality": "30000" - } - } - ], - "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey" - ], - "Estimated Cardinality": "30000" + "Join Type": "INNER", + "Conditions": "(c_nationkey = n_nationkey)", + "Estimated Cardinality": "15000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.l_returnflag = \"R\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "24022" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_orderkey", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "24022" + "Filters": "(1993-10-01 <= $.o_orderdate < 1994-01-01)", + "Function": "Vortex Scan", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(o_orderkey = l_orderkey)", - "Estimated Cardinality": "24022" + "Conditions": "(c_custkey = o_custkey)", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_custkey = o_custkey)", - "Estimated Cardinality": "24022" + "Conditions": "(l_orderkey = o_orderkey)", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "#0", "#1", - "#2", + "CAST(#2 AS SMALLINT)", "#3", "#4", "#5", @@ -381,7 +327,7 @@ logical_opt [ "#7", "#8" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -396,13 +342,13 @@ logical_opt [ "c_comment" ], "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2", "#3", @@ -411,7 +357,7 @@ logical_opt [ "#6", "#7" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -426,7 +372,7 @@ logical_opt [ "c_phone", "c_comment" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -458,49 +404,63 @@ physical_plan [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.l_returnflag = \"R\")", + "Projections": [ + "l_orderkey", + "l_extendedprice", + "l_discount" + ], + "Estimated Cardinality": "120114" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.c_custkey <= 14999i64)", + "Projections": [ + "c_custkey", + "c_name", + "c_address", + "c_nationkey", + "c_phone", + "c_acctbal", + "c_comment" + ], + "Estimated Cardinality": "15000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "n_nationkey", + "n_name" + ], + "Estimated Cardinality": "25" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.c_custkey <= 14999i64)", - "Projections": [ - "c_custkey", - "c_name", - "c_address", - "c_nationkey", - "c_phone", - "c_acctbal", - "c_comment" - ], + "Join Type": "INNER", + "Conditions": "c_nationkey = n_nationkey", "Estimated Cardinality": "15000" } }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "c_nationkey = n_nationkey", - "Estimated Cardinality": "15000" - } - }, - { - "name": "HASH_JOIN", - "children": [ { "name": "READ_VORTEX", "children": [], @@ -513,41 +473,27 @@ physical_plan [ ], "Estimated Cardinality": "30000" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "l_returnflag='R'", - "Projections": [ - "l_orderkey", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "24022" - } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "o_orderkey = l_orderkey", - "Estimated Cardinality": "24022" + "Conditions": "c_custkey = o_custkey", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "c_custkey = o_custkey", - "Estimated Cardinality": "24022" + "Conditions": "l_orderkey = o_orderkey", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "#0", "#1", - "#2", + "CAST(#2 AS SMALLINT)", "#3", "#4", "#5", @@ -555,7 +501,7 @@ physical_plan [ "#7", "#8" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -570,7 +516,7 @@ physical_plan [ "c_comment", "(l_extendedprice * (1.00 - l_discount))" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -585,13 +531,13 @@ physical_plan [ "#6" ], "Aggregates": "sum(#7)", - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2", "#3", @@ -600,7 +546,7 @@ physical_plan [ "#6", "#7" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], @@ -615,13 +561,14 @@ physical_plan [ "c_phone", "c_comment" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "30000" } } ], "extra_info": { "Top": "20", - "Order By": "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount))) DESC" + "Order By": "revenue DESC", + "Estimated Cardinality": "20" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q11.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q11.slt.no index b61fa5cf34c..94c83e17f39 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q11.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q11.slt.no @@ -155,132 +155,109 @@ logical_plan [ "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "CROSS_PRODUCT", "children": [ { - "name": "FILTER", + "name": "CROSS_PRODUCT", "children": [ { - "name": "CROSS_PRODUCT", + "name": "PROJECTION", "children": [ { - "name": "CROSS_PRODUCT", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], - "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_availqty", - "ps_supplycost", - "ps_comment" - ] - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_name", - "s_address", - "s_nationkey", - "s_phone", - "s_acctbal", - "s_comment" - ] - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "" + "Filters": "", + "Function": "Vortex Scan" } - }, + } + ], + "extra_info": { + "Expressions": [ + "ps_partkey", + "ps_suppkey", + "ps_availqty", + "ps_supplycost", + "ps_comment" + ] + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name", - "n_regionkey", - "n_comment" - ] + "Filters": "", + "Function": "Vortex Scan" } } ], "extra_info": { - "Expressions": "" + "Expressions": [ + "s_suppkey", + "s_name", + "s_address", + "s_nationkey", + "s_phone", + "s_acctbal", + "s_comment" + ] + } + } + ], + "extra_info": { + "Expressions": "" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan" } } ], "extra_info": { "Expressions": [ - "(ps_suppkey = s_suppkey)", - "(s_nationkey = n_nationkey)", - "(n_name = CAST('GERMANY' AS VARCHAR))" + "n_nationkey", + "n_name", + "n_regionkey", + "n_comment" ] } } ], "extra_info": { - "Groups": "", - "Expressions": "sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0))))" + "Expressions": "" } } ], "extra_info": { - "Expressions": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * CAST(0.0001 AS DECIMAL(38,4)))" + "Expressions": [ + "(ps_suppkey = s_suppkey)", + "(s_nationkey = n_nationkey)", + "(n_name = CAST('GERMANY' AS VARCHAR))" + ] } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#[48.0])", - "count_star()" - ] + "Expressions": "sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0))))" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#[54.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[54.0] END" - ] + "Expressions": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * CAST(0.0001 AS DECIMAL(38,4)))" } } ], @@ -303,7 +280,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum((memory.main.partsupp.ps_supplycost * memory.main.partsupp.ps_availqty))" + "Order By": "value" } } ] @@ -336,25 +313,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "80000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_availqty", - "ps_supplycost" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "80000" } }, @@ -362,42 +325,21 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.n_name = \"GERMANY\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "n_nationkey", - "Estimated Cardinality": "1" + "Filters": "($.n_name = \"GERMANY\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "5" } } ], @@ -417,13 +359,13 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_utinyint(#5, 0)", - "__internal_compress_integral_utinyint(#6, 0)" + "#4", + "#5", + "#6" ], "Estimated Cardinality": "16000" } @@ -432,16 +374,16 @@ logical_opt [ "extra_info": { "Groups": "ps_partkey", "Expressions": "sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0))))", - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } }, { @@ -451,121 +393,62 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "80000" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "80000" - } - } - ], - "extra_info": { - "Expressions": [ - "ps_suppkey", - "ps_availqty", - "ps_supplycost" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.n_name = \"GERMANY\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "n_nationkey", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "200" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_suppkey = s_suppkey)", - "Estimated Cardinality": "16000" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.n_name = \"GERMANY\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "5" } } ], "extra_info": { - "Groups": "", - "Expressions": "sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0))))", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Expressions": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * 0.0001)", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(ps_suppkey = s_suppkey)", + "Estimated Cardinality": "16000" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0))))", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Expressions": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * 0.0001)", "Estimated Cardinality": "1" } } @@ -573,7 +456,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(CAST(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) AS DECIMAL(38,6)) > SUBQUERY)", - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], @@ -582,29 +465,31 @@ logical_opt [ "ps_partkey", "value" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { - "Order By": "sum((memory.main.partsupp.ps_supplycost * memory.main.partsupp.ps_availqty))" + "Order By": "value", + "Estimated Cardinality": "11013" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" - ] + ], + "Estimated Cardinality": "11013" } } ] @@ -673,9 +558,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "n_name='GERMANY'", + "Filters": "($.n_name = \"GERMANY\")", "Projections": "n_nationkey", - "Estimated Cardinality": "1" + "Estimated Cardinality": "5" } } ], @@ -695,13 +580,13 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "__internal_compress_integral_usmallint(#1, 1)", + "CAST(#0 AS SMALLINT)", + "#1", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", - "__internal_compress_integral_utinyint(#5, 0)", - "__internal_compress_integral_utinyint(#6, 0)" + "#4", + "#5", + "#6" ], "Estimated Cardinality": "16000" } @@ -719,16 +604,16 @@ physical_plan [ "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } }, { @@ -741,106 +626,75 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "UNGROUPED_AGGREGATE", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ps_suppkey", + "ps_availqty", + "ps_supplycost" + ], + "Estimated Cardinality": "80000" + } + }, + { + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ps_suppkey", - "ps_availqty", - "ps_supplycost" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "n_name='GERMANY'", - "Projections": "n_nationkey", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "ps_suppkey = s_suppkey", - "Estimated Cardinality": "16000" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_nationkey" + ], + "Estimated Cardinality": "1000" + } + }, + { + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": "(ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))", - "Estimated Cardinality": "16000" + "Function": "Vortex Scan", + "Filters": "($.n_name = \"GERMANY\")", + "Projections": "n_nationkey", + "Estimated Cardinality": "5" } } ], "extra_info": { - "Aggregates": "sum(#0)" + "Join Type": "INNER", + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Projections": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * 0.0001)", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "ps_suppkey = s_suppkey", + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "Projections": "(ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))", + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], + "Projections": "(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) * 0.0001)", "Estimated Cardinality": "1" } } @@ -848,7 +702,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "CAST(sum((ps_supplycost * CAST(ps_availqty AS DECIMAL(18,0)))) AS DECIMAL(38,6)) > SUBQUERY", - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], @@ -857,30 +711,31 @@ physical_plan [ "ps_partkey", "value" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1" ], - "Estimated Cardinality": "14501" + "Estimated Cardinality": "11013" } } ], "extra_info": { - "Order By": "sum((memory.main.partsupp.ps_supplycost * memory.main.partsupp.ps_availqty)) DESC" + "Order By": "value DESC", + "Estimated Cardinality": "11013" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "11013" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q12.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q12.slt.no index a4b51eac027..881429162b4 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q12.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q12.slt.no @@ -146,7 +146,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.lineitem.l_shipmode" + "Order By": "l_shipmode" } } ] @@ -164,51 +164,27 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "150000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_orderpriority" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "150000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([\"MAIL\", \"SHIP\"], $.l_shipmode, opts=sql_null_semantics)", - "($.l_commitdate < $.l_receiptdate)", - "($.l_shipdate < $.l_commitdate)", - "(1994-01-01 <= $.l_receiptdate < 1995-01-01)", - "($.l_commitdate < 1995-01-01)", - "($.l_shipdate < 1995-01-01)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_orderkey", - "l_shipmode" + "Filters": [ + "vortex.list.contains([\"MAIL\", \"SHIP\"], $.l_shipmode, opts=sql_null_semantics)", + "($.l_commitdate < $.l_receiptdate)", + "($.l_shipdate < $.l_commitdate)", + "(1994-01-01 <= $.l_receiptdate < 1995-01-01)", + "($.l_commitdate < 1995-01-01)", + "($.l_shipdate < 1995-01-01)" ], + "Function": "Vortex Scan", "Estimated Cardinality": "120114" } } @@ -216,7 +192,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(o_orderkey = l_orderkey)", - "Estimated Cardinality": "150000" + "Estimated Cardinality": "120114" } } ], @@ -226,7 +202,7 @@ logical_opt [ "sum(CASE WHEN (((o_orderpriority = '1-URGENT') OR (o_orderpriority = '2-HIGH'))) THEN (1) ELSE 0 END)", "sum(CASE WHEN (((o_orderpriority != '1-URGENT') AND (o_orderpriority != '2-HIGH'))) THEN (1) ELSE 0 END)" ], - "Estimated Cardinality": "85659" + "Estimated Cardinality": "75926" } } ], @@ -236,12 +212,13 @@ logical_opt [ "high_line_count", "low_line_count" ], - "Estimated Cardinality": "85659" + "Estimated Cardinality": "75926" } } ], "extra_info": { - "Order By": "memory.main.lineitem.l_shipmode" + "Order By": "l_shipmode", + "Estimated Cardinality": "75926" } } ] @@ -294,7 +271,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "o_orderkey = l_orderkey", - "Estimated Cardinality": "150000" + "Estimated Cardinality": "120114" } } ], @@ -304,7 +281,7 @@ physical_plan [ "CASE WHEN (((o_orderpriority = '1-URGENT') OR (o_orderpriority = '2-HIGH'))) THEN (1) ELSE 0 END", "CASE WHEN (((o_orderpriority != '1-URGENT') AND (o_orderpriority != '2-HIGH'))) THEN (1) ELSE 0 END" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "120114" } } ], @@ -314,12 +291,13 @@ physical_plan [ "sum(#1)", "sum(#2)" ], - "Estimated Cardinality": "85659" + "Estimated Cardinality": "75926" } } ], "extra_info": { - "Order By": "memory.main.lineitem.l_shipmode ASC" + "Order By": "l_shipmode ASC", + "Estimated Cardinality": "75926" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q13.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q13.slt.no index 0f1d364a42a..4aaa609bea7 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q13.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q13.slt.no @@ -139,8 +139,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "count_star()", - "c_orders.c_count" + "custdist", + "c_count" ] } } @@ -171,41 +171,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "$.o_comment not like \"%special%requests%\"", - "Function": "Vortex Scan", - "Estimated Cardinality": "30000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey" - ], + "Filters": "$.o_comment not like \"%special%requests%\"", + "Function": "Vortex Scan", "Estimated Cardinality": "30000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "15000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "c_custkey", + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "15000" } } @@ -220,7 +199,7 @@ logical_opt [ "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#1 AS SMALLINT)" ], "Estimated Cardinality": "30000" } @@ -235,7 +214,7 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], "Estimated Cardinality": "12969" @@ -251,7 +230,7 @@ logical_opt [ "extra_info": { "Groups": "c_count", "Expressions": "count_star()", - "Estimated Cardinality": "8681" + "Estimated Cardinality": "8197" } } ], @@ -260,15 +239,16 @@ logical_opt [ "c_count", "custdist" ], - "Estimated Cardinality": "8681" + "Estimated Cardinality": "8197" } } ], "extra_info": { "Order By": [ - "count_star()", - "c_orders.c_count" - ] + "custdist", + "c_count" + ], + "Estimated Cardinality": "8197" } } ] @@ -333,7 +313,7 @@ physical_plan [ "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#1 AS SMALLINT)" ], "Estimated Cardinality": "30000" } @@ -357,7 +337,7 @@ physical_plan [ ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], "Estimated Cardinality": "12969" @@ -379,15 +359,16 @@ physical_plan [ "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "8681" + "Estimated Cardinality": "8197" } } ], "extra_info": { "Order By": [ - "count_star() DESC", - "c_orders.c_count DESC" - ] + "custdist DESC", + "c_count DESC" + ], + "Estimated Cardinality": "8197" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q14.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q14.slt.no index 22d59117c9d..558879c6d33 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q14.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q14.slt.no @@ -129,45 +129,20 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1995-09-01 <= $.l_shipdate < 1995-10-01)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_partkey", - "l_extendedprice", - "l_discount" - ], + "Filters": "(1995-09-01 <= $.l_shipdate < 1995-10-01)", + "Function": "Vortex Scan", "Estimated Cardinality": "120114" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "20000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "p_partkey", - "p_type" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "20000" } } @@ -255,7 +230,8 @@ physical_plan [ "Aggregates": [ "sum(#0)", "sum(#1)" - ] + ], + "Estimated Cardinality": "1" } } ], diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q15.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q15.slt.no index f35936a9735..a23b89f24ca 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q15.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q15.slt.no @@ -71,7 +71,7 @@ logical_plan [ "extra_info": { "Expressions": [ "(l_shipdate >= CAST('1996-01-01' AS DATE))", - "(CAST(l_shipdate AS TIMESTAMP) < (CAST('1996-01-01' AS DATE) + to_months(CAST(trunc(CAST('3' AS DOUBLE)) AS INTEGER))))" + "(CAST(l_shipdate AS TIMESTAMP) < ('1996-01-01'::DATE + '3 months'::INTERVAL))" ] } } @@ -147,44 +147,21 @@ logical_plan [ "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": "max(total_revenue)" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": "max(total_revenue)" + "CTE Index": "0" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#[29.0])", - "count_star()" - ] + "Expressions": "max(total_revenue)" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#[35.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[35.0] END" - ] + "Expressions": "max(total_revenue)" } } ], @@ -213,7 +190,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.supplier.s_suppkey" + "Order By": "s_suppkey" } } ], @@ -243,21 +220,13 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.l_shipdate >= 1996-01-01)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "(CAST(l_shipdate AS TIMESTAMP) < '1996-04-01 00:00:00'::TIMESTAMP)", - "Estimated Cardinality": "24022" + "Filters": "(1996-01-01 <= $.l_shipdate < 1996-04-01)", + "Function": "Vortex Scan", + "SELECT projections": "l_suppkey: cast($.l_suppkey as i16)", + "Estimated Cardinality": "120114" } } ], @@ -267,33 +236,33 @@ logical_opt [ "l_extendedprice", "l_discount" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "120114" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", + "#0", "#1", "#2" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "120114" } } ], "extra_info": { "Groups": "l_suppkey", "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], @@ -302,171 +271,138 @@ logical_opt [ "supplier_no", "total_revenue" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } }, { "name": "PROJECTION", "children": [ { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "CTE_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "21772" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "1000" + } + }, { "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "21772" - } - } - ], - "extra_info": { - "Groups": "", - "Expressions": "max(total_revenue)", - "Estimated Cardinality": "1" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Expressions": "max(total_revenue)", - "Estimated Cardinality": "1" + "CTE Index": "0", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#0)", - "count_star()" - ], + "Expressions": "max(total_revenue)", "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(total_revenue = SUBQUERY)", - "Estimated Cardinality": "21772" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", + "Join Type": "INNER", + "Conditions": "(total_revenue = SUBQUERY)", "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": [ - "s_suppkey", - "s_name", - "s_address", - "s_phone" - ], + "Join Type": "INNER", + "Conditions": "(s_suppkey = supplier_no)", "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(supplier_no = s_suppkey)", - "Estimated Cardinality": "21772" + "Expressions": [ + "s_suppkey", + "s_name", + "s_address", + "s_phone", + "total_revenue" + ], + "Estimated Cardinality": "1000" } } ], "extra_info": { "Expressions": [ - "s_suppkey", - "s_name", - "s_address", - "s_phone", - "total_revenue" + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2", - "#3", - "#4" - ], - "Estimated Cardinality": "21772" + "Order By": "s_suppkey", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Order By": "memory.main.supplier.s_suppkey", - "Estimated Cardinality": "21772" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1", + "#2", + "#3", + "#4" + ], + "Estimated Cardinality": "1000" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "#0", "#1", "#2", "#3", "#4" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], "extra_info": { "CTE Name": "revenue", "Table Index": "0", - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ] @@ -484,53 +420,18 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.l_shipdate >= 1996-01-01)", - "Projections": [ - "l_suppkey", - "l_extendedprice", - "l_discount", - "l_shipdate" - ], - "Estimated Cardinality": "120114" - } - } - ], - "extra_info": { - "Expression": "(CAST(l_shipdate AS TIMESTAMP) < '1996-04-01 00:00:00'::TIMESTAMP)", - "Estimated Cardinality": "24022" - } - } - ], - "extra_info": { - "Projections": [ - "#0", - "#1", - "#2" - ], - "Estimated Cardinality": "24022" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "Filters": "(1996-01-01 <= $.l_shipdate < 1996-04-01)", + "SELECT projections": "l_suppkey: cast($.l_suppkey as i16)", "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "#2" + "l_suppkey", + "l_extendedprice", + "l_discount" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "120114" } } ], @@ -539,22 +440,23 @@ physical_plan [ "l_suppkey", "(l_extendedprice * (1.00 - l_discount))" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "120114" } } ], "extra_info": { "Groups": "#0", - "Aggregates": "sum(#1)" + "Aggregates": "sum(#1)", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } }, { @@ -567,153 +469,109 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_name", + "s_address", + "s_phone" + ], + "Estimated Cardinality": "1000" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "0", + "Estimated Cardinality": "1000" + } + }, + { + "name": "UNGROUPED_AGGREGATE", "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "21772" - } - }, { "name": "PROJECTION", "children": [ { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "CTE_SCAN", - "children": [], - "extra_info": { - "CTE Index": "0", - "Estimated Cardinality": "21772" - } - } - ], - "extra_info": { - "Projections": "total_revenue", - "Estimated Cardinality": "21772" - } - } - ], - "extra_info": { - "Aggregates": "max(#0)" - } - } - ], - "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" - } - } - ], + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "CTE Index": "0", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" - ], - "Estimated Cardinality": "1" + "Projections": "total_revenue", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "total_revenue = SUBQUERY", - "Estimated Cardinality": "21772" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_name", - "s_address", - "s_phone" - ], - "Estimated Cardinality": "1000" + "Aggregates": "max(#0)", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "supplier_no = s_suppkey", - "Estimated Cardinality": "21772" + "Conditions": "total_revenue = SUBQUERY", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Projections": [ - "s_suppkey", - "s_name", - "s_address", - "s_phone", - "total_revenue" - ], - "Estimated Cardinality": "21772" + "Join Type": "INNER", + "Conditions": "s_suppkey = supplier_no", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", + "CAST(#0 AS SMALLINT)", "#1", "#2", "#3", "#4" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Order By": "memory.main.supplier.s_suppkey ASC" + "Order By": "s_suppkey ASC", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", "#2", "#3", "#4" ], - "Estimated Cardinality": "21772" + "Estimated Cardinality": "1000" } } ], "extra_info": { "CTE Name": "revenue", "Table Index": "0", - "Estimated Cardinality": "21772" + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "1000" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q16.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q16.slt.no index a8aef74c8e3..b33f97c35fa 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q16.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q16.slt.no @@ -186,10 +186,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "count(DISTINCT memory.main.partsupp.ps_suppkey)", - "memory.main.part.p_brand", - "memory.main.part.p_type", - "memory.main.part.p_size" + "supplier_cnt", + "p_brand", + "p_type", + "p_size" ] } } @@ -211,113 +211,156 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "80000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "vortex.not($.p_type like \"MEDIUM POLISHED%\")", + "vortex.list.contains([49i32, 14i32, 23i32, 45i32, 19i32, 3i32, 36i32, 9i32], $.p_size, opts=sql_null_semantics)", + "($.p_brand != \"Brand#45\")" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ps_partkey = p_partkey)", + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "$.s_comment like \"%Customer%Complaints%\"", + "Function": "Vortex Scan", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "s_suppkey", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Expressions": "s_suppkey", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "(ps_suppkey = #0)", + "Estimated Cardinality": "16000" + } + } + ], + "extra_info": { + "Expressions": "(NOT SUBQUERY)", + "Estimated Cardinality": "3200" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "80000" - } - } - ], - "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.not($.p_type like \"MEDIUM POLISHED%\")", - "vortex.list.contains([49i32, 14i32, 23i32, 45i32, 19i32, 3i32, 36i32, 9i32], $.p_size, opts=sql_null_semantics)", - "($.p_brand != \"Brand#45\")" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "CAST(#3 AS TINYINT)" ], - "Function": "Vortex Scan", - "Estimated Cardinality": "4000" + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Expressions": [ - "p_partkey", + "Groups": [ "p_brand", "p_type", - "p_size" + "p_size", + "ps_suppkey" ], - "Estimated Cardinality": "4000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_partkey = p_partkey)", - "Estimated Cardinality": "80000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "$.s_comment like \"%Customer%Complaints%\"", - "Function": "Vortex Scan", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Expressions": "s_suppkey", - "Estimated Cardinality": "200" + "Expressions": "", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Expressions": "s_suppkey", - "Estimated Cardinality": "200" + "Expressions": [ + "#0", + "#1", + "CAST(#2 AS INTEGER)" + ], + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "(ps_suppkey = #0)", - "Estimated Cardinality": "80000" + "Expressions": [ + "#0", + "#1", + "CAST(#2 AS TINYINT)" + ], + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Expressions": "(NOT SUBQUERY)", - "Estimated Cardinality": "16000" + "Groups": [ + "#0", + "#1", + "#2" + ], + "Expressions": "count_star()", + "Estimated Cardinality": "800" } } ], @@ -325,21 +368,21 @@ logical_opt [ "Expressions": [ "#0", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "CAST(#2 AS INTEGER)", + "#3" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], "extra_info": { - "Groups": [ - "p_brand", - "p_type", - "p_size" + "Expressions": [ + "#0", + "#1", + "#2", + "#3" ], - "Expressions": "count(DISTINCT ps_suppkey)", - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], @@ -347,10 +390,10 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_decompress_integral_integer(#2, 1)", + "#2", "#3" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], @@ -361,7 +404,7 @@ logical_opt [ "p_size", "supplier_cnt" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], @@ -369,20 +412,21 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1)", + "CAST(#2 AS TINYINT)", "#3" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], "extra_info": { "Order By": [ - "count(DISTINCT memory.main.partsupp.ps_suppkey)", - "memory.main.part.p_brand", - "memory.main.part.p_type", - "memory.main.part.p_size" - ] + "supplier_cnt", + "p_brand", + "p_type", + "p_size" + ], + "Estimated Cardinality": "800" } } ], @@ -390,9 +434,10 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_decompress_integral_integer(#2, 1)", + "CAST(#2 AS INTEGER)", "#3" - ] + ], + "Estimated Cardinality": "800" } } ] @@ -422,73 +467,130 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ps_partkey", + "ps_suppkey" + ], + "Estimated Cardinality": "80000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "vortex.not($.p_type like \"MEDIUM POLISHED%\")", + "vortex.list.contains([49i32, 14i32, 23i32, 45i32, 19i32, 3i32, 36i32, 9i32], $.p_size, opts=sql_null_semantics)", + "($.p_brand != \"Brand#45\")" + ], + "Projections": [ + "p_partkey", + "p_brand", + "p_type", + "p_size" + ], + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ps_partkey = p_partkey", + "Estimated Cardinality": "16000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "$.s_comment like \"%Customer%Complaints%\"", + "Projections": "s_suppkey", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "ps_suppkey = #0", + "Estimated Cardinality": "16000" + } + } + ], + "extra_info": { + "Expression": "(NOT SUBQUERY)", + "Estimated Cardinality": "3200" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "ps_partkey", - "ps_suppkey" + "#0", + "#1", + "#2", + "#3" ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "vortex.not($.p_type like \"MEDIUM POLISHED%\")", - "vortex.list.contains([49i32, 14i32, 23i32, 45i32, 19i32, 3i32, 36i32, 9i32], $.p_size, opts=sql_null_semantics)", - "($.p_brand != \"Brand#45\")" - ], - "Projections": [ - "p_partkey", - "p_brand", - "p_type", - "p_size" - ], - "Estimated Cardinality": "4000" + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ps_partkey = p_partkey", - "Estimated Cardinality": "80000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "$.s_comment like \"%Customer%Complaints%\"", - "Projections": "s_suppkey", - "Estimated Cardinality": "200" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "CAST(#3 AS TINYINT)" + ], + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "ps_suppkey = #0", - "Estimated Cardinality": "80000" + "Projections": [ + "p_brand", + "p_type", + "p_size", + "ps_suppkey" + ], + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Expression": "(NOT SUBQUERY)", - "Estimated Cardinality": "16000" + "Groups": [ + "#0", + "#1", + "#2", + "#3" + ], + "Aggregates": "", + "Estimated Cardinality": "1600" } } ], @@ -496,10 +598,9 @@ physical_plan [ "Projections": [ "#0", "#1", - "#2", - "#3" + "CAST(#2 AS INTEGER)" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "1600" } } ], @@ -507,21 +608,19 @@ physical_plan [ "Projections": [ "#0", "#1", - "#2", - "__internal_compress_integral_utinyint(#3, 1)" + "CAST(#2 AS TINYINT)" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "1600" } } ], "extra_info": { "Projections": [ - "p_brand", - "p_type", - "p_size", - "ps_suppkey" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "1600" } } ], @@ -531,8 +630,8 @@ physical_plan [ "#1", "#2" ], - "Aggregates": "count(DISTINCT #3)", - "Estimated Cardinality": "16000" + "Aggregates": "count_star()", + "Estimated Cardinality": "800" } } ], @@ -540,10 +639,10 @@ physical_plan [ "Projections": [ "#0", "#1", - "__internal_decompress_integral_integer(#2, 1)", + "CAST(#2 AS INTEGER)", "#3" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], @@ -551,20 +650,21 @@ physical_plan [ "Projections": [ "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1)", + "CAST(#2 AS TINYINT)", "#3" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "800" } } ], "extra_info": { "Order By": [ - "count(DISTINCT memory.main.partsupp.ps_suppkey) DESC", - "memory.main.part.p_brand ASC", - "memory.main.part.p_type ASC", - "memory.main.part.p_size ASC" - ] + "supplier_cnt DESC", + "p_brand ASC", + "p_type ASC", + "p_size ASC" + ], + "Estimated Cardinality": "800" } } ], @@ -572,10 +672,10 @@ physical_plan [ "Projections": [ "#0", "#1", - "__internal_decompress_integral_integer(#2, 1)", + "CAST(#2 AS INTEGER)", "#3" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "800" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q17.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q17.slt.no index dca6caa2f58..1f928d496d6 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q17.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q17.slt.no @@ -161,8 +161,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -195,16 +194,16 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -214,20 +213,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "600572" } - } - ], - "extra_info": { - "Expressions": [ - "l_partkey", - "l_quantity", - "l_extendedprice" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -237,116 +223,193 @@ logical_opt [ "($.p_container = \"MED BOX\")" ], "Function": "Vortex Scan", - "Estimated Cardinality": "800" + "Estimated Cardinality": "4000" } } ], "extra_info": { - "Expressions": "p_partkey", - "Estimated Cardinality": "800" + "Join Type": "INNER", + "Conditions": "(l_partkey = p_partkey)", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_partkey = p_partkey)", + "Expressions": [ + "#1", + "#2", + "#0" + ], "Estimated Cardinality": "120114" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "120114" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "120114" + } + }, + { + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "600572" - } - }, - { - "name": "DELIM_GET", - "children": [], + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "600572" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "120114" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "CAST(#2 AS SMALLINT)" + ], + "Estimated Cardinality": "120114" + } + } + ], + "extra_info": { + "Groups": "#[8.0]", + "Expressions": "", + "Estimated Cardinality": "60057" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "60057" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "60057" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "108864" + "Join Type": "SEMI", + "Conditions": "(l_partkey = p_partkey)", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_partkey = p_partkey)", - "Estimated Cardinality": "108864" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1" + ], + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expressions": [ - "l_quantity", - "p_partkey" - ], - "Estimated Cardinality": "108864" + "Groups": "p_partkey", + "Expressions": "avg(l_quantity)", + "Estimated Cardinality": "60057" } } ], "extra_info": { "Expressions": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "108864" + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Groups": "p_partkey", - "Expressions": "avg(l_quantity)", - "Estimated Cardinality": "54432" + "Expressions": [ + "(0.2 * avg(l_quantity))", + "p_partkey" + ], + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "Join Type": "INNER", + "Conditions": [ + "(p_partkey IS NOT DISTINCT FROM p_partkey)", + "(CAST(l_quantity AS DOUBLE) < SUBQUERY)" ], - "Estimated Cardinality": "54432" + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expressions": [ - "(0.2 * avg(l_quantity))", - "p_partkey" - ], - "Estimated Cardinality": "54432" + "Expressions": "#0", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(p_partkey IS NOT DISTINCT FROM p_partkey)" + "Expressions": "#0", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expressions": "(CAST(l_quantity AS DOUBLE) < SUBQUERY)", + "CTE Name": "__duckdb_delim_37", + "Table Index": "37", "Estimated Cardinality": "120114" } } @@ -375,193 +438,221 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "l_partkey", - "l_quantity", - "l_extendedprice" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": [ - "p_brand='Brand#23'", - "p_container='MED BOX'" - ], - "Projections": "p_partkey", - "Estimated Cardinality": "800" - } - } - ], + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "l_partkey", + "l_quantity", + "l_extendedprice" + ], + "Estimated Cardinality": "600572" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "($.p_brand = \"Brand#23\")", + "($.p_container = \"MED BOX\")" + ], + "Projections": "p_partkey", + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "l_partkey = p_partkey", + "Estimated Cardinality": "120114" + } + } + ], + "extra_info": { + "Projections": [ + "#1", + "#2", + "#0" + ], + "Estimated Cardinality": "120114" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_partkey = p_partkey", + "CTE Index": "37", "Estimated Cardinality": "120114" } }, { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ - { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "l_partkey", + "l_quantity" + ], + "Estimated Cardinality": "600572" + } + }, { "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "37", + "Estimated Cardinality": "120114" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "CAST(#2 AS SMALLINT)" + ], + "Estimated Cardinality": "120114" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "l_partkey", - "l_quantity" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "108864" + "Projections": "#[8.0]", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_partkey = p_partkey", - "Estimated Cardinality": "108864" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Projections": [ - "l_quantity", - "p_partkey" - ], - "Estimated Cardinality": "108864" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Projections": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)" - ], - "Estimated Cardinality": "108864" + "Join Type": "SEMI", + "Conditions": "l_partkey = p_partkey", + "Estimated Cardinality": "120114" } } ], "extra_info": { "Projections": [ - "p_partkey", - "l_quantity" + "CAST(#0 AS SMALLINT)", + "#1" ], - "Estimated Cardinality": "108864" + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "avg(#1)", - "Estimated Cardinality": "54432" + "Projections": [ + "p_partkey", + "l_quantity" + ], + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" - ], - "Estimated Cardinality": "54432" + "Groups": "#0", + "Aggregates": "avg(#1)", + "Estimated Cardinality": "60057" } } ], "extra_info": { "Projections": [ - "(0.2 * avg(l_quantity))", - "p_partkey" + "CAST(#0 AS BIGINT)", + "#1" ], - "Estimated Cardinality": "54432" + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "p_partkey IS NOT DISTINCT FROM p_partkey", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "108864" + "Projections": [ + "(0.2 * avg(l_quantity))", + "p_partkey" + ], + "Estimated Cardinality": "60057" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "p_partkey IS NOT DISTINCT FROM p_partkey", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Join Type": "INNER", + "Conditions": [ + "p_partkey IS NOT DISTINCT FROM p_partkey", + "CAST(l_quantity AS DOUBLE) < SUBQUERY" + ], + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expression": "(CAST(l_quantity AS DOUBLE) < SUBQUERY)", + "Projections": "#0", "Estimated Cardinality": "120114" } } ], "extra_info": { - "Projections": "#1", + "CTE Name": "__duckdb_delim_37", + "Table Index": "37", + "Execution Mode": "PIPELINE_DEPENDENT", "Estimated Cardinality": "120114" } } @@ -573,7 +664,8 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ], diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q18.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q18.slt.no index 92d33eac32b..f7b0fbd81fa 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q18.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q18.slt.no @@ -256,8 +256,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.orders.o_totalprice", - "memory.main.orders.o_orderdate" + "o_totalprice", + "o_orderdate" ] } } @@ -287,23 +287,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "600572" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_orderkey", - "l_quantity" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "600572" } }, @@ -314,25 +302,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "150000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey", - "o_totalprice", - "o_orderdate" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "150000" } }, @@ -360,6 +334,7 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", + "SELECT projections": "l_orderkey: cast($.l_orderkey as i32)", "Estimated Cardinality": "600572" } } @@ -375,7 +350,7 @@ logical_opt [ ], "extra_info": { "Expressions": [ - "__internal_compress_integral_uinteger(#0, 1)", + "#0", "#1" ], "Estimated Cardinality": "600572" @@ -385,28 +360,28 @@ logical_opt [ "extra_info": { "Groups": "l_orderkey", "Expressions": "sum(l_quantity)", - "Estimated Cardinality": "379633" + "Estimated Cardinality": "379482" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "379633" + "Estimated Cardinality": "379482" } } ], "extra_info": { "Expressions": "(sum(l_quantity) > 300.00)", - "Estimated Cardinality": "75926" + "Estimated Cardinality": "75896" } } ], "extra_info": { "Expressions": "l_orderkey", - "Estimated Cardinality": "75926" + "Estimated Cardinality": "75896" } } ], @@ -417,23 +392,11 @@ logical_opt [ } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.c_custkey <= 14999i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "15000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "c_custkey", - "c_name" - ], + "Filters": "($.c_custkey <= 14999i64)", + "Function": "Vortex Scan", "Estimated Cardinality": "15000" } } @@ -448,20 +411,20 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_compress_integral_uinteger(#1, 1)", + "CAST(#1 AS INTEGER)", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], @@ -474,20 +437,20 @@ logical_opt [ "o_totalprice" ], "Expressions": "sum(l_quantity)", - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Expressions": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], @@ -500,7 +463,7 @@ logical_opt [ "o_totalprice", "sum(l_quantity)" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], @@ -577,25 +540,14 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "l_orderkey", - "l_quantity" - ], - "Estimated Cardinality": "600572" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { + "Function": "Vortex Scan", + "SELECT projections": "l_orderkey: cast($.l_orderkey as i32)", "Projections": [ - "__internal_compress_integral_uinteger(#0, 1)", - "#1" + "l_orderkey", + "l_quantity" ], "Estimated Cardinality": "600572" } @@ -613,28 +565,28 @@ physical_plan [ "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "379633" + "Estimated Cardinality": "379482" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1" ], - "Estimated Cardinality": "379633" + "Estimated Cardinality": "379482" } } ], "extra_info": { "Expression": "(sum(l_quantity) > 300.00)", - "Estimated Cardinality": "75926" + "Estimated Cardinality": "75896" } } ], "extra_info": { "Projections": "#0", - "Estimated Cardinality": "75926" + "Estimated Cardinality": "75896" } } ], @@ -668,20 +620,20 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Projections": [ "#0", - "__internal_compress_integral_uinteger(#1, 1)", + "CAST(#1 AS INTEGER)", "#2", "#3", - "__internal_compress_integral_usmallint(#4, 1)", + "CAST(#4 AS SMALLINT)", "#5" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], @@ -694,7 +646,7 @@ physical_plan [ "o_totalprice", "l_quantity" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], @@ -707,29 +659,30 @@ physical_plan [ "#4" ], "Aggregates": "sum(#5)", - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Projections": [ "#0", - "__internal_decompress_integral_bigint(#1, 1)", - "__internal_decompress_integral_bigint(#2, 1)", + "CAST(#1 AS BIGINT)", + "CAST(#2 AS BIGINT)", "#3", "#4", "#5" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.orders.o_totalprice DESC", - "memory.main.orders.o_orderdate ASC" - ] + "o_totalprice DESC", + "o_orderdate ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q19.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q19.slt.no index a8f2922c80b..3041bf95ae1 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q19.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q19.slt.no @@ -141,80 +141,43 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "20000" - } - } - ], - "extra_info": { - "Expressions": [ - "p_partkey", - "p_brand", - "p_size", - "p_container" - ], - "Estimated Cardinality": "20000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "vortex.list.contains([\"AIR\", \"AIR REG\"], $.l_shipmode, opts=sql_null_semantics)", - "($.l_shipinstruct = \"DELIVER IN PERSON\")" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "24022" - } - } - ], - "extra_info": { - "Expressions": [ - "l_partkey", - "l_quantity", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "24022" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(p_partkey = l_partkey)", - "Estimated Cardinality": "24022" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "(((l_quantity >= 1.00) AND (l_quantity <= 11.00) AND (p_size <= 5) AND (p_brand = 'Brand#12') AND ((p_container = 'SM CASE') OR (p_container = 'SM BOX') OR (p_container = 'SM PACK') OR (p_container = 'SM PKG'))) OR ((l_quantity >= 10.00) AND (l_quantity <= 20.00) AND (p_size <= 10) AND (p_brand = 'Brand#23') AND ((p_container = 'MED BAG') OR (p_container = 'MED BOX') OR (p_container = 'MED PKG') OR (p_container = 'MED PACK'))) OR ((l_quantity >= 20.00) AND (l_quantity <= 30.00) AND (p_size <= 15) AND (p_brand = 'Brand#34') AND ((p_container = 'LG CASE') OR (p_container = 'LG BOX') OR (p_container = 'LG PACK') OR (p_container = 'LG PKG'))))", - "Estimated Cardinality": "24022" + "Filters": [ + "vortex.list.contains([\"AIR\", \"AIR REG\"], $.l_shipmode, opts=sql_null_semantics)", + "(((($.l_quantity >= decimal128(100, precision=15, scale=2)) and ($.l_quantity <= decimal128(1100, precision=15, scale=2))) or (($.l_quantity >= decimal128(1000, precision=15, scale=2)) and ($.l_quantity <= decimal128(2000, precision=15, scale=2)))) or (($.l_quantity >= decimal128(2000, precision=15, scale=2)) and ($.l_quantity <= decimal128(3000, precision=15, scale=2))))", + "($.l_shipinstruct = \"DELIVER IN PERSON\")" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": [ + "(((((($.p_brand = \"Brand#12\") and vortex.list.contains([\"SM CASE\", \"SM BOX\", \"SM PACK\", \"SM PKG\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 5i32)) or (((($.p_brand = \"Brand#23\") and vortex.list.contains([\"MED BAG\", \"MED BOX\", \"MED PKG\", \"MED PACK\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 10i32))) or (((($.p_brand = \"Brand#34\") and vortex.list.contains([\"LG CASE\", \"LG BOX\", \"LG PACK\", \"LG PKG\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 15i32)))", + "((($.p_brand = \"Brand#12\") or ($.p_brand = \"Brand#23\")) or ($.p_brand = \"Brand#34\"))", + "((vortex.list.contains([\"SM CASE\", \"SM BOX\", \"SM PACK\", \"SM PKG\"], $.p_container, opts=sql_null_semantics) or vortex.list.contains([\"MED BAG\", \"MED BOX\", \"MED PKG\", \"MED PACK\"], $.p_container, opts=sql_null_semantics)) or vortex.list.contains([\"LG CASE\", \"LG BOX\", \"LG PACK\", \"LG PKG\"], $.p_container, opts=sql_null_semantics))", + "(((($.p_size >= 1i32) or ($.p_size <= 5i32)) or ($.p_size <= 10i32)) or ($.p_size <= 15i32))" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "4000" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "24022" + "Join Type": "INNER", + "Conditions": [ + "(l_partkey = p_partkey)", + "(((l_quantity >= 1.00) AND (l_quantity <= 11.00) AND (p_size <= 5) AND (p_brand = 'Brand#12') AND (p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG'))) OR ((l_quantity >= 10.00) AND (l_quantity <= 20.00) AND (p_size <= 10) AND (p_brand = 'Brand#23') AND (p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK'))) OR ((l_quantity >= 20.00) AND (l_quantity <= 30.00) AND (p_size <= 15) AND (p_brand = 'Brand#34') AND (p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG'))))" + ], + "Estimated Cardinality": "4804" } } ], @@ -239,74 +202,67 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "p_partkey", - "p_brand", - "p_size", - "p_container" - ], - "Estimated Cardinality": "20000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "l_shipinstruct='DELIVER IN PERSON'", - "Projections": [ - "l_partkey", - "l_quantity", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "24022" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "p_partkey = l_partkey", - "Estimated Cardinality": "24022" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expression": "(((l_quantity >= 1.00) AND (l_quantity <= 11.00) AND (p_size <= 5) AND (p_brand = 'Brand#12') AND ((p_container = 'SM CASE') OR (p_container = 'SM BOX') OR (p_container = 'SM PACK') OR (p_container = 'SM PKG'))) OR ((l_quantity >= 10.00) AND (l_quantity <= 20.00) AND (p_size <= 10) AND (p_brand = 'Brand#23') AND ((p_container = 'MED BAG') OR (p_container = 'MED BOX') OR (p_container = 'MED PKG') OR (p_container = 'MED PACK'))) OR ((l_quantity >= 20.00) AND (l_quantity <= 30.00) AND (p_size <= 15) AND (p_brand = 'Brand#34') AND ((p_container = 'LG CASE') OR (p_container = 'LG BOX') OR (p_container = 'LG PACK') OR (p_container = 'LG PKG'))))", - "Estimated Cardinality": "24022" + "Function": "Vortex Scan", + "Filters": [ + "vortex.list.contains([\"AIR\", \"AIR REG\"], $.l_shipmode, opts=sql_null_semantics)", + "(((($.l_quantity >= decimal128(100, precision=15, scale=2)) and ($.l_quantity <= decimal128(1100, precision=15, scale=2))) or (($.l_quantity >= decimal128(1000, precision=15, scale=2)) and ($.l_quantity <= decimal128(2000, precision=15, scale=2)))) or (($.l_quantity >= decimal128(2000, precision=15, scale=2)) and ($.l_quantity <= decimal128(3000, precision=15, scale=2))))", + "($.l_shipinstruct = \"DELIVER IN PERSON\")" + ], + "Projections": [ + "l_partkey", + "l_quantity", + "l_extendedprice", + "l_discount" + ], + "Estimated Cardinality": "120114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "(((((($.p_brand = \"Brand#12\") and vortex.list.contains([\"SM CASE\", \"SM BOX\", \"SM PACK\", \"SM PKG\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 5i32)) or (((($.p_brand = \"Brand#23\") and vortex.list.contains([\"MED BAG\", \"MED BOX\", \"MED PKG\", \"MED PACK\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 10i32))) or (((($.p_brand = \"Brand#34\") and vortex.list.contains([\"LG CASE\", \"LG BOX\", \"LG PACK\", \"LG PKG\"], $.p_container, opts=sql_null_semantics)) and ($.p_size >= 1i32)) and ($.p_size <= 15i32)))", + "((($.p_brand = \"Brand#12\") or ($.p_brand = \"Brand#23\")) or ($.p_brand = \"Brand#34\"))", + "((vortex.list.contains([\"SM CASE\", \"SM BOX\", \"SM PACK\", \"SM PKG\"], $.p_container, opts=sql_null_semantics) or vortex.list.contains([\"MED BAG\", \"MED BOX\", \"MED PKG\", \"MED PACK\"], $.p_container, opts=sql_null_semantics)) or vortex.list.contains([\"LG CASE\", \"LG BOX\", \"LG PACK\", \"LG PKG\"], $.p_container, opts=sql_null_semantics))", + "(((($.p_size >= 1i32) or ($.p_size <= 5i32)) or ($.p_size <= 10i32)) or ($.p_size <= 15i32))" + ], + "Projections": [ + "p_partkey", + "p_brand", + "p_size", + "p_container" + ], + "Estimated Cardinality": "4000" } } ], "extra_info": { - "Projections": [ - "#4", - "#5" + "Join Type": "INNER", + "Conditions": [ + "l_partkey = p_partkey", + "(((l_quantity >= 1.00) AND (l_quantity <= 11.00) AND (p_size <= 5) AND (p_brand = 'Brand#12') AND (p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG'))) OR ((l_quantity >= 10.00) AND (l_quantity <= 20.00) AND (p_size <= 10) AND (p_brand = 'Brand#23') AND (p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK'))) OR ((l_quantity >= 20.00) AND (l_quantity <= 30.00) AND (p_size <= 15) AND (p_brand = 'Brand#34') AND (p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG'))))" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "4804" } } ], "extra_info": { "Projections": "(l_extendedprice * (1.00 - l_discount))", - "Estimated Cardinality": "24022" + "Estimated Cardinality": "4804" } } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q2.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q2.slt.no index 47bd4d11dc8..99031d9f036 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q2.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q2.slt.no @@ -353,8 +353,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -388,10 +387,10 @@ logical_plan [ ], "extra_info": { "Order By": [ - "memory.main.supplier.s_acctbal", - "memory.main.nation.n_name", - "memory.main.supplier.s_name", - "memory.main.part.p_partkey" + "s_acctbal", + "n_name", + "s_name", + "p_partkey" ] } } @@ -409,19 +408,19 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -431,15 +430,76 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "80000" } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": [ + "s_suppkey", + "s_name", + "s_address", + "s_nationkey", + "s_phone", + "s_acctbal", + "s_comment" + ], + "Estimated Cardinality": "1000" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "25" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.r_name = \"EUROPE\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(n_regionkey = r_regionkey)", + "Estimated Cardinality": "5" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "200" + } } ], "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_supplycost" - ], - "Estimated Cardinality": "80000" + "Join Type": "INNER", + "Conditions": "(ps_suppkey = s_suppkey)", + "Estimated Cardinality": "16000" } }, { @@ -454,7 +514,7 @@ logical_opt [ "($.p_size = 15i32)" ], "Function": "Vortex Scan", - "Estimated Cardinality": "800" + "Estimated Cardinality": "4000" } } ], @@ -463,129 +523,79 @@ logical_opt [ "p_partkey", "p_mfgr" ], - "Estimated Cardinality": "800" + "Estimated Cardinality": "4000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "(ps_partkey = p_partkey)", - "Estimated Cardinality": "16000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_name", - "s_address", - "s_nationkey", - "s_phone", - "s_acctbal", - "s_comment" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name", - "n_regionkey" - ], - "Estimated Cardinality": "25" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.r_name = \"EUROPE\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "r_regionkey", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(n_regionkey = r_regionkey)", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "1000" + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_suppkey = s_suppkey)", - "Estimated Cardinality": "16000" + "Expressions": [ + "#7", + "#8", + "#1", + "#2", + "#3", + "#4", + "#5", + "#0", + "#6" + ], + "Estimated Cardinality": "3200" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "3200" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "79", + "Estimated Cardinality": "3200" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -595,61 +605,9 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "80000" } - } - ], - "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_supplycost" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "3926" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_partkey = p_partkey)", - "Estimated Cardinality": "78520" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -657,104 +615,183 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "25" + "Estimated Cardinality": "1000" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "25" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.r_name = \"EUROPE\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(n_regionkey = r_regionkey)", + "Estimated Cardinality": "5" } } ], "extra_info": { - "Expressions": [ - "n_nationkey", - "n_regionkey" - ], - "Estimated Cardinality": "25" + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "200" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(ps_suppkey = s_suppkey)", + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", + "children": [ { "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "79", + "Estimated Cardinality": "3200" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "3200" + } + } + ], "extra_info": { - "Filters": "($.r_name = \"EUROPE\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Groups": "#[1.0]", + "Expressions": "", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Expressions": "r_regionkey", - "Estimated Cardinality": "1" + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(n_regionkey = r_regionkey)", - "Estimated Cardinality": "25" + "Expressions": "#0", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "1000" + "Join Type": "SEMI", + "Conditions": "(ps_partkey = p_partkey)", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_suppkey = s_suppkey)", - "Estimated Cardinality": "78520" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "#1" + ], + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Expressions": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)" - ], - "Estimated Cardinality": "78520" + "Groups": "p_partkey", + "Expressions": "min(ps_supplycost)", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Groups": "p_partkey", - "Expressions": "min(ps_supplycost)", - "Estimated Cardinality": "39260" + "Expressions": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "Join Type": "INNER", + "Conditions": [ + "(p_partkey IS NOT DISTINCT FROM p_partkey)", + "(ps_supplycost = SUBQUERY)" ], - "Estimated Cardinality": "39260" + "Estimated Cardinality": "256" } } ], "extra_info": { "Expressions": [ - "min(ps_supplycost)", - "p_partkey" + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" ], - "Estimated Cardinality": "39260" + "Estimated Cardinality": "256" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "(p_partkey IS NOT DISTINCT FROM p_partkey)" + "Expressions": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "256" } } ], "extra_info": { - "Expressions": "(ps_supplycost = SUBQUERY)", - "Estimated Cardinality": "16000" + "CTE Name": "__duckdb_delim_79", + "Table Index": "79", + "Estimated Cardinality": "256" } } ], @@ -769,7 +806,7 @@ logical_opt [ "s_phone", "s_comment" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "256" } } ], @@ -787,51 +824,28 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "ps_partkey", - "ps_suppkey", - "ps_supplycost" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "p_size=15", - "Projections": [ - "p_partkey", - "p_mfgr" - ], - "Estimated Cardinality": "800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "ps_partkey = p_partkey", - "Estimated Cardinality": "16000" + "Function": "Vortex Scan", + "Projections": [ + "ps_partkey", + "ps_suppkey", + "ps_supplycost" + ], + "Estimated Cardinality": "80000" } }, { @@ -875,7 +889,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "r_name='EUROPE'", + "Filters": "($.r_name = \"EUROPE\")", "Projections": "r_regionkey", "Estimated Cardinality": "1" } @@ -884,14 +898,14 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "n_regionkey = r_regionkey", - "Estimated Cardinality": "25" + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" + "Estimated Cardinality": "200" } } ], @@ -902,33 +916,104 @@ physical_plan [ } }, { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "$.p_type like \"%BRASS\"", + "($.p_size = 15i32)" + ], + "Projections": [ + "p_partkey", + "p_mfgr" + ], + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ps_partkey = p_partkey", + "Estimated Cardinality": "3200" + } + } + ], + "extra_info": { + "Projections": [ + "#7", + "#8", + "#1", + "#2", + "#3", + "#4", + "#5", + "#0", + "#6" + ], + "Estimated Cardinality": "3200" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "79", + "Estimated Cardinality": "3200" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - }, - { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "ps_partkey", + "ps_suppkey", + "ps_supplycost" + ], + "Estimated Cardinality": "80000" + } + }, { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_nationkey" + ], + "Estimated Cardinality": "1000" + } + }, { "name": "HASH_JOIN", "children": [ @@ -938,178 +1023,170 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "ps_partkey", - "ps_suppkey", - "ps_supplycost" + "n_nationkey", + "n_regionkey" ], - "Estimated Cardinality": "80000" + "Estimated Cardinality": "25" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "3926" + "Function": "Vortex Scan", + "Filters": "($.r_name = \"EUROPE\")", + "Projections": "r_regionkey", + "Estimated Cardinality": "1" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ps_partkey = p_partkey", - "Estimated Cardinality": "78520" + "Conditions": "n_regionkey = r_regionkey", + "Estimated Cardinality": "5" } - }, + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "200" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "ps_suppkey = s_suppkey", + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "HASH_GROUP_BY", + "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "n_nationkey", - "n_regionkey" - ], - "Estimated Cardinality": "25" - } - }, - { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Function": "Vortex Scan", - "Filters": "r_name='EUROPE'", - "Projections": "r_regionkey", - "Estimated Cardinality": "1" + "CTE Index": "79", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "n_regionkey = r_regionkey", - "Estimated Cardinality": "25" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7", + "#8" + ], + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" + "Projections": "#[1.0]", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "ps_suppkey = s_suppkey", - "Estimated Cardinality": "78520" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_usmallint(#0, 1)", - "#1", - "__internal_compress_integral_usmallint(#2, 1)", - "__internal_compress_integral_utinyint(#3, 0)", - "__internal_compress_integral_utinyint(#4, 0)" - ], - "Estimated Cardinality": "78520" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Projections": [ - "p_partkey", - "ps_supplycost" - ], - "Estimated Cardinality": "78520" + "Join Type": "SEMI", + "Conditions": "ps_partkey = p_partkey", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": "min(#1)", - "Estimated Cardinality": "39260" + "Projections": [ + "CAST(#0 AS SMALLINT)", + "#1" + ], + "Estimated Cardinality": "3200" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "#1" + "p_partkey", + "ps_supplycost" ], - "Estimated Cardinality": "39260" + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Projections": [ - "min(ps_supplycost)", - "p_partkey" - ], - "Estimated Cardinality": "39260" + "Groups": "#0", + "Aggregates": "min(#1)", + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "p_partkey IS NOT DISTINCT FROM p_partkey", - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#1", - "Aggregates": "", - "Estimated Cardinality": "3926" + "Projections": [ + "CAST(#0 AS BIGINT)", + "#1" + ], + "Estimated Cardinality": "1600" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": "p_partkey IS NOT DISTINCT FROM p_partkey", - "Estimated Cardinality": "0", - "Delim Index": "1" + "Join Type": "INNER", + "Conditions": [ + "p_partkey IS NOT DISTINCT FROM p_partkey", + "ps_supplycost = SUBQUERY" + ], + "Estimated Cardinality": "256" } } ], "extra_info": { - "Expression": "(ps_supplycost = SUBQUERY)", - "Estimated Cardinality": "16000" + "Projections": [ + "#0", + "#1", + "#2", + "#3", + "#4", + "#5", + "#6", + "#7" + ], + "Estimated Cardinality": "256" } } ], "extra_info": { - "Projections": [ - "#1", - "#2", - "#3", - "#4", - "#5", - "#6", - "#7", - "#8" - ], - "Estimated Cardinality": "16000" + "CTE Name": "__duckdb_delim_79", + "Table Index": "79", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "256" } } ], @@ -1124,18 +1201,19 @@ physical_plan [ "s_phone", "s_comment" ], - "Estimated Cardinality": "16000" + "Estimated Cardinality": "256" } } ], "extra_info": { "Top": "100", "Order By": [ - "memory.main.supplier.s_acctbal DESC", - "memory.main.nation.n_name ASC", - "memory.main.supplier.s_name ASC", - "memory.main.part.p_partkey ASC" - ] + "s_acctbal DESC", + "n_name ASC", + "s_name ASC", + "p_partkey ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q20.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q20.slt.no index 4acdb608857..a331a72280e 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q20.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q20.slt.no @@ -237,7 +237,7 @@ logical_plan [ "(l_partkey = ps_partkey)", "(l_suppkey = ps_suppkey)", "(l_shipdate >= CAST('1994-01-01' AS DATE))", - "(CAST(l_shipdate AS TIMESTAMP) < (CAST('1994-01-01' AS DATE) + to_years(CAST(trunc(CAST('1' AS DOUBLE)) AS INTEGER))))" + "(CAST(l_shipdate AS TIMESTAMP) < ('1994-01-01'::DATE + '1 year'::INTERVAL))" ] } } @@ -254,8 +254,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "SINGLE", - "Conditions": "" + "Expressions": "" } } ], @@ -296,7 +295,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.supplier.s_name" + "Order By": "s_name" } } ] @@ -314,237 +313,305 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "CTE", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "80000" - } - } - ], - "extra_info": { - "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_availqty" - ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "80000" + } + } + ], "extra_info": { - "Filters": "$.p_name like \"forest%\"", - "Function": "Vortex Scan", + "Expressions": [ + "ps_partkey", + "ps_suppkey", + "ps_availqty" + ], + "Estimated Cardinality": "80000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "$.p_name like \"forest%\"", + "Function": "Vortex Scan", + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Expressions": "p_partkey", + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Expressions": "p_partkey", "Estimated Cardinality": "4000" } } ], "extra_info": { - "Expressions": "p_partkey", - "Estimated Cardinality": "4000" + "Join Type": "MARK", + "Conditions": "(ps_partkey = #0)", + "Estimated Cardinality": "80000" } } ], "extra_info": { - "Expressions": "p_partkey", - "Estimated Cardinality": "4000" + "Expressions": "SUBQUERY", + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Join Type": "SEMI", - "Conditions": "(ps_partkey = #0)", + "Expressions": [ + "#0", + "#1", + "#2" + ], "Estimated Cardinality": "16000" } - }, + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", + "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "AGGREGATE", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.l_shipdate >= 1994-01-01)", + "Filters": "(1994-01-01 <= $.l_shipdate < 1995-01-01)", "Function": "Vortex Scan", "Estimated Cardinality": "120114" } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "16000" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" + ], + "Estimated Cardinality": "16000" + } + } + ], + "extra_info": { + "Groups": [ + "#[21.1]", + "#[21.0]" + ], + "Expressions": "", + "Estimated Cardinality": "8000" + } + } + ], + "extra_info": { + "Expressions": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" + ], + "Estimated Cardinality": "8000" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "8000" + } } ], "extra_info": { - "Expressions": "(CAST(l_shipdate AS TIMESTAMP) < '1995-01-01 00:00:00'::TIMESTAMP)", + "Join Type": "SEMI", + "Conditions": [ + "(l_partkey = ps_partkey)", + "(l_suppkey = ps_suppkey)" + ], "Estimated Cardinality": "24022" } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "15999" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(l_partkey = ps_partkey)", - "(l_suppkey = ps_suppkey)" + "Expressions": [ + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "24022" } } ], "extra_info": { - "Expressions": [ - "l_quantity", + "Groups": [ "ps_suppkey", "ps_partkey" ], - "Estimated Cardinality": "4804" + "Expressions": "sum(l_quantity)", + "Estimated Cardinality": "12011" } } ], "extra_info": { "Expressions": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", + "#2" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "12011" } } ], "extra_info": { - "Groups": [ + "Expressions": [ + "(0.5 * sum(l_quantity))", "ps_suppkey", "ps_partkey" ], - "Expressions": "sum(l_quantity)", - "Estimated Cardinality": "2402" + "Estimated Cardinality": "12011" } } ], "extra_info": { - "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", - "#2" + "Join Type": "INNER", + "Conditions": [ + "(ps_suppkey IS NOT DISTINCT FROM ps_suppkey)", + "(ps_partkey IS NOT DISTINCT FROM ps_partkey)" ], - "Estimated Cardinality": "2402" + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Expressions": [ - "(0.5 * sum(l_quantity))", - "ps_suppkey", - "ps_partkey" - ], - "Estimated Cardinality": "2402" + "Expressions": "(CAST(ps_availqty AS DECIMAL(38,3)) > SUBQUERY)", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "(ps_suppkey IS NOT DISTINCT FROM ps_suppkey)", - "(ps_partkey IS NOT DISTINCT FROM ps_partkey)" - ] + "Expressions": "#0", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Expressions": "(CAST(ps_availqty AS DECIMAL(38,3)) > SUBQUERY)", - "Estimated Cardinality": "16000" + "CTE Name": "__duckdb_delim_65", + "Table Index": "65", + "Estimated Cardinality": "3200" } } ], "extra_info": { "Expressions": "ps_suppkey", - "Estimated Cardinality": "16000" + "Estimated Cardinality": "3200" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "s_suppkey", - "s_name", - "s_address", - "s_nationkey" - ], + "Filters": "", + "Function": "Vortex Scan", "Estimated Cardinality": "1000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.n_name = \"CANADA\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "n_nationkey", - "Estimated Cardinality": "1" + "Filters": "($.n_name = \"CANADA\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "5" } } ], @@ -572,7 +639,8 @@ logical_opt [ } ], "extra_info": { - "Order By": "memory.main.supplier.s_name" + "Order By": "s_name", + "Estimated Cardinality": "40" } } ] @@ -584,13 +652,13 @@ physical_plan [ "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "CTE", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "LEFT_DELIM_JOIN", + "name": "FILTER", "children": [ { "name": "HASH_JOIN", @@ -620,19 +688,42 @@ physical_plan [ } ], "extra_info": { - "Join Type": "SEMI", + "Join Type": "MARK", "Conditions": "ps_partkey = #0", - "Estimated Cardinality": "16000" + "Estimated Cardinality": "80000" } - }, + } + ], + "extra_info": { + "Expression": "SUBQUERY", + "Estimated Cardinality": "16000" + } + } + ], + "extra_info": { + "Projections": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "16000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "COLUMN_DATA_SCAN", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Estimated Cardinality": "0" + "CTE Index": "65", + "Estimated Cardinality": "16000" } }, { @@ -651,84 +742,98 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(1994-01-01 <= $.l_shipdate < 1995-01-01)", + "Projections": [ + "l_partkey", + "l_suppkey", + "l_quantity" + ], + "Estimated Cardinality": "120114" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_GROUP_BY", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "65", + "Estimated Cardinality": "16000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.l_shipdate >= 1994-01-01)", "Projections": [ - "l_partkey", - "l_suppkey", - "l_quantity", - "l_shipdate" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Expression": "(CAST(l_shipdate AS TIMESTAMP) < '1995-01-01 00:00:00'::TIMESTAMP)", - "Estimated Cardinality": "24022" + "Projections": [ + "#[21.1]", + "#[21.0]" + ], + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Projections": [ + "Groups": [ "#0", - "#1", - "#2" + "#1" ], - "Estimated Cardinality": "24022" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "15999" + "Aggregates": "", + "Estimated Cardinality": "8000" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "l_partkey = ps_partkey", - "l_suppkey = ps_suppkey" + "Projections": [ + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "8000" } } ], "extra_info": { - "Projections": [ - "l_quantity", - "ps_suppkey", - "ps_partkey" + "Join Type": "SEMI", + "Conditions": [ + "l_partkey = ps_partkey", + "l_suppkey = ps_suppkey" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "24022" } } ], "extra_info": { "Projections": [ - "#0", - "__internal_compress_integral_usmallint(#1, 1)", - "__internal_compress_integral_usmallint(#2, 1)" + "CAST(#0 AS SMALLINT)", + "CAST(#1 AS SMALLINT)", + "#2" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "24022" } } ], @@ -738,7 +843,7 @@ physical_plan [ "ps_partkey", "l_quantity" ], - "Estimated Cardinality": "4804" + "Estimated Cardinality": "24022" } } ], @@ -748,17 +853,17 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "2402" + "Estimated Cardinality": "12011" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", - "__internal_decompress_integral_bigint(#1, 1)", + "CAST(#0 AS BIGINT)", + "CAST(#1 AS BIGINT)", "#2" ], - "Estimated Cardinality": "2402" + "Estimated Cardinality": "12011" } } ], @@ -768,52 +873,37 @@ physical_plan [ "ps_suppkey", "ps_partkey" ], - "Estimated Cardinality": "2402" + "Estimated Cardinality": "12011" } } ], "extra_info": { - "Join Type": "LEFT", + "Join Type": "INNER", "Conditions": [ "ps_suppkey IS NOT DISTINCT FROM ps_suppkey", "ps_partkey IS NOT DISTINCT FROM ps_partkey" ], - "Estimated Cardinality": "0" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": [ - "#1", - "#0" - ], - "Aggregates": "", - "Estimated Cardinality": "15999" + "Estimated Cardinality": "16000" } } ], "extra_info": { - "Join Type": "LEFT", - "Conditions": [ - "ps_suppkey IS NOT DISTINCT FROM ps_suppkey", - "ps_partkey IS NOT DISTINCT FROM ps_partkey" - ], - "Estimated Cardinality": "0", - "Delim Index": "1" + "Expression": "(CAST(ps_availqty AS DECIMAL(38,3)) > SUBQUERY)", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Expression": "(CAST(ps_availqty AS DECIMAL(38,3)) > SUBQUERY)", - "Estimated Cardinality": "16000" + "Projections": "#0", + "Estimated Cardinality": "3200" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "16000" + "CTE Name": "__duckdb_delim_65", + "Table Index": "65", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "3200" } }, { @@ -838,9 +928,9 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "n_name='CANADA'", + "Filters": "($.n_name = \"CANADA\")", "Projections": "n_nationkey", - "Estimated Cardinality": "1" + "Estimated Cardinality": "5" } } ], @@ -859,7 +949,8 @@ physical_plan [ } ], "extra_info": { - "Order By": "memory.main.supplier.s_name ASC" + "Order By": "s_name ASC", + "Estimated Cardinality": "40" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q21.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q21.slt.no index 9c300a6ccac..c3e803957d8 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q21.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q21.slt.no @@ -265,8 +265,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } }, { @@ -341,8 +340,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -376,8 +374,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "count_star()", - "memory.main.supplier.s_name" + "numwait", + "s_name" ] } } @@ -398,64 +396,19 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.l_receiptdate > $.l_commitdate)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "959" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(l_orderkey = l_orderkey)", - "(l_suppkey != l_suppkey)" - ], - "Estimated Cardinality": "1151893" - } - } - ], - "extra_info": { - "Expressions": [ - "l_suppkey", - "l_orderkey" - ], - "Estimated Cardinality": "1151893" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_suppkey", - "l_orderkey" - ], - "Estimated Cardinality": "1151893" + "Filters": "($.o_orderstatus = \"F\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "30000" } }, { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", @@ -464,42 +417,25 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "600572" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "4791" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "(l_orderkey = l_orderkey)", - "(l_suppkey != l_suppkey)" + "Filters": [ + "is_not_null($.l_orderkey)", + "is_not_null($.l_suppkey)", + "($.l_receiptdate > $.l_commitdate)" ], - "Estimated Cardinality": "28773404" + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" } } ], "extra_info": { "Expressions": [ - "l_suppkey", - "l_orderkey" + "l_orderkey", + "l_suppkey" ], - "Estimated Cardinality": "28773404" + "Estimated Cardinality": "120114" } } ], @@ -508,14 +444,14 @@ logical_opt [ "l_suppkey", "l_orderkey" ], - "Estimated Cardinality": "28773404" + "Estimated Cardinality": "120114" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", @@ -524,7 +460,10 @@ logical_opt [ "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.l_receiptdate > $.l_commitdate)", + "Filters": [ + "is_not_null($.l_orderkey)", + "is_not_null($.l_suppkey)" + ], "Function": "Vortex Scan", "Estimated Cardinality": "120114" } @@ -537,37 +476,30 @@ logical_opt [ ], "Estimated Cardinality": "120114" } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.o_orderstatus = \"F\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "6000" - } - } - ], - "extra_info": { - "Expressions": "o_orderkey", - "Estimated Cardinality": "6000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "24022" + "Expressions": [ + "l_suppkey", + "l_orderkey" + ], + "Estimated Cardinality": "120114" } }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.l_receiptdate > $.l_commitdate)", + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -577,54 +509,45 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "1000" } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_name", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { "Filters": "($.n_name = \"SAUDI ARABIA\")", "Function": "Vortex Scan", - "Estimated Cardinality": "1" + "Estimated Cardinality": "5" } } ], "extra_info": { - "Expressions": "n_nationkey", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "200" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "200" + "Conditions": "(l_suppkey = s_suppkey)", + "Estimated Cardinality": "24022" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_suppkey = s_suppkey)", + "Join Type": "RIGHT_SEMI", + "Conditions": [ + "(l_orderkey IS NOT DISTINCT FROM l_orderkey)", + "(l_suppkey IS DISTINCT FROM l_suppkey)" + ], "Estimated Cardinality": "4804" } } ], "extra_info": { - "Join Type": "RIGHT_SEMI", + "Join Type": "RIGHT_ANTI", "Conditions": [ - "(l_suppkey IS NOT DISTINCT FROM l_suppkey)", + "(l_suppkey IS DISTINCT FROM l_suppkey)", "(l_orderkey IS NOT DISTINCT FROM l_orderkey)" ], "Estimated Cardinality": "960" @@ -632,19 +555,16 @@ logical_opt [ } ], "extra_info": { - "Join Type": "RIGHT_ANTI", - "Conditions": [ - "(l_suppkey IS NOT DISTINCT FROM l_suppkey)", - "(l_orderkey IS NOT DISTINCT FROM l_orderkey)" - ], - "Estimated Cardinality": "192" + "Join Type": "INNER", + "Conditions": "(o_orderkey = l_orderkey)", + "Estimated Cardinality": "240" } } ], "extra_info": { "Groups": "s_name", "Expressions": "count_star()", - "Estimated Cardinality": "174" + "Estimated Cardinality": "213" } } ], @@ -653,7 +573,7 @@ logical_opt [ "s_name", "numwait" ], - "Estimated Cardinality": "174" + "Estimated Cardinality": "213" } } ], @@ -674,45 +594,79 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.o_orderstatus = \"F\")", + "Projections": "o_orderkey", + "Estimated Cardinality": "30000" + } + }, + { + "name": "HASH_JOIN", "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": [ + "is_not_null($.l_orderkey)", + "is_not_null($.l_suppkey)", + "($.l_receiptdate > $.l_commitdate)" + ], + "Projections": [ + "l_orderkey", + "l_suppkey" + ], + "Estimated Cardinality": "120114" + } + } + ], + "extra_info": { + "Projections": [ + "l_suppkey", + "l_orderkey" + ], + "Estimated Cardinality": "120114" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "PROJECTION", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "($.l_receiptdate > $.l_commitdate)", + "Filters": [ + "is_not_null($.l_orderkey)", + "is_not_null($.l_suppkey)" + ], "Projections": [ "l_orderkey", "l_suppkey" ], "Estimated Cardinality": "120114" } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "o_orderstatus='F'", - "Projections": "o_orderkey", - "Estimated Cardinality": "6000" - } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "24022" + "Projections": [ + "l_suppkey", + "l_orderkey" + ], + "Estimated Cardinality": "120114" } }, { @@ -723,44 +677,14 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "($.l_receiptdate > $.l_commitdate)", "Projections": [ - "s_suppkey", - "s_name", - "s_nationkey" + "l_orderkey", + "l_suppkey" ], - "Estimated Cardinality": "1000" + "Estimated Cardinality": "120114" } }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "n_name='SAUDI ARABIA'", - "Projections": "n_nationkey", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "200" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "l_suppkey = s_suppkey", - "Estimated Cardinality": "4804" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ { "name": "HASH_JOIN", "children": [ @@ -770,184 +694,85 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "l_orderkey", - "l_suppkey" + "s_suppkey", + "s_name", + "s_nationkey" ], - "Estimated Cardinality": "600572" + "Estimated Cardinality": "1000" } }, { - "name": "DELIM_SCAN", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "4791" + "Function": "Vortex Scan", + "Filters": "($.n_name = \"SAUDI ARABIA\")", + "Projections": "n_nationkey", + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "l_orderkey = l_orderkey", - "l_suppkey != l_suppkey" - ], - "Estimated Cardinality": "28773404" + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Projections": [ - "l_suppkey", - "l_orderkey" - ], - "Estimated Cardinality": "28773404" + "Join Type": "INNER", + "Conditions": "l_suppkey = s_suppkey", + "Estimated Cardinality": "24022" } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} } ], "extra_info": { "Join Type": "RIGHT_SEMI", "Conditions": [ - "l_suppkey IS NOT DISTINCT FROM l_suppkey", - "l_orderkey IS NOT DISTINCT FROM l_orderkey" + "l_orderkey IS NOT DISTINCT FROM l_orderkey", + "l_suppkey IS DISTINCT FROM l_suppkey" ], - "Estimated Cardinality": "960" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": [ - "#1", - "#0" - ], - "Aggregates": "", - "Estimated Cardinality": "4791" - } - } - ], - "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": [ - "l_suppkey IS NOT DISTINCT FROM l_suppkey", - "l_orderkey IS NOT DISTINCT FROM l_orderkey" - ], - "Estimated Cardinality": "960", - "Delim Index": "1" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.l_receiptdate > $.l_commitdate)", - "Projections": [ - "l_orderkey", - "l_suppkey" - ], - "Estimated Cardinality": "120114" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "2", - "Estimated Cardinality": "959" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": [ - "l_orderkey = l_orderkey", - "l_suppkey != l_suppkey" - ], - "Estimated Cardinality": "1151893" - } - } - ], - "extra_info": { - "Projections": [ - "l_suppkey", - "l_orderkey" - ], - "Estimated Cardinality": "1151893" + "Estimated Cardinality": "4804" } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} } ], "extra_info": { "Join Type": "RIGHT_ANTI", "Conditions": [ - "l_suppkey IS NOT DISTINCT FROM l_suppkey", - "l_orderkey IS NOT DISTINCT FROM l_orderkey" + "l_orderkey IS NOT DISTINCT FROM l_orderkey", + "l_suppkey IS DISTINCT FROM l_suppkey" ], - "Estimated Cardinality": "192" - } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": [ - "#1", - "#0" - ], - "Aggregates": "", - "Estimated Cardinality": "959" + "Estimated Cardinality": "960" } } ], "extra_info": { - "Join Type": "RIGHT_ANTI", - "Conditions": [ - "l_suppkey IS NOT DISTINCT FROM l_suppkey", - "l_orderkey IS NOT DISTINCT FROM l_orderkey" - ], - "Estimated Cardinality": "192", - "Delim Index": "2" + "Join Type": "INNER", + "Conditions": "o_orderkey = l_orderkey", + "Estimated Cardinality": "240" } } ], "extra_info": { "Projections": "s_name", - "Estimated Cardinality": "192" + "Estimated Cardinality": "240" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "174" + "Estimated Cardinality": "213" } } ], "extra_info": { "Top": "100", "Order By": [ - "count_star() DESC", - "memory.main.supplier.s_name ASC" - ] + "numwait DESC", + "s_name ASC" + ], + "Estimated Cardinality": "100" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q22.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q22.slt.no index 7d58be6ee32..db5266d0bab 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q22.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q22.slt.no @@ -100,73 +100,50 @@ logical_plan [ "name": "AGGREGATE", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "FILTER", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan" - } - } - ], - "extra_info": { - "Expressions": [ - "c_custkey", - "c_name", - "c_address", - "c_nationkey", - "c_phone", - "c_acctbal", - "c_mktsegment", - "c_comment" - ] - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "(c_acctbal > CAST(0.00 AS DECIMAL(15,2)))", - "(\"substring\"(c_phone, CAST(1 AS BIGINT), CAST(2 AS BIGINT)) IN (CAST('13' AS VARCHAR), CAST('31' AS VARCHAR), CAST('23' AS VARCHAR), CAST('29' AS VARCHAR), CAST('30' AS VARCHAR), CAST('18' AS VARCHAR), CAST('17' AS VARCHAR)))" - ] + "Filters": "", + "Function": "Vortex Scan" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(c_acctbal)" + "Expressions": [ + "c_custkey", + "c_name", + "c_address", + "c_nationkey", + "c_phone", + "c_acctbal", + "c_mktsegment", + "c_comment" + ] } } ], "extra_info": { - "Expressions": "avg(c_acctbal)" + "Expressions": [ + "(c_acctbal > CAST(0.00 AS DECIMAL(15,2)))", + "(\"substring\"(c_phone, CAST(1 AS BIGINT), CAST(2 AS BIGINT)) IN (CAST('13' AS VARCHAR), CAST('31' AS VARCHAR), CAST('23' AS VARCHAR), CAST('29' AS VARCHAR), CAST('30' AS VARCHAR), CAST('18' AS VARCHAR), CAST('17' AS VARCHAR)))" + ] } } ], "extra_info": { "Groups": "", - "Expressions": [ - "\"first\"(#[20.0])", - "count_star()" - ] + "Expressions": "avg(c_acctbal)" } } ], "extra_info": { - "Expressions": [ - "CASE WHEN ((#[39.1] > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #[39.0] END" - ] + "Expressions": "avg(c_acctbal)" } } ], @@ -228,8 +205,7 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], @@ -269,134 +245,179 @@ logical_plan [ } ], "extra_info": { - "Order By": "custsale.cntrycode" + "Order By": "cntrycode" } } ] logical_opt [ { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "ORDER_BY", "children": [ { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "DELIM_JOIN", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "150000" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "2719" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(o_custkey = c_custkey)", - "Estimated Cardinality": "27190" - } - } - ], - "extra_info": { - "Expressions": "c_custkey", - "Estimated Cardinality": "27190" - } - } - ], - "extra_info": { - "Expressions": "c_custkey", - "Estimated Cardinality": "27190" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "15000" + } + }, + { + "name": "CHUNK_GET", + "children": [], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "(\"substring\"(c_phone, 1, 2) = #0)", + "Estimated Cardinality": "15000" + } + } + ], + "extra_info": { + "Expressions": "IN (...)", + "Estimated Cardinality": "3000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.c_acctbal > decimal128(0, precision=15, scale=2))", + "Function": "Vortex Scan", + "Estimated Cardinality": "3000" + } + }, + { + "name": "CHUNK_GET", + "children": [], + "extra_info": { + "Expressions": "", + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "(\"substring\"(c_phone, 1, 2) = #0)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expressions": "IN (...)", + "Estimated Cardinality": "600" + } + } + ], + "extra_info": { + "Expressions": "c_acctbal", + "Estimated Cardinality": "600" + } + } + ], + "extra_info": { + "Groups": "", + "Expressions": [ + "sum(c_acctbal)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Expressions": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(CAST(c_acctbal AS DOUBLE) > SUBQUERY)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "3000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "15000" + "Expressions": [ + "#0", + "#1", + "#2" + ], + "Estimated Cardinality": "3000" } }, { - "name": "CHUNK_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "0" - } - } - ], - "extra_info": { - "Join Type": "MARK", - "Conditions": "(\"substring\"(c_phone, 1, 2) = #0)", - "Estimated Cardinality": "15000" - } - } - ], - "extra_info": { - "Expressions": "IN (...)", - "Estimated Cardinality": "3000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_custkey", - "c_phone", - "c_acctbal" - ], - "Estimated Cardinality": "3000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "AGGREGATE", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", @@ -408,128 +429,214 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "READ_VORTEX", + "name": "CTE_SCAN", "children": [], "extra_info": { - "Filters": "($.c_acctbal > decimal128(0, precision=15, scale=2))", - "Function": "Vortex Scan", + "CTE Index": "49", "Estimated Cardinality": "3000" } }, { - "name": "CHUNK_GET", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "150000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "49", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expressions": "(CAST(#[1.0] AS BIGINT) <= 14999)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Groups": "#[1.0]", + "Expressions": "", + "Estimated Cardinality": "1500" + } + } + ], + "extra_info": { + "Expressions": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1500" + } + } + ], + "extra_info": { + "Expressions": "#0", + "Estimated Cardinality": "1500" + } + } + ], + "extra_info": { + "Join Type": "SEMI", + "Conditions": "(o_custkey = c_custkey)", + "Estimated Cardinality": "30000" + } + } + ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "0" + "Expressions": "c_custkey", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "MARK", - "Conditions": "(\"substring\"(c_phone, 1, 2) = #0)", + "Conditions": "(c_custkey IS NOT DISTINCT FROM c_custkey)", "Estimated Cardinality": "3000" } } ], "extra_info": { - "Expressions": "IN (...)", + "Expressions": "(NOT SUBQUERY)", "Estimated Cardinality": "600" } } ], "extra_info": { - "Expressions": "c_acctbal", + "Expressions": [ + "#0", + "#1" + ], "Estimated Cardinality": "600" } } ], "extra_info": { - "Groups": "", - "Expressions": "avg(c_acctbal)", - "Estimated Cardinality": "1" + "Expressions": [ + "#0", + "#1" + ], + "Estimated Cardinality": "600" } } ], "extra_info": { - "Expressions": "avg(c_acctbal)", - "Estimated Cardinality": "1" + "CTE Name": "__duckdb_delim_49", + "Table Index": "49", + "Estimated Cardinality": "600" } } ], "extra_info": { - "Groups": "", "Expressions": [ - "\"first\"(#0)", - "count_star()" + "cntrycode", + "c_acctbal" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "600" } } ], "extra_info": { "Expressions": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + "__internal_compress_string_uhugeint(#0)", + "#1" ], - "Estimated Cardinality": "1" + "Estimated Cardinality": "600" } } ], "extra_info": { - "Join Type": "INNER", - "Conditions": "(CAST(c_acctbal AS DOUBLE) > SUBQUERY)", - "Estimated Cardinality": "3000" + "Groups": "cntrycode", + "Expressions": [ + "count_star()", + "sum(c_acctbal)" + ], + "Estimated Cardinality": "588" } } ], "extra_info": { - "Join Type": "RIGHT_ANTI", - "Conditions": "(c_custkey IS NOT DISTINCT FROM c_custkey)", - "Estimated Cardinality": "600" + "Expressions": [ + "__internal_decompress_string(#0)", + "#1", + "#2" + ], + "Estimated Cardinality": "588" } } ], "extra_info": { "Expressions": [ "cntrycode", - "c_acctbal" + "numcust", + "totacctbal" ], - "Estimated Cardinality": "600" + "Estimated Cardinality": "588" } } ], "extra_info": { - "Groups": "cntrycode", "Expressions": [ - "count_star()", - "sum(c_acctbal)" + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2" ], "Estimated Cardinality": "588" } } ], "extra_info": { - "Expressions": [ - "cntrycode", - "numcust", - "totacctbal" - ], + "Order By": "cntrycode", "Estimated Cardinality": "588" } } ], "extra_info": { - "Order By": "custsale.cntrycode" + "Expressions": [ + "__internal_decompress_string(#0)", + "#1", + "#2" + ], + "Estimated Cardinality": "588" } } ] physical_plan [ { - "name": "ORDER_BY", + "name": "PROJECTION", "children": [ { - "name": "HASH_GROUP_BY", + "name": "ORDER_BY", "children": [ { "name": "PROJECTION", @@ -538,266 +645,360 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "HASH_GROUP_BY", "children": [ { - "name": "NESTED_LOOP_JOIN", + "name": "PROJECTION", "children": [ { "name": "PROJECTION", "children": [ { - "name": "FILTER", + "name": "PROJECTION", "children": [ { - "name": "HASH_JOIN", + "name": "CTE", "children": [ { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "NESTED_LOOP_JOIN", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "c_custkey", + "c_phone", + "c_acctbal" + ], + "Estimated Cardinality": "15000" + } + }, + { + "name": "COLUMN_DATA_SCAN", + "children": [], + "extra_info": { + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "\"substring\"(c_phone, 1, 2) = #0", + "Estimated Cardinality": "15000" + } + } + ], + "extra_info": { + "Expression": "IN (...)", + "Estimated Cardinality": "3000" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "UNGROUPED_AGGREGATE", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.c_acctbal > decimal128(0, precision=15, scale=2))", + "Projections": [ + "c_phone", + "c_acctbal" + ], + "Estimated Cardinality": "3000" + } + }, + { + "name": "COLUMN_DATA_SCAN", + "children": [], + "extra_info": { + "Estimated Cardinality": "7" + } + } + ], + "extra_info": { + "Join Type": "MARK", + "Conditions": "\"substring\"(c_phone, 1, 2) = #0", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expression": "IN (...)", + "Estimated Cardinality": "600" + } + } + ], + "extra_info": { + "Projections": "c_acctbal", + "Estimated Cardinality": "600" + } + } + ], + "extra_info": { + "Projections": "c_acctbal", + "Estimated Cardinality": "600" + } + } + ], + "extra_info": { + "Aggregates": [ + "sum(#0)", + "count_star()" + ], + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Projections": "\"/\"(CAST(#0 AS DOUBLE), CAST(#1 AS DOUBLE))", + "Estimated Cardinality": "1" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "CAST(c_acctbal AS DOUBLE) > SUBQUERY", + "Estimated Cardinality": "3000" + } + } + ], "extra_info": { - "Function": "Vortex Scan", "Projections": [ - "c_custkey", - "c_phone", - "c_acctbal" + "#0", + "#1", + "#2" ], - "Estimated Cardinality": "15000" + "Estimated Cardinality": "3000" } }, { - "name": "COLUMN_DATA_SCAN", - "children": [], - "extra_info": { - "Estimated Cardinality": "0" - } - } - ], - "extra_info": { - "Join Type": "MARK", - "Conditions": "\"substring\"(c_phone, 1, 2) = #0", - "Estimated Cardinality": "15000" - } - } - ], - "extra_info": { - "Expression": "IN (...)", - "Estimated Cardinality": "3000" - } - } - ], - "extra_info": { - "Projections": [ - "c_custkey", - "c_phone", - "c_acctbal" - ], - "Estimated Cardinality": "3000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "UNGROUPED_AGGREGATE", + "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "FILTER", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "49", + "Estimated Cardinality": "3000" + } + }, + { + "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": "o_custkey", + "Estimated Cardinality": "150000" + } + }, + { + "name": "PROJECTION", "children": [ { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.c_acctbal > decimal128(0, precision=15, scale=2))", - "Projections": [ - "c_phone", - "c_acctbal" - ], - "Estimated Cardinality": "3000" - } - }, - { - "name": "COLUMN_DATA_SCAN", - "children": [], + "name": "HASH_GROUP_BY", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "FILTER", + "children": [ + { + "name": "CTE_SCAN", + "children": [], + "extra_info": { + "CTE Index": "49", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Expression": "(CAST(#[1.0] AS BIGINT) <= 14999)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Projections": "#0", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Projections": "CAST(#0 AS SMALLINT)", + "Estimated Cardinality": "3000" + } + } + ], + "extra_info": { + "Projections": "#[1.0]", + "Estimated Cardinality": "3000" + } + } + ], "extra_info": { - "Estimated Cardinality": "0" + "Groups": "#0", + "Aggregates": "", + "Estimated Cardinality": "1500" } } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "\"substring\"(c_phone, 1, 2) = #0", - "Estimated Cardinality": "3000" + "Projections": "CAST(#0 AS BIGINT)", + "Estimated Cardinality": "1500" } } ], "extra_info": { - "Expression": "IN (...)", - "Estimated Cardinality": "600" + "Join Type": "SEMI", + "Conditions": "o_custkey = c_custkey", + "Estimated Cardinality": "30000" } } ], "extra_info": { - "Projections": "c_acctbal", - "Estimated Cardinality": "600" + "Join Type": "MARK", + "Conditions": "c_custkey IS NOT DISTINCT FROM c_custkey", + "Estimated Cardinality": "3000" } } ], "extra_info": { - "Projections": "c_acctbal", + "Expression": "(NOT SUBQUERY)", "Estimated Cardinality": "600" } } ], "extra_info": { - "Aggregates": "avg(#0)" + "Projections": [ + "#0", + "#1" + ], + "Estimated Cardinality": "600" } } ], "extra_info": { - "Projections": "#0", - "Estimated Cardinality": "1" + "CTE Name": "__duckdb_delim_49", + "Table Index": "49", + "Execution Mode": "PIPELINE_DEPENDENT", + "Estimated Cardinality": "600" } } ], "extra_info": { - "Aggregates": [ - "\"first\"(#0)", - "count_star()" - ] + "Projections": [ + "cntrycode", + "c_acctbal" + ], + "Estimated Cardinality": "600" } } ], "extra_info": { "Projections": [ - "CASE WHEN ((#1 > 1)) THEN (\"error\"('More than one row returned by a subquery used as an expression - scalar subqueries can only return a single row.", - "Use \"SET scalar_subquery_error_on_multiple_rows=false\" to revert to previous behavior of returning a random row.')) ELSE #0 END" + "__internal_compress_string_uhugeint(#0)", + "#1" ], - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "CAST(c_acctbal AS DOUBLE) > SUBQUERY", - "Estimated Cardinality": "3000" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": "o_custkey", - "Estimated Cardinality": "150000" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "2719" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "o_custkey = c_custkey", - "Estimated Cardinality": "27190" - } - } - ], - "extra_info": { - "Projections": "c_custkey", - "Estimated Cardinality": "27190" + "Estimated Cardinality": "600" } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} } ], "extra_info": { - "Join Type": "RIGHT_ANTI", - "Conditions": "c_custkey IS NOT DISTINCT FROM c_custkey", + "Projections": [ + "cntrycode", + "c_acctbal" + ], "Estimated Cardinality": "600" } - }, - { - "name": "HASH_GROUP_BY", - "children": [], - "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "2719" - } } ], "extra_info": { - "Join Type": "RIGHT_ANTI", - "Conditions": "c_custkey IS NOT DISTINCT FROM c_custkey", - "Estimated Cardinality": "600", - "Delim Index": "1" + "Groups": "#0", + "Aggregates": [ + "count_star()", + "sum(#1)" + ], + "Estimated Cardinality": "588" } } ], "extra_info": { "Projections": [ - "cntrycode", - "c_acctbal" + "__internal_decompress_string(#0)", + "#1", + "#2" ], - "Estimated Cardinality": "600" + "Estimated Cardinality": "588" } } ], "extra_info": { "Projections": [ - "cntrycode", - "c_acctbal" + "__internal_compress_string_uhugeint(#0)", + "#1", + "#2" ], - "Estimated Cardinality": "600" + "Estimated Cardinality": "588" } } ], "extra_info": { - "Groups": "#0", - "Aggregates": [ - "count_star()", - "sum(#1)" - ], + "Order By": "cntrycode ASC", "Estimated Cardinality": "588" } } ], "extra_info": { - "Order By": "custsale.cntrycode ASC" + "Projections": [ + "__internal_decompress_string(#0)", + "#1", + "#2" + ], + "Estimated Cardinality": "588" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q3.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q3.slt.no index e58ec988b16..5baf29e7337 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q3.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q3.slt.no @@ -177,8 +177,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount)))", - "memory.main.orders.o_orderdate" + "revenue", + "o_orderdate" ] } } @@ -208,24 +208,11 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.l_shipdate > 1995-03-15)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_orderkey", - "l_extendedprice", - "l_discount" - ], + "Filters": "($.l_shipdate > 1995-03-15)", + "Function": "Vortex Scan", "Estimated Cardinality": "120114" } }, @@ -233,47 +220,24 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.o_orderdate < 1995-03-15)", - "Function": "Vortex Scan", - "Estimated Cardinality": "30000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey", - "o_orderdate", - "o_shippriority" - ], + "Filters": "($.o_orderdate < 1995-03-15)", + "Function": "Vortex Scan", "Estimated Cardinality": "30000" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": [ - "($.c_mktsegment = \"BUILDING\")", - "($.c_custkey <= 14999i64)" - ], - "Function": "Vortex Scan", - "Estimated Cardinality": "600" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": "c_custkey", - "Estimated Cardinality": "600" + "Filters": [ + "($.c_mktsegment = \"BUILDING\")", + "($.c_custkey <= 14999i64)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "3000" } } ], @@ -287,7 +251,7 @@ logical_opt [ "extra_info": { "Join Type": "INNER", "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "24022" + "Estimated Cardinality": "6000" } } ], @@ -295,11 +259,11 @@ logical_opt [ "Expressions": [ "#0", "#1", - "__internal_compress_integral_uinteger(#2, 1)", + "CAST(#2 AS INTEGER)", "#3", - "__internal_compress_integral_utinyint(#4, 0)" + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "6000" } } ], @@ -310,18 +274,18 @@ logical_opt [ "o_shippriority" ], "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], "extra_info": { "Expressions": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "__internal_decompress_integral_integer(#2, 0)", + "CAST(#2 AS INTEGER)", "#3" ], - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], @@ -332,7 +296,7 @@ logical_opt [ "o_orderdate", "o_shippriority" ], - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], @@ -401,9 +365,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "c_mktsegment='BUILDING'", + "Filters": [ + "($.c_mktsegment = \"BUILDING\")", + "($.c_custkey <= 14999i64)" + ], "Projections": "c_custkey", - "Estimated Cardinality": "600" + "Estimated Cardinality": "3000" } } ], @@ -417,7 +384,7 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "24022" + "Estimated Cardinality": "6000" } } ], @@ -425,11 +392,11 @@ physical_plan [ "Projections": [ "#0", "#1", - "__internal_compress_integral_uinteger(#2, 1)", + "CAST(#2 AS INTEGER)", "#3", - "__internal_compress_integral_utinyint(#4, 0)" + "CAST(#4 AS TINYINT)" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "6000" } } ], @@ -440,7 +407,7 @@ physical_plan [ "o_shippriority", "(l_extendedprice * (1.00 - l_discount))" ], - "Estimated Cardinality": "24022" + "Estimated Cardinality": "6000" } } ], @@ -451,18 +418,18 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], "extra_info": { "Projections": [ - "__internal_decompress_integral_bigint(#0, 1)", + "CAST(#0 AS BIGINT)", "#1", - "__internal_decompress_integral_integer(#2, 0)", + "CAST(#2 AS INTEGER)", "#3" ], - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], @@ -473,16 +440,17 @@ physical_plan [ "o_orderdate", "o_shippriority" ], - "Estimated Cardinality": "24021" + "Estimated Cardinality": "5999" } } ], "extra_info": { "Top": "10", "Order By": [ - "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount))) DESC", - "memory.main.orders.o_orderdate ASC" - ] + "revenue DESC", + "o_orderdate ASC" + ], + "Estimated Cardinality": "10" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q4.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q4.slt.no index 573e0b7ec9e..686c5f5ad3b 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q4.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q4.slt.no @@ -138,15 +138,14 @@ logical_plan [ } ], "extra_info": { - "Join Type": "MARK", - "Conditions": "" + "Expressions": "" } } ], "extra_info": { "Expressions": [ "(o_orderdate >= CAST('1993-07-01' AS DATE))", - "(CAST(o_orderdate AS TIMESTAMP) < (CAST('1993-07-01' AS DATE) + to_months(CAST(trunc(CAST('3' AS DOUBLE)) AS INTEGER))))", + "(CAST(o_orderdate AS TIMESTAMP) < ('1993-07-01'::DATE + '3 months'::INTERVAL))", "SUBQUERY" ] } @@ -167,7 +166,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "memory.main.orders.o_orderpriority" + "Order By": "o_orderpriority" } } ] @@ -182,7 +181,7 @@ logical_opt [ "name": "AGGREGATE", "children": [ { - "name": "DELIM_JOIN", + "name": "COMPARISON_JOIN", "children": [ { "name": "PROJECTION", @@ -191,86 +190,50 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.l_commitdate < $.l_receiptdate)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - }, - { - "name": "DELIM_GET", - "children": [], - "extra_info": { - "Expressions": "", - "Estimated Cardinality": "5438" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "21772" + "Filters": [ + "is_not_null($.l_orderkey)", + "($.l_commitdate < $.l_receiptdate)" + ], + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" } } ], "extra_info": { - "Expressions": "o_orderkey", - "Estimated Cardinality": "21772" + "Expressions": "l_orderkey", + "Estimated Cardinality": "120114" } } ], "extra_info": { "Expressions": "o_orderkey", - "Estimated Cardinality": "21772" + "Estimated Cardinality": "120114" } }, { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.o_orderdate >= 1993-07-01)", - "Function": "Vortex Scan", - "Estimated Cardinality": "30000" - } - } - ], - "extra_info": { - "Expressions": "(CAST(o_orderdate AS TIMESTAMP) < '1993-10-01 00:00:00'::TIMESTAMP)", - "Estimated Cardinality": "6000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_orderpriority" - ], - "Estimated Cardinality": "6000" + "Filters": "(1993-07-01 <= $.o_orderdate < 1993-10-01)", + "Function": "Vortex Scan", + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "RIGHT_SEMI", "Conditions": "(o_orderkey IS NOT DISTINCT FROM o_orderkey)", - "Estimated Cardinality": "1200" + "Estimated Cardinality": "6000" } } ], "extra_info": { "Groups": "o_orderpriority", "Expressions": "count_star()", - "Estimated Cardinality": "1176" + "Estimated Cardinality": "5438" } } ], @@ -279,12 +242,13 @@ logical_opt [ "o_orderpriority", "order_count" ], - "Estimated Cardinality": "1176" + "Estimated Cardinality": "5438" } } ], "extra_info": { - "Order By": "memory.main.orders.o_orderpriority" + "Order By": "o_orderpriority", + "Estimated Cardinality": "5438" } } ] @@ -299,128 +263,58 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "RIGHT_DELIM_JOIN", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "FILTER", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.o_orderdate >= 1993-07-01)", - "Projections": [ - "o_orderkey", - "o_orderdate", - "o_orderpriority" - ], - "Estimated Cardinality": "30000" - } - } - ], - "extra_info": { - "Expression": "(CAST(o_orderdate AS TIMESTAMP) < '1993-10-01 00:00:00'::TIMESTAMP)", - "Estimated Cardinality": "6000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Projections": [ - "#0", - "#2" + "Function": "Vortex Scan", + "Filters": [ + "is_not_null($.l_orderkey)", + "($.l_commitdate < $.l_receiptdate)" ], - "Estimated Cardinality": "6000" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.l_commitdate < $.l_receiptdate)", - "Projections": "l_orderkey", - "Estimated Cardinality": "120114" - } - }, - { - "name": "DELIM_SCAN", - "children": [], - "extra_info": { - "Delim Index": "1", - "Estimated Cardinality": "5438" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "21772" - } - } - ], - "extra_info": { - "Projections": "o_orderkey", - "Estimated Cardinality": "21772" - } - }, - { - "name": "DUMMY_SCAN", - "children": [], - "extra_info": {} - } - ], - "extra_info": { - "Join Type": "RIGHT_SEMI", - "Conditions": "o_orderkey IS NOT DISTINCT FROM o_orderkey", - "Estimated Cardinality": "1200" + "Projections": "l_orderkey", + "Estimated Cardinality": "120114" } }, { - "name": "HASH_GROUP_BY", + "name": "READ_VORTEX", "children": [], "extra_info": { - "Groups": "#0", - "Aggregates": "", - "Estimated Cardinality": "5438" + "Function": "Vortex Scan", + "Filters": "(1993-07-01 <= $.o_orderdate < 1993-10-01)", + "Projections": [ + "o_orderkey", + "o_orderpriority" + ], + "Estimated Cardinality": "30000" } } ], "extra_info": { "Join Type": "RIGHT_SEMI", "Conditions": "o_orderkey IS NOT DISTINCT FROM o_orderkey", - "Estimated Cardinality": "1200", - "Delim Index": "1" + "Estimated Cardinality": "6000" } } ], "extra_info": { "Projections": "o_orderpriority", - "Estimated Cardinality": "1200" + "Estimated Cardinality": "6000" } } ], "extra_info": { "Groups": "#0", "Aggregates": "count_star()", - "Estimated Cardinality": "1176" + "Estimated Cardinality": "5438" } } ], "extra_info": { - "Order By": "memory.main.orders.o_orderpriority ASC" + "Order By": "o_orderpriority ASC", + "Estimated Cardinality": "5438" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q5.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q5.slt.no index c2fc67f83a4..367bb75a0cd 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q5.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q5.slt.no @@ -261,7 +261,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount)))" + "Order By": "revenue" } } ] @@ -273,219 +273,120 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "AGGREGATE", "children": [ { - "name": "AGGREGATE", + "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "600572" + } + }, { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(1994-01-01 <= $.o_orderdate < 1995-01-01)", + "Function": "Vortex Scan", + "Estimated Cardinality": "30000" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "600572" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Expressions": [ - "l_orderkey", - "l_suppkey", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "600572" + "Filters": "($.c_custkey <= 14999i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "15000" } }, { "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name", - "n_regionkey" - ], - "Estimated Cardinality": "25" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.r_name = \"ASIA\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Expressions": "r_regionkey", - "Estimated Cardinality": "1" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(n_regionkey = r_regionkey)", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_suppkey = s_suppkey)", - "Estimated Cardinality": "600572" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", "children": [ { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "(1994-01-01 <= $.o_orderdate < 1995-01-01)", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "30000" + "Estimated Cardinality": "25" } - } - ], - "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey" - ], - "Estimated Cardinality": "30000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "($.c_custkey <= 14999i64)", + "Filters": "($.r_name = \"ASIA\")", "Function": "Vortex Scan", - "Estimated Cardinality": "15000" + "Estimated Cardinality": "1" } } ], "extra_info": { - "Expressions": [ - "c_custkey", - "c_nationkey" - ], - "Estimated Cardinality": "15000" + "Join Type": "INNER", + "Conditions": "(n_regionkey = r_regionkey)", + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(o_custkey = c_custkey)", - "Estimated Cardinality": "30000" + "Conditions": "(c_nationkey = n_nationkey)", + "Estimated Cardinality": "3000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "(n_nationkey = c_nationkey)", - "(l_orderkey = o_orderkey)" - ], - "Estimated Cardinality": "600572" + "Conditions": "(o_custkey = c_custkey)", + "Estimated Cardinality": "6000" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1", - "#2", - "__internal_compress_integral_uinteger(#3, 1)", - "__internal_compress_integral_utinyint(#4, 0)" - ], - "Estimated Cardinality": "600572" + "Join Type": "INNER", + "Conditions": "(l_orderkey = o_orderkey)", + "Estimated Cardinality": "6005" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Groups": "n_name", - "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", - "Estimated Cardinality": "15000" + "Join Type": "INNER", + "Conditions": [ + "(c_nationkey = s_nationkey)", + "(l_suppkey = s_suppkey)" + ], + "Estimated Cardinality": "6005" } } ], "extra_info": { - "Expressions": [ - "#0", - "#1" - ], - "Estimated Cardinality": "15000" + "Groups": "n_name", + "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", + "Estimated Cardinality": "25" } } ], @@ -494,12 +395,13 @@ logical_opt [ "n_name", "revenue" ], - "Estimated Cardinality": "15000" + "Estimated Cardinality": "25" } } ], "extra_info": { - "Order By": "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount)))" + "Order By": "revenue", + "Estimated Cardinality": "25" } } ] @@ -514,11 +416,25 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "l_orderkey", + "l_suppkey", + "l_extendedprice", + "l_discount" + ], + "Estimated Cardinality": "600572" + } + }, { "name": "HASH_JOIN", "children": [ @@ -527,13 +443,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "(1994-01-01 <= $.o_orderdate < 1995-01-01)", "Projections": [ - "l_orderkey", - "l_suppkey", - "l_extendedprice", - "l_discount" + "o_orderkey", + "o_custkey" ], - "Estimated Cardinality": "600572" + "Estimated Cardinality": "30000" } }, { @@ -544,11 +459,12 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", + "Filters": "($.c_custkey <= 14999i64)", "Projections": [ - "s_suppkey", - "s_nationkey" + "c_custkey", + "c_nationkey" ], - "Estimated Cardinality": "1000" + "Estimated Cardinality": "15000" } }, { @@ -572,7 +488,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "r_name='ASIA'", + "Filters": "($.r_name = \"ASIA\")", "Projections": "r_regionkey", "Estimated Cardinality": "1" } @@ -581,79 +497,50 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "n_regionkey = r_regionkey", - "Estimated Cardinality": "25" + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "l_suppkey = s_suppkey", - "Estimated Cardinality": "600572" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1994-01-01 <= $.o_orderdate < 1995-01-01)", - "Projections": [ - "o_orderkey", - "o_custkey" - ], - "Estimated Cardinality": "30000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.c_custkey <= 14999i64)", - "Projections": [ - "c_custkey", - "c_nationkey" - ], - "Estimated Cardinality": "15000" + "Conditions": "c_nationkey = n_nationkey", + "Estimated Cardinality": "3000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "o_custkey = c_custkey", - "Estimated Cardinality": "30000" + "Estimated Cardinality": "6000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": [ - "n_nationkey = c_nationkey", - "l_orderkey = o_orderkey" + "Conditions": "l_orderkey = o_orderkey", + "Estimated Cardinality": "6005" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_nationkey" ], - "Estimated Cardinality": "600572" + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Projections": [ - "#0", - "#1", - "#2", - "__internal_compress_integral_uinteger(#3, 1)", - "__internal_compress_integral_utinyint(#4, 0)" + "Join Type": "INNER", + "Conditions": [ + "c_nationkey = s_nationkey", + "l_suppkey = s_suppkey" ], - "Estimated Cardinality": "600572" + "Estimated Cardinality": "6005" } } ], @@ -662,19 +549,20 @@ physical_plan [ "n_name", "(l_extendedprice * (1.00 - l_discount))" ], - "Estimated Cardinality": "600572" + "Estimated Cardinality": "6005" } } ], "extra_info": { "Groups": "#0", "Aggregates": "sum(#1)", - "Estimated Cardinality": "15000" + "Estimated Cardinality": "25" } } ], "extra_info": { - "Order By": "sum((memory.main.lineitem.l_extendedprice * (1 - memory.main.lineitem.l_discount))) DESC" + "Order By": "revenue DESC", + "Estimated Cardinality": "25" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q6.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q6.slt.no index 76c25e2587c..028e19bdb0f 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q6.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q6.slt.no @@ -157,7 +157,8 @@ physical_plan [ } ], "extra_info": { - "Aggregates": "sum(#0)" + "Aggregates": "sum(#0)", + "Estimated Cardinality": "1" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q7.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q7.slt.no index 096bdb725dc..2c3d097dec6 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q7.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q7.slt.no @@ -296,9 +296,9 @@ logical_plan [ ], "extra_info": { "Order By": [ - "shipping.supp_nation", - "shipping.cust_nation", - "shipping.l_year" + "supp_nation", + "cust_nation", + "l_year" ] } } @@ -326,225 +326,122 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "COMPARISON_JOIN", "children": [ { - "name": "FILTER", + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "150000" + } + }, + { + "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(1995-01-01 <= $.l_shipdate <= 1996-12-31)", + "Function": "Vortex Scan", + "Estimated Cardinality": "120114" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(1995-01-01 <= $.l_shipdate <= 1996-12-31)", - "Function": "Vortex Scan", - "Estimated Cardinality": "120114" - } - } - ], - "extra_info": { - "Expressions": [ - "l_orderkey", - "l_suppkey", - "l_extendedprice", - "l_discount", - "l_shipdate" - ], - "Estimated Cardinality": "120114" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(($.n_name = \"FRANCE\") or ($.n_name = \"GERMANY\"))", - "Function": "Vortex Scan", - "Estimated Cardinality": "5" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "5" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_suppkey = s_suppkey)", - "Estimated Cardinality": "120114" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" } }, { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "150000" - } - } - ], - "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey" - ], - "Estimated Cardinality": "150000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.c_custkey <= 14999i64)", - "Function": "Vortex Scan", - "Estimated Cardinality": "15000" - } - } - ], - "extra_info": { - "Expressions": [ - "c_custkey", - "c_nationkey" - ], - "Estimated Cardinality": "15000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "(($.n_name = \"GERMANY\") or ($.n_name = \"FRANCE\"))", - "Function": "Vortex Scan", - "Estimated Cardinality": "5" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "5" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(c_nationkey = n_nationkey)", - "Estimated Cardinality": "15000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(o_custkey = c_custkey)", - "Estimated Cardinality": "150000" + "Filters": "(($.n_name = \"FRANCE\") or ($.n_name = \"GERMANY\"))", + "Function": "Vortex Scan", + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "150000" + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "200" } } ], "extra_info": { - "Expressions": "(((n_name = 'FRANCE') AND (n_name = 'GERMANY')) OR ((n_name = 'GERMANY') AND (n_name = 'FRANCE')))", - "Estimated Cardinality": "150000" + "Join Type": "INNER", + "Conditions": "(l_suppkey = s_suppkey)", + "Estimated Cardinality": "24022" } } ], "extra_info": { - "Expressions": "", - "Estimated Cardinality": "150000" + "Join Type": "INNER", + "Conditions": "(o_orderkey = l_orderkey)", + "Estimated Cardinality": "24022" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.c_custkey <= 14999i64)", + "Function": "Vortex Scan", + "Estimated Cardinality": "15000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "(($.n_name = \"GERMANY\") or ($.n_name = \"FRANCE\"))", + "Function": "Vortex Scan", + "Estimated Cardinality": "5" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(c_nationkey = n_nationkey)", + "Estimated Cardinality": "3000" } } ], "extra_info": { - "Expressions": [ - "supp_nation", - "cust_nation", - "l_year", - "volume" + "Join Type": "INNER", + "Conditions": [ + "(o_custkey = c_custkey)", + "(((n_name = 'FRANCE') AND (n_name = 'GERMANY')) OR ((n_name = 'GERMANY') AND (n_name = 'FRANCE')))" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "960" } } ], "extra_info": { "Expressions": [ + "#3", "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1992)", - "#3" + "#2", + "#4" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "960" } } ], @@ -552,10 +449,10 @@ logical_opt [ "Groups": [ "supp_nation", "cust_nation", - "l_year" + "__internal_compress_integral_utinyint(\"year\"(l_shipdate), 1992)" ], - "Expressions": "sum(volume)", - "Estimated Cardinality": "149999" + "Expressions": "sum((l_extendedprice * (1.00 - l_discount)))", + "Estimated Cardinality": "951" } } ], @@ -566,7 +463,7 @@ logical_opt [ "__internal_decompress_integral_bigint(#2, 1992)", "#3" ], - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], @@ -577,7 +474,7 @@ logical_opt [ "l_year", "revenue" ], - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], @@ -588,16 +485,17 @@ logical_opt [ "__internal_compress_integral_utinyint(#2, 1992)", "#3" ], - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], "extra_info": { "Order By": [ - "shipping.supp_nation", - "shipping.cust_nation", - "shipping.l_year" - ] + "supp_nation", + "cust_nation", + "l_year" + ], + "Estimated Cardinality": "951" } } ], @@ -607,7 +505,8 @@ logical_opt [ "#1", "__internal_decompress_integral_bigint(#2, 1992)", "#3" - ] + ], + "Estimated Cardinality": "951" } } ] @@ -634,72 +533,39 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "FILTER", + "name": "HASH_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "o_orderkey", + "o_custkey" + ], + "Estimated Cardinality": "150000" + } + }, { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(1995-01-01 <= $.l_shipdate <= 1996-12-31)", - "Projections": [ - "l_orderkey", - "l_suppkey", - "l_extendedprice", - "l_discount", - "l_shipdate" - ], - "Estimated Cardinality": "120114" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(($.n_name = \"FRANCE\") or ($.n_name = \"GERMANY\"))", - "Projections": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "5" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_suppkey = s_suppkey", + "Function": "Vortex Scan", + "Filters": "(1995-01-01 <= $.l_shipdate <= 1996-12-31)", + "Projections": [ + "l_orderkey", + "l_suppkey", + "l_extendedprice", + "l_discount", + "l_shipdate" + ], "Estimated Cardinality": "120114" } }, @@ -712,88 +578,102 @@ physical_plan [ "extra_info": { "Function": "Vortex Scan", "Projections": [ - "o_orderkey", - "o_custkey" + "s_suppkey", + "s_nationkey" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "1000" } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "($.c_custkey <= 14999i64)", - "Projections": [ - "c_custkey", - "c_nationkey" - ], - "Estimated Cardinality": "15000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "(($.n_name = \"GERMANY\") or ($.n_name = \"FRANCE\"))", - "Projections": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "5" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "c_nationkey = n_nationkey", - "Estimated Cardinality": "15000" + "Function": "Vortex Scan", + "Filters": "(($.n_name = \"FRANCE\") or ($.n_name = \"GERMANY\"))", + "Projections": [ + "n_nationkey", + "n_name" + ], + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "o_custkey = c_custkey", - "Estimated Cardinality": "150000" + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "200" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "150000" + "Conditions": "l_suppkey = s_suppkey", + "Estimated Cardinality": "24022" } } ], "extra_info": { - "Expression": "(((n_name = 'FRANCE') AND (n_name = 'GERMANY')) OR ((n_name = 'GERMANY') AND (n_name = 'FRANCE')))", - "Estimated Cardinality": "150000" + "Join Type": "INNER", + "Conditions": "o_orderkey = l_orderkey", + "Estimated Cardinality": "24022" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.c_custkey <= 14999i64)", + "Projections": [ + "c_custkey", + "c_nationkey" + ], + "Estimated Cardinality": "15000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "(($.n_name = \"GERMANY\") or ($.n_name = \"FRANCE\"))", + "Projections": [ + "n_nationkey", + "n_name" + ], + "Estimated Cardinality": "5" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "c_nationkey = n_nationkey", + "Estimated Cardinality": "3000" } } ], "extra_info": { - "Projections": [ - "supp_nation", - "cust_nation", - "l_year", - "volume" + "Join Type": "INNER", + "Conditions": [ + "o_custkey = c_custkey", + "(((n_name = 'FRANCE') AND (n_name = 'GERMANY')) OR ((n_name = 'GERMANY') AND (n_name = 'FRANCE')))" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "960" } } ], "extra_info": { "Projections": [ + "#3", "#0", "#1", - "__internal_compress_integral_utinyint(#2, 1992)", - "#3" + "#2", + "#4" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "960" } } ], @@ -801,10 +681,10 @@ physical_plan [ "Projections": [ "supp_nation", "cust_nation", - "l_year", + "__internal_compress_integral_utinyint(\"year\"(l_shipdate), 1992)", "volume" ], - "Estimated Cardinality": "150000" + "Estimated Cardinality": "960" } } ], @@ -815,7 +695,7 @@ physical_plan [ "#2" ], "Aggregates": "sum(#3)", - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], @@ -826,7 +706,7 @@ physical_plan [ "__internal_decompress_integral_bigint(#2, 1992)", "#3" ], - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], @@ -837,16 +717,17 @@ physical_plan [ "__internal_compress_integral_utinyint(#2, 1992)", "#3" ], - "Estimated Cardinality": "149999" + "Estimated Cardinality": "951" } } ], "extra_info": { "Order By": [ - "shipping.supp_nation ASC", - "shipping.cust_nation ASC", - "shipping.l_year ASC" - ] + "supp_nation ASC", + "cust_nation ASC", + "l_year ASC" + ], + "Estimated Cardinality": "951" } } ], @@ -857,7 +738,7 @@ physical_plan [ "__internal_decompress_integral_bigint(#2, 1992)", "#3" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "951" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q8.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q8.slt.no index f98a3dfc3bd..5395e5057b0 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q8.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q8.slt.no @@ -354,7 +354,7 @@ logical_plan [ } ], "extra_info": { - "Order By": "all_nations.o_year" + "Order By": "o_year" } } ] @@ -381,7 +381,7 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", @@ -390,121 +390,16 @@ logical_opt [ "name": "COMPARISON_JOIN", "children": [ { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "600572" - } - } - ], - "extra_info": { - "Expressions": [ - "l_orderkey", - "l_partkey", - "l_suppkey", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "($.p_type = \"ECONOMY ANODIZED STEEL\")", - "Function": "Vortex Scan", - "Estimated Cardinality": "800" - } - } - ], - "extra_info": { - "Expressions": "p_partkey", - "Estimated Cardinality": "800" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_partkey = p_partkey)", - "Estimated Cardinality": "120114" + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "600572" } }, { "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_suppkey = s_suppkey)", - "Estimated Cardinality": "120114" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", "children": [ { "name": "READ_VORTEX", @@ -514,22 +409,9 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "30000" } - } - ], - "extra_info": { - "Expressions": [ - "o_orderkey", - "o_custkey", - "o_orderdate" - ], - "Estimated Cardinality": "30000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -539,21 +421,9 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "15000" } - } - ], - "extra_info": { - "Expressions": [ - "c_custkey", - "c_nationkey" - ], - "Estimated Cardinality": "15000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -563,19 +433,7 @@ logical_opt [ "Function": "Vortex Scan", "Estimated Cardinality": "25" } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_regionkey" - ], - "Estimated Cardinality": "25" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], @@ -587,66 +445,123 @@ logical_opt [ } ], "extra_info": { - "Expressions": "r_regionkey", - "Estimated Cardinality": "1" + "Join Type": "INNER", + "Conditions": "(n_regionkey = r_regionkey)", + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(n_regionkey = r_regionkey)", - "Estimated Cardinality": "25" + "Conditions": "(c_nationkey = n_nationkey)", + "Estimated Cardinality": "3000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(c_nationkey = n_nationkey)", - "Estimated Cardinality": "15000" + "Conditions": "(o_custkey = c_custkey)", + "Estimated Cardinality": "6000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(o_custkey = c_custkey)", - "Estimated Cardinality": "30000" + "Conditions": "(l_orderkey = o_orderkey)", + "Estimated Cardinality": "6005" + } + }, + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "($.p_type = \"ECONOMY ANODIZED STEEL\")", + "Function": "Vortex Scan", + "Estimated Cardinality": "4000" + } + } + ], + "extra_info": { + "Expressions": "p_partkey", + "Estimated Cardinality": "4000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "120114" + "Conditions": "(l_partkey = p_partkey)", + "Estimated Cardinality": "1201" + } + }, + { + "name": "COMPARISON_JOIN", + "children": [ + { + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "1000" + } + } + ], + "extra_info": { + "Expressions": [ + "s_suppkey", + "s_nationkey" + ], + "Estimated Cardinality": "1000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "25" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Expressions": [ - "o_year", - "volume", - "nation" - ], - "Estimated Cardinality": "120114" + "Join Type": "INNER", + "Conditions": "(l_suppkey = s_suppkey)", + "Estimated Cardinality": "1201" } } ], "extra_info": { "Expressions": [ - "__internal_compress_integral_utinyint(#0, 1992)", + "#0", "#1", - "#2" + "#2", + "#3" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "1201" } } ], "extra_info": { - "Groups": "o_year", + "Groups": "__internal_compress_integral_utinyint(\"year\"(o_orderdate), 1992)", "Expressions": [ - "sum(CASE WHEN ((nation = 'BRAZIL')) THEN (volume) ELSE 0.0000 END)", - "sum(volume)" + "sum(CASE WHEN ((nation = 'BRAZIL')) THEN ((l_extendedprice * (1.00 - l_discount))) ELSE 0.0000 END)", + "sum((l_extendedprice * (1.00 - l_discount)))" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], @@ -656,7 +571,7 @@ logical_opt [ "#1", "#2" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], @@ -665,7 +580,7 @@ logical_opt [ "o_year", "mkt_share" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], @@ -674,12 +589,13 @@ logical_opt [ "__internal_compress_integral_utinyint(#0, 1992)", "#1" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], "extra_info": { - "Order By": "all_nations.o_year" + "Order By": "o_year", + "Estimated Cardinality": "945" } } ], @@ -687,7 +603,8 @@ logical_opt [ "Expressions": [ "__internal_decompress_integral_bigint(#0, 1992)", "#1" - ] + ], + "Estimated Cardinality": "945" } } ] @@ -714,91 +631,27 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "l_orderkey", - "l_partkey", - "l_suppkey", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Filters": "p_type='ECONOMY ANODIZED STEEL'", - "Projections": "p_partkey", - "Estimated Cardinality": "800" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "l_partkey = p_partkey", - "Estimated Cardinality": "120114" - } - }, - { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_suppkey = s_suppkey", - "Estimated Cardinality": "120114" + "Function": "Vortex Scan", + "Projections": [ + "l_orderkey", + "l_partkey", + "l_suppkey", + "l_extendedprice", + "l_discount" + ], + "Estimated Cardinality": "600572" } }, { @@ -854,7 +707,7 @@ physical_plan [ "children": [], "extra_info": { "Function": "Vortex Scan", - "Filters": "r_name='AMERICA'", + "Filters": "($.r_name = \"AMERICA\")", "Projections": "r_regionkey", "Estimated Cardinality": "1" } @@ -863,58 +716,96 @@ physical_plan [ "extra_info": { "Join Type": "INNER", "Conditions": "n_regionkey = r_regionkey", - "Estimated Cardinality": "25" + "Estimated Cardinality": "5" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "c_nationkey = n_nationkey", - "Estimated Cardinality": "15000" + "Estimated Cardinality": "3000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "o_custkey = c_custkey", - "Estimated Cardinality": "30000" + "Estimated Cardinality": "6000" } } ], "extra_info": { "Join Type": "INNER", "Conditions": "l_orderkey = o_orderkey", - "Estimated Cardinality": "120114" + "Estimated Cardinality": "6005" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Filters": "($.p_type = \"ECONOMY ANODIZED STEEL\")", + "Projections": "p_partkey", + "Estimated Cardinality": "4000" } } ], "extra_info": { - "Projections": [ - "o_year", - "volume", - "nation" - ], - "Estimated Cardinality": "120114" + "Join Type": "INNER", + "Conditions": "l_partkey = p_partkey", + "Estimated Cardinality": "1201" + } + }, + { + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_nationkey" + ], + "Estimated Cardinality": "1000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "n_nationkey", + "n_name" + ], + "Estimated Cardinality": "25" + } + } + ], + "extra_info": { + "Join Type": "INNER", + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "1000" } } ], "extra_info": { - "Projections": [ - "__internal_compress_integral_utinyint(#0, 1992)", - "#1", - "#2" - ], - "Estimated Cardinality": "120114" + "Join Type": "INNER", + "Conditions": "l_suppkey = s_suppkey", + "Estimated Cardinality": "1201" } } ], "extra_info": { "Projections": [ - "o_year", - "CASE WHEN ((nation = 'BRAZIL')) THEN (volume) ELSE 0.0000 END", + "__internal_compress_integral_utinyint(\"year\"(o_orderdate), 1992)", + "CASE WHEN ((nation = 'BRAZIL')) THEN ((l_extendedprice * (1.00 - l_discount))) ELSE 0.0000 END", "volume" ], - "Estimated Cardinality": "120114" + "Estimated Cardinality": "1201" } } ], @@ -923,7 +814,8 @@ physical_plan [ "Aggregates": [ "sum(#1)", "sum(#2)" - ] + ], + "Estimated Cardinality": "945" } } ], @@ -933,7 +825,7 @@ physical_plan [ "#1", "#2" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], @@ -942,7 +834,7 @@ physical_plan [ "o_year", "mkt_share" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], @@ -951,12 +843,13 @@ physical_plan [ "__internal_compress_integral_utinyint(#0, 1992)", "#1" ], - "Estimated Cardinality": "3999" + "Estimated Cardinality": "945" } } ], "extra_info": { - "Order By": "all_nations.o_year ASC" + "Order By": "o_year ASC", + "Estimated Cardinality": "945" } } ], @@ -965,7 +858,7 @@ physical_plan [ "__internal_decompress_integral_bigint(#0, 1992)", "#1" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "945" } } ] diff --git a/vortex-sqllogictest/slt/tpch/duckdb/plans/q9.slt.no b/vortex-sqllogictest/slt/tpch/duckdb/plans/q9.slt.no index b24548b9f66..4b3dc80db90 100644 --- a/vortex-sqllogictest/slt/tpch/duckdb/plans/q9.slt.no +++ b/vortex-sqllogictest/slt/tpch/duckdb/plans/q9.slt.no @@ -287,8 +287,8 @@ logical_plan [ ], "extra_info": { "Order By": [ - "profit.nation", - "profit.o_year" + "nation", + "o_year" ] } } @@ -316,16 +316,25 @@ logical_opt [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "COMPARISON_JOIN", "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "600572" + } + }, { "name": "COMPARISON_JOIN", "children": [ { - "name": "PROJECTION", + "name": "COMPARISON_JOIN", "children": [ { "name": "READ_VORTEX", @@ -333,53 +342,34 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "600572" + "Estimated Cardinality": "80000" } - } - ], - "extra_info": { - "Expressions": [ - "l_orderkey", - "l_partkey", - "l_suppkey", - "l_quantity", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { - "name": "READ_VORTEX", - "children": [], + "name": "PROJECTION", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "$.p_name like \"%green%\"", + "Function": "Vortex Scan", + "Estimated Cardinality": "4000" + } + } + ], "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "150000" + "Expressions": "p_partkey", + "Estimated Cardinality": "4000" } } ], "extra_info": { - "Expressions": [ - "o_orderkey", - "o_orderdate" - ], - "Estimated Cardinality": "150000" + "Join Type": "INNER", + "Conditions": "(ps_partkey = p_partkey)", + "Estimated Cardinality": "16000" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(l_orderkey = o_orderkey)", - "Estimated Cardinality": "600572" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ + }, { "name": "COMPARISON_JOIN", "children": [ @@ -392,101 +382,39 @@ logical_opt [ "extra_info": { "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "80000" + "Estimated Cardinality": "1000" } } ], "extra_info": { "Expressions": [ - "ps_partkey", - "ps_suppkey", - "ps_supplycost" + "s_suppkey", + "s_nationkey" ], - "Estimated Cardinality": "80000" - } - }, - { - "name": "COMPARISON_JOIN", - "children": [ - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "1000" - } - } - ], - "extra_info": { - "Expressions": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "PROJECTION", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Filters": "", - "Function": "Vortex Scan", - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Expressions": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(s_nationkey = n_nationkey)", "Estimated Cardinality": "1000" } - } - ], - "extra_info": { - "Join Type": "INNER", - "Conditions": "(ps_suppkey = s_suppkey)", - "Estimated Cardinality": "80000" - } - }, - { - "name": "PROJECTION", - "children": [ + }, { "name": "READ_VORTEX", "children": [], "extra_info": { - "Filters": "$.p_name like \"%green%\"", + "Filters": "", "Function": "Vortex Scan", - "Estimated Cardinality": "4000" + "Estimated Cardinality": "25" } } ], "extra_info": { - "Expressions": "p_partkey", - "Estimated Cardinality": "4000" + "Join Type": "INNER", + "Conditions": "(s_nationkey = n_nationkey)", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "(ps_partkey = p_partkey)", - "Estimated Cardinality": "80000" + "Conditions": "(ps_suppkey = s_suppkey)", + "Estimated Cardinality": "16000" } } ], @@ -494,39 +422,48 @@ logical_opt [ "Join Type": "INNER", "Conditions": [ "(l_partkey = p_partkey)", - "(l_suppkey = ps_suppkey)" + "(l_suppkey = s_suppkey)" ], - "Estimated Cardinality": "12011439" + "Estimated Cardinality": "120114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Filters": "", + "Function": "Vortex Scan", + "Estimated Cardinality": "150000" } } ], "extra_info": { - "Expressions": [ - "nation", - "o_year", - "amount" - ], - "Estimated Cardinality": "12011439" + "Join Type": "INNER", + "Conditions": "(l_orderkey = o_orderkey)", + "Estimated Cardinality": "30028" } } ], "extra_info": { "Expressions": [ + "#3", + "#4", "#0", - "__internal_compress_integral_utinyint(#1, 1992)", - "#2" + "#1", + "#2", + "#5" ], - "Estimated Cardinality": "12011439" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Groups": [ "nation", - "o_year" + "__internal_compress_integral_utinyint(\"year\"(o_orderdate), 1992)" ], - "Expressions": "sum(amount)", - "Estimated Cardinality": "8303119" + "Expressions": "sum((CAST((l_extendedprice * (1.00 - l_discount)) AS DECIMAL(19,4)) - CAST((ps_supplycost * l_quantity) AS DECIMAL(19,4))))", + "Estimated Cardinality": "23356" } } ], @@ -536,7 +473,7 @@ logical_opt [ "__internal_decompress_integral_bigint(#1, 1992)", "#2" ], - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], @@ -546,7 +483,7 @@ logical_opt [ "o_year", "sum_profit" ], - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], @@ -556,15 +493,16 @@ logical_opt [ "__internal_compress_integral_utinyint(#1, 1992)", "#2" ], - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], "extra_info": { "Order By": [ - "profit.nation", - "profit.o_year" - ] + "nation", + "o_year" + ], + "Estimated Cardinality": "23356" } } ], @@ -573,7 +511,8 @@ logical_opt [ "#0", "__internal_decompress_integral_bigint(#1, 1992)", "#2" - ] + ], + "Estimated Cardinality": "23356" } } ] @@ -600,46 +539,24 @@ physical_plan [ "name": "PROJECTION", "children": [ { - "name": "PROJECTION", + "name": "HASH_JOIN", "children": [ { "name": "HASH_JOIN", "children": [ { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "l_orderkey", - "l_partkey", - "l_suppkey", - "l_quantity", - "l_extendedprice", - "l_discount" - ], - "Estimated Cardinality": "600572" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "o_orderkey", - "o_orderdate" - ], - "Estimated Cardinality": "150000" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "l_orderkey = o_orderkey", + "Function": "Vortex Scan", + "Projections": [ + "l_orderkey", + "l_partkey", + "l_suppkey", + "l_quantity", + "l_extendedprice", + "l_discount" + ], "Estimated Cardinality": "600572" } }, @@ -663,61 +580,61 @@ physical_plan [ } }, { - "name": "HASH_JOIN", - "children": [ - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "s_suppkey", - "s_nationkey" - ], - "Estimated Cardinality": "1000" - } - }, - { - "name": "READ_VORTEX", - "children": [], - "extra_info": { - "Function": "Vortex Scan", - "Projections": [ - "n_nationkey", - "n_name" - ], - "Estimated Cardinality": "25" - } - } - ], + "name": "READ_VORTEX", + "children": [], "extra_info": { - "Join Type": "INNER", - "Conditions": "s_nationkey = n_nationkey", - "Estimated Cardinality": "1000" + "Function": "Vortex Scan", + "Filters": "$.p_name like \"%green%\"", + "Projections": "p_partkey", + "Estimated Cardinality": "4000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ps_suppkey = s_suppkey", - "Estimated Cardinality": "80000" + "Conditions": "ps_partkey = p_partkey", + "Estimated Cardinality": "16000" } }, { - "name": "READ_VORTEX", - "children": [], + "name": "HASH_JOIN", + "children": [ + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "s_suppkey", + "s_nationkey" + ], + "Estimated Cardinality": "1000" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "n_nationkey", + "n_name" + ], + "Estimated Cardinality": "25" + } + } + ], "extra_info": { - "Function": "Vortex Scan", - "Filters": "$.p_name like \"%green%\"", - "Projections": "p_partkey", - "Estimated Cardinality": "4000" + "Join Type": "INNER", + "Conditions": "s_nationkey = n_nationkey", + "Estimated Cardinality": "1000" } } ], "extra_info": { "Join Type": "INNER", - "Conditions": "ps_partkey = p_partkey", - "Estimated Cardinality": "80000" + "Conditions": "ps_suppkey = s_suppkey", + "Estimated Cardinality": "16000" } } ], @@ -725,39 +642,51 @@ physical_plan [ "Join Type": "INNER", "Conditions": [ "l_partkey = p_partkey", - "l_suppkey = ps_suppkey" + "l_suppkey = s_suppkey" + ], + "Estimated Cardinality": "120114" + } + }, + { + "name": "READ_VORTEX", + "children": [], + "extra_info": { + "Function": "Vortex Scan", + "Projections": [ + "o_orderkey", + "o_orderdate" ], - "Estimated Cardinality": "12011439" + "Estimated Cardinality": "150000" } } ], "extra_info": { - "Projections": [ - "nation", - "o_year", - "amount" - ], - "Estimated Cardinality": "12011439" + "Join Type": "INNER", + "Conditions": "l_orderkey = o_orderkey", + "Estimated Cardinality": "30028" } } ], "extra_info": { "Projections": [ + "#3", + "#4", "#0", - "__internal_compress_integral_utinyint(#1, 1992)", - "#2" + "#1", + "#2", + "#5" ], - "Estimated Cardinality": "12011439" + "Estimated Cardinality": "30028" } } ], "extra_info": { "Projections": [ "nation", - "o_year", + "__internal_compress_integral_utinyint(\"year\"(o_orderdate), 1992)", "amount" ], - "Estimated Cardinality": "12011439" + "Estimated Cardinality": "30028" } } ], @@ -767,7 +696,7 @@ physical_plan [ "#1" ], "Aggregates": "sum(#2)", - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], @@ -777,7 +706,7 @@ physical_plan [ "__internal_decompress_integral_bigint(#1, 1992)", "#2" ], - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], @@ -787,15 +716,16 @@ physical_plan [ "__internal_compress_integral_utinyint(#1, 1992)", "#2" ], - "Estimated Cardinality": "8303119" + "Estimated Cardinality": "23356" } } ], "extra_info": { "Order By": [ - "profit.nation ASC", - "profit.o_year DESC" - ] + "nation ASC", + "o_year DESC" + ], + "Estimated Cardinality": "23356" } } ], @@ -805,7 +735,7 @@ physical_plan [ "__internal_decompress_integral_bigint(#1, 1992)", "#2" ], - "Estimated Cardinality": "0" + "Estimated Cardinality": "23356" } } ]