Skip to content

Fixed computation of ByteSize for CBO for OLAP tables #9626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions ydb/core/kqp/ut/join/data/queries/tpch8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pragma TablePathPrefix = "/Root/";

-- TPC-H/TPC-R National Market Share Query (Q8)
-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
-- using 1680793381 as a seed to the RNG

select
o_year,
sum(case
when nation = 'MOZAMBIQUE' then volume
else 0
end) / sum(volume) as mkt_share
from
(
select
DateTime::GetYear(o_orderdate) as o_year,
l_extendedprice * (1 - l_discount) as volume,
n2.n_name as nation
from
part
cross join supplier
cross join lineitem
cross join orders
cross join customer
cross join nation n1
cross join nation n2
cross join region
where
p_partkey = l_partkey
and s_suppkey = l_suppkey
and l_orderkey = o_orderkey
and o_custkey = c_custkey
and c_nationkey = n1.n_nationkey
and n1.n_regionkey = r_regionkey
and r_name = 'AFRICA'
and s_nationkey = n2.n_nationkey
and o_orderdate between date('1995-01-01') and date('1996-12-31')
and p_type = 'ECONOMY PLATED COPPER'
) as all_nations
group by
o_year
order by
o_year;
Loading
Loading