import file=tpch_schema
----

import file=tpch_stats
----

# --------------------------------------------------
# Q8
# National Market Share
# Determines how the market share of a given nation within a given region has
# changed over two years for a given part type.
#
# The market share for a given nation within a given region is defined as the
# fraction of the revenue, the sum of [l_extendedprice * (1-l_discount)], from
# the products of a specified type in that region that was supplied by suppliers
# from the given nation. The query determines this for the years 1995 and 1996
# presented in this order.
# --------------------------------------------------
stats-quality database=tpch set=save_tables_prefix=q8
SELECT
    o_year,
    sum(CASE
        WHEN nation = 'BRAZIL'
            THEN volume
        ELSE 0
    END) / sum(volume) AS mkt_share
FROM (
    SELECT
        extract(year FROM o_orderdate) AS o_year,
        l_extendedprice * (1 - l_discount) AS volume,
        n2.n_name AS nation
    FROM
        part,
        supplier,
        lineitem,
        orders,
        customer,
        nation n1,
        nation n2,
        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 = 'AMERICA'
        AND s_nationkey = n2.n_nationkey
        AND o_orderdate BETWEEN DATE '1995-01-01' AND DATE '1996-12-31'
        AND p_type = 'ECONOMY ANODIZED STEEL'
    ) AS all_nations
GROUP BY
    o_year
ORDER BY
    o_year;
----
----
sort
 ├── save-table-name: q8_sort_1
 ├── columns: o_year:77(float) mkt_share:82(float!null)
 ├── immutable
 ├── stats: [rows=728.9954, distinct(77)=728.995, null(77)=0, distinct(82)=728.995, null(82)=0]
 ├── key: (77)
 ├── fd: (77)-->(82)
 ├── ordering: +77
 └── project
      ├── save-table-name: q8_project_2
      ├── columns: mkt_share:82(float!null) o_year:77(float)
      ├── immutable
      ├── stats: [rows=728.9954, distinct(77)=728.995, null(77)=0, distinct(82)=728.995, null(82)=0]
      ├── key: (77)
      ├── fd: (77)-->(82)
      ├── group-by (hash)
      │    ├── save-table-name: q8_group_by_3
      │    ├── columns: o_year:77(float) sum:80(float!null) sum:81(float!null)
      │    ├── grouping columns: o_year:77(float)
      │    ├── immutable
      │    ├── stats: [rows=728.9954, distinct(77)=728.995, null(77)=0, distinct(80)=728.995, null(80)=0, distinct(81)=728.995, null(81)=0, distinct(80,81)=728.995, null(80,81)=0]
      │    ├── key: (77)
      │    ├── fd: (77)-->(80,81)
      │    ├── project
      │    │    ├── save-table-name: q8_project_4
      │    │    ├── columns: column79:79(float!null) o_year:77(float) volume:78(float!null)
      │    │    ├── immutable
      │    │    ├── stats: [rows=4312.133, distinct(77)=728.995, null(77)=0, distinct(78)=4278.28, null(78)=0, distinct(79)=4295.19, null(79)=0]
      │    │    ├── project
      │    │    │    ├── save-table-name: q8_project_5
      │    │    │    ├── columns: o_year:77(float) volume:78(float!null) n2.n_name:67(char!null)
      │    │    │    ├── immutable
      │    │    │    ├── stats: [rows=4312.133, distinct(67)=25, null(67)=0, distinct(77)=728.995, null(77)=0, distinct(78)=4278.28, null(78)=0, distinct(67,78)=4295.19, null(67,78)=0]
      │    │    │    ├── inner-join (hash)
      │    │    │    │    ├── save-table-name: q8_inner_join_6
      │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null) c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) n2.n_nationkey:66(int!null) n2.n_name:67(char!null) r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more)
      │    │    │    │    ├── stats: [rows=4312.133, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(12)=3497.16, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=4233.58, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=3497.16, null(23)=0, distinct(26)=4275.82, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=4233.58, null(39)=0, distinct(40)=3992.96, null(40)=0, distinct(43)=728.995, null(43)=0, distinct(50)=3992.96, null(50)=0, distinct(53)=5, null(53)=0, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(66)=25, null(66)=0, distinct(67)=25, null(67)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0, distinct(26,27)=4278.28, null(26,27)=0, distinct(26,27,67)=4295.19, null(26,27,67)=0]
      │    │    │    │    ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (66)-->(67), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (15)==(66), (66)==(15), (1)==(22), (22)==(1)
      │    │    │    │    ├── inner-join (hash)
      │    │    │    │    │    ├── save-table-name: q8_inner_join_7
      │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) s_suppkey:12(int!null) s_nationkey:15(int!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null) c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one)
      │    │    │    │    │    ├── stats: [rows=4130.162, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(12)=3378.25, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=4058.69, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=3378.25, null(23)=0, distinct(26)=4102.07, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=4058.69, null(39)=0, distinct(40)=3836.73, null(40)=0, distinct(43)=728.429, null(43)=0, distinct(50)=3836.73, null(50)=0, distinct(53)=5, null(53)=0, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0]
      │    │    │    │    │    ├── fd: ()-->(5,73), (12)-->(15), (39)-->(40,43), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (12)==(23), (23)==(12), (1)==(22), (22)==(1)
      │    │    │    │    │    ├── scan supplier@s_nk
      │    │    │    │    │    │    ├── save-table-name: q8_scan_8
      │    │    │    │    │    │    ├── columns: s_suppkey:12(int!null) s_nationkey:15(int!null)
      │    │    │    │    │    │    ├── stats: [rows=10000, distinct(12)=9920, null(12)=0, distinct(15)=25, null(15)=0]
      │    │    │    │    │    │    │   histogram(12)=  0           0            0  1  49  1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1   49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    49   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50   1    50    1    0           0
      │    │    │    │    │    │    │                 <--- -9223372036854775808 --- 1 ---- 51 ---- 101 ---- 151 ---- 201 ---- 251 ---- 301 ---- 351 ---- 401 ---- 451 ---- 501 ---- 551 ---- 601 ---- 651 ---- 701 ---- 751 ---- 801 ---- 851 ---- 901 ---- 951 ---- 1001 ---- 1051 ---- 1101 ---- 1151 ---- 1201 ---- 1251 ---- 1301 ---- 1351 ---- 1401 ---- 1451 ---- 1501 ---- 1551 ---- 1601 ---- 1651 ---- 1701 ---- 1751 ---- 1801 ---- 1851 ---- 1901 ---- 1951 ---- 2001 ---- 2051 ---- 2101 ---- 2151 ---- 2201 ---- 2251 ---- 2301 ---- 2351 ---- 2401 ---- 2451 ---- 2501 ---- 2551 ---- 2601 ---- 2651 ---- 2701 ---- 2751 ---- 2801 ---- 2851 ---- 2901 ---- 2951 ---- 3001 ---- 3051 ---- 3101 ---- 3151 ---- 3201 ---- 3251 ---- 3301 ---- 3351 ---- 3401 ---- 3451 ---- 3501 ---- 3551 ---- 3601 ---- 3651 ---- 3701 ---- 3751 ---- 3801 ---- 3851 ---- 3901 ---- 3951 ---- 4001 ---- 4051 ---- 4101 ---- 4151 ---- 4201 ---- 4251 ---- 4301 ---- 4351 ---- 4401 ---- 4451 ---- 4501 ---- 4551 ---- 4601 ---- 4651 ---- 4701 ---- 4751 ---- 4801 ---- 4851 ---- 4901 ---- 4951 ---- 5001 ---- 5051 ---- 5101 ---- 5151 ---- 5201 ---- 5251 ---- 5301 ---- 5351 ---- 5401 ---- 5451 ---- 5501 ---- 5551 ---- 5601 ---- 5651 ---- 5701 ---- 5751 ---- 5801 ---- 5851 ---- 5901 ---- 5951 ---- 6001 ---- 6051 ---- 6101 ---- 6151 ---- 6201 ---- 6251 ---- 6301 ---- 6351 ---- 6401 ---- 6451 ---- 6501 ---- 6551 ---- 6601 ---- 6651 ---- 6701 ---- 6751 ---- 6801 ---- 6851 ---- 6901 ---- 6951 ---- 7001 ---- 7051 ---- 7101 ---- 7151 ---- 7201 ---- 7251 ---- 7301 ---- 7351 ---- 7401 ---- 7451 ---- 7501 ---- 7552 ---- 7603 ---- 7654 ---- 7705 ---- 7756 ---- 7807 ---- 7858 ---- 7909 ---- 7960 ---- 8011 ---- 8062 ---- 8113 ---- 8164 ---- 8215 ---- 8266 ---- 8317 ---- 8368 ---- 8419 ---- 8470 ---- 8521 ---- 8572 ---- 8623 ---- 8674 ---- 8725 ---- 8776 ---- 8827 ---- 8878 ---- 8929 ---- 8980 ---- 9031 ---- 9082 ---- 9133 ---- 9184 ---- 9235 ---- 9286 ---- 9337 ---- 9388 ---- 9439 ---- 9490 ---- 9541 ---- 9592 ---- 9643 ---- 9694 ---- 9745 ---- 9796 ---- 9847 ---- 9898 ---- 9949 ---- 10000 --- 9223372036854775807
      │    │    │    │    │    │    │   histogram(15)=  0 420 0 413 0 397 0 412 0 415 0 380 0 402 0 396 0 415 0 405 0 393  0 438  0 377  0 362  0 376  0 373  0 406  0 421  0 407  0 398  0 411  0 399  0 401  0 390  0 393
      │    │    │    │    │    │    │                 <--- 0 --- 1 --- 2 --- 3 --- 4 --- 5 --- 6 --- 7 --- 8 --- 9 --- 10 --- 11 --- 12 --- 13 --- 14 --- 15 --- 16 --- 17 --- 18 --- 19 --- 20 --- 21 --- 22 --- 23 --- 24
      │    │    │    │    │    │    ├── key: (12)
      │    │    │    │    │    │    └── fd: (12)-->(15)
      │    │    │    │    │    ├── inner-join (hash)
      │    │    │    │    │    │    ├── save-table-name: q8_inner_join_9
      │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null) c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    │    ├── multiplicity: left-rows(zero-or-more), right-rows(zero-or-one)
      │    │    │    │    │    │    ├── stats: [rows=3879.949, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(21)=3817.47, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=3211.15, null(23)=0, distinct(26)=3861.68, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=3817.47, null(39)=0, distinct(40)=3620.23, null(40)=0, distinct(43)=727.379, null(43)=0, distinct(50)=3620.23, null(50)=0, distinct(53)=5, null(53)=0, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0]
      │    │    │    │    │    │    ├── fd: ()-->(5,73), (39)-->(40,43), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53), (40)==(50), (50)==(40), (21)==(39), (39)==(21), (1)==(22), (22)==(1)
      │    │    │    │    │    │    ├── inner-join (lookup customer@c_nk)
      │    │    │    │    │    │    │    ├── save-table-name: q8_lookup_join_10
      │    │    │    │    │    │    │    ├── columns: c_custkey:50(int!null) c_nationkey:53(int!null) n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    │    │    ├── key columns: [60] = [53]
      │    │    │    │    │    │    │    ├── stats: [rows=30000, distinct(50)=27672.3, null(50)=0, distinct(53)=5, null(53)=0, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0]
      │    │    │    │    │    │    │    ├── key: (50)
      │    │    │    │    │    │    │    ├── fd: ()-->(73), (50)-->(53), (60)-->(62), (62)==(72), (72)==(62), (53)==(60), (60)==(53)
      │    │    │    │    │    │    │    ├── inner-join (lookup nation@n_rk [as=n1])
      │    │    │    │    │    │    │    │    ├── save-table-name: q8_lookup_join_11
      │    │    │    │    │    │    │    │    ├── columns: n1.n_nationkey:60(int!null) n1.n_regionkey:62(int!null) r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    │    │    │    ├── key columns: [72] = [62]
      │    │    │    │    │    │    │    │    ├── stats: [rows=5, distinct(60)=5, null(60)=0, distinct(62)=1, null(62)=0, distinct(72)=1, null(72)=0, distinct(73)=0.996222, null(73)=0]
      │    │    │    │    │    │    │    │    ├── key: (60)
      │    │    │    │    │    │    │    │    ├── fd: ()-->(73), (60)-->(62), (62)==(72), (72)==(62)
      │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    │    ├── save-table-name: q8_select_12
      │    │    │    │    │    │    │    │    │    ├── columns: r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    │    │    │    │    ├── stats: [rows=1, distinct(72)=1, null(72)=0, distinct(73)=1, null(73)=0]
      │    │    │    │    │    │    │    │    │    │   histogram(73)=  0      1
      │    │    │    │    │    │    │    │    │    │                 <--- 'AMERICA'
      │    │    │    │    │    │    │    │    │    ├── key: (72)
      │    │    │    │    │    │    │    │    │    ├── fd: ()-->(73)
      │    │    │    │    │    │    │    │    │    ├── scan region
      │    │    │    │    │    │    │    │    │    │    ├── save-table-name: q8_scan_13
      │    │    │    │    │    │    │    │    │    │    ├── columns: r_regionkey:72(int!null) r_name:73(char!null)
      │    │    │    │    │    │    │    │    │    │    ├── stats: [rows=5, distinct(72)=5, null(72)=0, distinct(73)=5, null(73)=0]
      │    │    │    │    │    │    │    │    │    │    │   histogram(72)=  0  1  0  1  0  1  0  1  0  1
      │    │    │    │    │    │    │    │    │    │    │                 <--- 0 --- 1 --- 2 --- 3 --- 4
      │    │    │    │    │    │    │    │    │    │    │   histogram(73)=  0     1      3        1
      │    │    │    │    │    │    │    │    │    │    │                 <--- 'AFRICA' --- 'MIDDLE EAST'
      │    │    │    │    │    │    │    │    │    │    ├── key: (72)
      │    │    │    │    │    │    │    │    │    │    └── fd: (72)-->(73)
      │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │    │         └── r_name:73 = 'AMERICA' [type=bool, outer=(73), constraints=(/73: [/'AMERICA' - /'AMERICA']; tight), fd=()-->(73)]
      │    │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    ├── inner-join (lookup orders)
      │    │    │    │    │    │    │    ├── save-table-name: q8_lookup_join_14
      │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null) o_orderkey:39(int!null) o_custkey:40(int!null) o_orderdate:43(date!null)
      │    │    │    │    │    │    │    ├── key columns: [21] = [39]
      │    │    │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    ├── stats: [rows=12014.85, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(21)=11858.5, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=6965.36, null(23)=0, distinct(26)=11924.3, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=11858.5, null(39)=0, distinct(40)=11317.3, null(40)=0, distinct(43)=731, null(43)=0]
      │    │    │    │    │    │    │    ├── fd: ()-->(5), (39)-->(40,43), (21)==(39), (39)==(21), (1)==(22), (22)==(1)
      │    │    │    │    │    │    │    ├── inner-join (lookup lineitem)
      │    │    │    │    │    │    │    │    ├── save-table-name: q8_lookup_join_15
      │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_extendedprice:26(float!null) l_discount:27(float!null)
      │    │    │    │    │    │    │    │    ├── key columns: [21 24] = [21 24]
      │    │    │    │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │    ├── stats: [rows=40108.95, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(21)=39587, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(23)=9746, null(23)=0, distinct(26)=39252.8, null(26)=0, distinct(27)=11, null(27)=0]
      │    │    │    │    │    │    │    │    ├── fd: ()-->(5), (1)==(22), (22)==(1)
      │    │    │    │    │    │    │    │    ├── inner-join (lookup lineitem@l_pk)
      │    │    │    │    │    │    │    │    │    ├── save-table-name: q8_lookup_join_16
      │    │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_linenumber:24(int!null)
      │    │    │    │    │    │    │    │    │    ├── key columns: [1] = [22]
      │    │    │    │    │    │    │    │    │    ├── stats: [rows=40108.95, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0, distinct(21)=39587, null(21)=0, distinct(22)=1331.6, null(22)=0, distinct(24)=7, null(24)=0]
      │    │    │    │    │    │    │    │    │    ├── key: (21,24)
      │    │    │    │    │    │    │    │    │    ├── fd: ()-->(5), (21,24)-->(22), (1)==(22), (22)==(1)
      │    │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    │    │    ├── save-table-name: q8_select_17
      │    │    │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null)
      │    │    │    │    │    │    │    │    │    │    ├── stats: [rows=1331.622, distinct(1)=1331.6, null(1)=0, distinct(5)=1, null(5)=0]
      │    │    │    │    │    │    │    │    │    │    │   histogram(5)=  0           1331.6
      │    │    │    │    │    │    │    │    │    │    │                <--- 'ECONOMY ANODIZED STEEL'
      │    │    │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │    │    │    ├── fd: ()-->(5)
      │    │    │    │    │    │    │    │    │    │    ├── scan part
      │    │    │    │    │    │    │    │    │    │    │    ├── save-table-name: q8_scan_18
      │    │    │    │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_type:5(varchar!null)
      │    │    │    │    │    │    │    │    │    │    │    ├── stats: [rows=200000, distinct(1)=199241, null(1)=0, distinct(5)=150, null(5)=0]
      │    │    │    │    │    │    │    │    │    │    │    │   histogram(1)=  0 3.9982 929.57 3.9982 1135.5 3.9982 923.58 3.9982 1036.5 3.9982 964.56 3.9982 953.56 3.9982 899.59 3.9982 1152.5 3.9982 1118.5 3.9982 1137.5 3.9982  1129.5 3.9982  1136.5 3.9982  983.55 3.9982  983.55 3.9982  1028.5 3.9982  1007.5 3.9982  1036.5 3.9982  884.59 3.9982  985.55 3.9982  970.55 3.9982  1036.5 3.9982  943.57 3.9982  1020.5 3.9982  1001.5 3.9982  1001.5 3.9982  954.56 3.9982  1036.5 3.9982  990.54 3.9982  928.57 3.9982  1010.5 3.9982  892.59 3.9982  960.56 3.9982  1059.5 3.9982  947.56 3.9982  906.58 3.9982  935.57 3.9982  860.6 3.9982  971.55 3.9982  1067.5 3.9982  994.54 3.9982  961.56 3.9982  943.57 3.9982  901.59 3.9982  972.55 3.9982  956.56 3.9982  1106.5 3.9982  1152.5 3.9982  967.55 3.9982  943.57 3.9982  916.58 3.9982  1076.5 3.9982  933.57 3.9982  1108.5 3.9982  1081.5 3.9982  975.55 3.9982  1021.5 3.9982  1034.5 3.9982  905.58 3.9982  902.58 3.9982  966.56 3.9982  1080.5 3.9982  927.57 3.9982  936.57 3.9982  1008.5 3.9982  1033.5 3.9982  903.58 3.9982  944.57 3.9982  908.58 3.9982  1008.5 3.9982  1059.5 3.9982  1079.5 3.9982  911.58 3.9982  1107.5 3.9982  992.54 3.9982  975.55 3.9982  1156.5 3.9982  1042.5 3.9982  1072.5 3.9982  916.58 3.9982  1022.5 3.9982  999.54 3.9982  966.56 3.9982  936.57 3.9982  934.57 3.9982  969.55 3.9982  1136.5 3.9982  997.54 3.9982  991.54 3.9982  1002.5 3.9982  1047.5 3.9982  1059.5 3.9982  972.55 3.9982  918.58 3.9982  959.56 3.9982  1083.5 3.9982  934.57 3.9982  900.59 3.9982  970.55 3.9982  952.56 3.9982  1063.5  3.9982  870.6  3.9982  958.56  3.9982  1029.5  3.9982  943.57  3.9982  872.6  3.9982  972.55  3.9982  1009.5  3.9982  875.6  3.9982  1127.5  3.9982  987.55  3.9982  1156.5  3.9982  971.55  3.9982  1155.5  3.9982  930.57  3.9982  1051.5  3.9982  1044.5  3.9982  867.6  3.9982  898.59  3.9982  926.57  3.9982  965.56  3.9982  1027.5  3.9982  993.54  3.9982  927.57  3.9982  973.55  3.9982  934.57  3.9982  951.56  3.9982  1007.5  3.9982  1124.5  3.9982  936.57  3.9982  1050.5  3.9982  1075.5  3.9982  1028.5  3.9982  872.6  3.9982  960.56  3.9982  1014.5  3.9982  1017.5  3.9982  860.6  3.9982  1039.5  3.9982  1059.5  3.9982  921.58  3.9982  936.57  3.9982  1024.5  3.9982  970.55  3.9982  1047.5  3.9982  917.58  3.9982  948.56  3.9982  978.55  3.9982  993.54  3.9982  1121.5  3.9982  944.57  3.9982  1005.5  3.9982  1037.5  3.9982  1261.4  3.9982  1062.5  3.9982  925.57  3.9982  976.55  3.9982  892.59  3.9982  972.55  3.9982  1135.5  3.9982  1044.5  3.9982  959.56  3.9982  990.54  3.9982  993.54  3.9982  1130.5  3.9982  919.58  3.9982  1025.5  3.9982  1001.5  3.9982  974.55  3.9982  1061.5  3.9982  1166.5  3.9982  1017.5  3.9982  1063.5  3.9982  1188.5  3.9982  964.56  3.9982  1047.5  3.9982  1210.4  3.9982  1087.5  3.9982  1151.5  3.9982  1096.5  3.9982  957.56  3.9982  1073.5  3.9982  925.57  3.9982  1051.5  3.9982  930.57  3.9982  1005.5  3.9982  977.55  3.9982  963.56  3.9982  1005.5  3.9982  954.56  3.9982  1025.5  3.9982  1039.5  3.9982  985.55  3.9982  923.58  3.9982  1087.5  3.9982  958.56  3.9982  1066.5  3.9982  1110.5  3.9982  934.57  3.9982  946.56  3.9982
      │    │    │    │    │    │    │    │    │    │    │    │                <---- 23 --------- 901 --------- 2150 -------- 3016 -------- 4093 -------- 5038 -------- 5962 -------- 6778 -------- 8056 -------- 9277 -------- 10530 -------- 11769 -------- 13020 -------- 14001 -------- 14982 -------- 16046 -------- 17072 -------- 18149 -------- 18935 -------- 19920 -------- 20876 -------- 21953 -------- 22859 -------- 23908 -------- 24923 -------- 25938 -------- 26865 -------- 27943 -------- 28938 -------- 29813 -------- 30844 -------- 31647 -------- 32585 -------- 33704 -------- 34617 -------- 35448 -------- 36338 ------- 37071 -------- 38029 -------- 39162 -------- 40163 -------- 41103 -------- 42008 -------- 42828 -------- 43789 -------- 44720 -------- 45920 -------- 47197 -------- 48149 -------- 49054 -------- 49906 -------- 51054 -------- 51940 -------- 53144 -------- 54301 -------- 55267 -------- 56318 -------- 57393 -------- 58223 -------- 59046 -------- 59995 -------- 61150 -------- 62024 -------- 62915 -------- 63943 -------- 65015 -------- 65840 -------- 66748 -------- 67584 -------- 68611 -------- 69729 -------- 70883 -------- 71725 -------- 72926 -------- 73924 -------- 74891 -------- 76176 -------- 77264 -------- 78405 -------- 79257 -------- 80310 -------- 81321 -------- 82270 -------- 83162 -------- 84049 -------- 85004 -------- 86255 -------- 87262 -------- 88259 -------- 89276 -------- 90374 -------- 91493 -------- 92454 -------- 93310 -------- 94246 -------- 95407 -------- 96295 -------- 97113 -------- 98069 -------- 98991 -------- 100116 ------- 100871 -------- 101805 -------- 102871 -------- 103776 ------- 104536 -------- 105497 -------- 106526 ------- 107293 -------- 108529 -------- 109518 -------- 110802 -------- 111761 -------- 113044 -------- 113923 -------- 115027 -------- 116119 ------- 116867 -------- 117681 -------- 118553 -------- 119501 -------- 120563 -------- 121563 -------- 122437 -------- 123400 -------- 124288 -------- 125209 -------- 126234 -------- 127465 -------- 128356 -------- 129458 -------- 130604 -------- 131668 ------- 132428 -------- 133365 -------- 134403 -------- 135446 ------- 136179 -------- 137262 -------- 138380 -------- 139242 -------- 140134 -------- 141190 -------- 142146 -------- 143244 -------- 144097 -------- 145011 -------- 145982 -------- 146981 -------- 148207 -------- 149115 -------- 150119 -------- 151183 -------- 152627 -------- 153735 -------- 154585 -------- 155535 -------- 156315 -------- 157258 -------- 158494 -------- 159570 -------- 160487 -------- 161464 -------- 162446 -------- 163673 -------- 164509 -------- 165550 -------- 166548 -------- 167495 -------- 168601 -------- 169889 -------- 170916 -------- 172026 -------- 173351 -------- 174278 -------- 175359 -------- 176720 -------- 177872 -------- 179135 -------- 180304 -------- 181217 -------- 182345 -------- 183194 -------- 184282 -------- 185142 -------- 186147 -------- 187099 -------- 188024 -------- 189029 -------- 189936 -------- 190977 -------- 192044 -------- 193012 -------- 193858 -------- 195011 -------- 195927 -------- 197043 -------- 198236 -------- 199104 -------- 199995
      │    │    │    │    │    │    │    │    │    │    │    │   histogram(5)=  0            1360            1.9708e+05           1560
      │    │    │    │    │    │    │    │    │    │    │    │                <--- 'ECONOMY ANODIZED BRASS' ------------ 'STANDARD POLISHED TIN'
      │    │    │    │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │    │    │    │    └── fd: (1)-->(5)
      │    │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │    │    │         └── p_type:5 = 'ECONOMY ANODIZED STEEL' [type=bool, outer=(5), constraints=(/5: [/'ECONOMY ANODIZED STEEL' - /'ECONOMY ANODIZED STEEL']; tight), fd=()-->(5)]
      │    │    │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │         └── (o_orderdate:43 >= '1995-01-01') AND (o_orderdate:43 <= '1996-12-31') [type=bool, outer=(43), constraints=(/43: [/'1995-01-01' - /'1996-12-31']; tight)]
      │    │    │    │    │    │    └── filters
      │    │    │    │    │    │         └── o_custkey:40 = c_custkey:50 [type=bool, outer=(40,50), constraints=(/40: (/NULL - ]; /50: (/NULL - ]), fd=(40)==(50), (50)==(40)]
      │    │    │    │    │    └── filters
      │    │    │    │    │         └── s_suppkey:12 = l_suppkey:23 [type=bool, outer=(12,23), constraints=(/12: (/NULL - ]; /23: (/NULL - ]), fd=(12)==(23), (23)==(12)]
      │    │    │    │    ├── scan nation [as=n2]
      │    │    │    │    │    ├── save-table-name: q8_scan_19
      │    │    │    │    │    ├── columns: n2.n_nationkey:66(int!null) n2.n_name:67(char!null)
      │    │    │    │    │    ├── stats: [rows=25, distinct(66)=25, null(66)=0, distinct(67)=25, null(67)=0]
      │    │    │    │    │    │   histogram(66)=  0  1  0  1  0  1  0  1  0  1  0  1  0  1  0  1  0  1  0  1  0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1   0  1
      │    │    │    │    │    │                 <--- 0 --- 1 --- 2 --- 3 --- 4 --- 5 --- 6 --- 7 --- 8 --- 9 --- 10 --- 11 --- 12 --- 13 --- 14 --- 15 --- 16 --- 17 --- 18 --- 19 --- 20 --- 21 --- 22 --- 23 --- 24
      │    │    │    │    │    │   histogram(67)=  0      1      23      1
      │    │    │    │    │    │                 <--- 'ALGERIA' ---- 'VIETNAM'
      │    │    │    │    │    ├── key: (66)
      │    │    │    │    │    └── fd: (66)-->(67)
      │    │    │    │    └── filters
      │    │    │    │         └── s_nationkey:15 = n2.n_nationkey:66 [type=bool, outer=(15,66), constraints=(/15: (/NULL - ]; /66: (/NULL - ]), fd=(15)==(66), (66)==(15)]
      │    │    │    └── projections
      │    │    │         ├── extract('year', o_orderdate:43) [as=o_year:77, type=float, outer=(43), immutable]
      │    │    │         └── l_extendedprice:26 * (1.0 - l_discount:27) [as=volume:78, type=float, outer=(26,27), immutable]
      │    │    └── projections
      │    │         └── CASE WHEN n2.n_name:67 = 'BRAZIL' THEN volume:78 ELSE 0.0 END [as=column79:79, type=float, outer=(67,78)]
      │    └── aggregations
      │         ├── sum [as=sum:80, type=float, outer=(79)]
      │         │    └── column79:79 [type=float]
      │         └── sum [as=sum:81, type=float, outer=(78)]
      │              └── volume:78 [type=float]
      └── projections
           └── sum:80 / sum:81 [as=mkt_share:82, type=float, outer=(80,81), immutable]

----Stats for q8_sort_1----
column_names  row_count  distinct_count  null_count
{mkt_share}   2          2               0
{o_year}      2          2               0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{mkt_share}   729.00         364.50 <==     729.00              364.50 <==          0.00            1.00
{o_year}      729.00         364.50 <==     729.00              364.50 <==          0.00            1.00

----Stats for q8_project_2----
column_names  row_count  distinct_count  null_count
{mkt_share}   2          2               0
{o_year}      2          2               0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{mkt_share}   729.00         364.50 <==     729.00              364.50 <==          0.00            1.00
{o_year}      729.00         364.50 <==     729.00              364.50 <==          0.00            1.00

----Stats for q8_group_by_3----
column_names  row_count  distinct_count  null_count
{o_year}      2          2               0
{sum_1}       2          2               0
{sum}         2          2               0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{o_year}      729.00         364.50 <==     729.00              364.50 <==          0.00            1.00
{sum}         729.00         364.50 <==     729.00              364.50 <==          0.00            1.00
{sum_1}       729.00         364.50 <==     729.00              364.50 <==          0.00            1.00

----Stats for q8_project_4----
column_names  row_count  distinct_count  null_count
{column79}    2603       108             0
{o_year}      2603       2               0
{volume}      2603       2599            0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{column79}    4312.00        1.66           4295.00             39.77 <==           0.00            1.00
{o_year}      4312.00        1.66           729.00              364.50 <==          0.00            1.00
{volume}      4312.00        1.66           4278.00             1.65                0.00            1.00

----Stats for q8_project_5----
column_names  row_count  distinct_count  null_count
{n_name}      2603       25              0
{o_year}      2603       2               0
{volume}      2603       2599            0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{n_name}      4312.00        1.66           25.00               1.00                0.00            1.00
{o_year}      4312.00        1.66           729.00              364.50 <==          0.00            1.00
{volume}      4312.00        1.66           4278.00             1.65                0.00            1.00

----Stats for q8_inner_join_6----
column_names       row_count  distinct_count  null_count
{c_custkey}        2603       2385            0
{c_nationkey}      2603       5               0
{l_discount}       2603       11              0
{l_extendedprice}  2603       2540            0
{l_orderkey}       2603       2567            0
{l_partkey}        2603       1221            0
{l_suppkey}        2603       1895            0
{n_name}           2603       25              0
{n_nationkey_1}    2603       25              0
{n_nationkey}      2603       5               0
{n_regionkey}      2603       1               0
{o_custkey}        2603       2385            0
{o_orderdate}      2603       708             0
{o_orderkey}       2603       2567            0
{p_partkey}        2603       1221            0
{p_type}           2603       1               0
{r_name}           2603       1               0
{r_regionkey}      2603       1               0
{s_nationkey}      2603       25              0
{s_suppkey}        2603       1895            0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{c_custkey}        4312.00        1.66           3993.00             1.67                0.00            1.00
{c_nationkey}      4312.00        1.66           5.00                1.00                0.00            1.00
{l_discount}       4312.00        1.66           11.00               1.00                0.00            1.00
{l_extendedprice}  4312.00        1.66           4276.00             1.68                0.00            1.00
{l_orderkey}       4312.00        1.66           4234.00             1.65                0.00            1.00
{l_partkey}        4312.00        1.66           1332.00             1.09                0.00            1.00
{l_suppkey}        4312.00        1.66           3497.00             1.85                0.00            1.00
{n_name}           4312.00        1.66           25.00               1.00                0.00            1.00
{n_nationkey}      4312.00        1.66           5.00                1.00                0.00            1.00
{n_nationkey_1}    4312.00        1.66           25.00               1.00                0.00            1.00
{n_regionkey}      4312.00        1.66           1.00                1.00                0.00            1.00
{o_custkey}        4312.00        1.66           3993.00             1.67                0.00            1.00
{o_orderdate}      4312.00        1.66           729.00              1.03                0.00            1.00
{o_orderkey}       4312.00        1.66           4234.00             1.65                0.00            1.00
{p_partkey}        4312.00        1.66           1332.00             1.09                0.00            1.00
{p_type}           4312.00        1.66           1.00                1.00                0.00            1.00
{r_name}           4312.00        1.66           1.00                1.00                0.00            1.00
{r_regionkey}      4312.00        1.66           1.00                1.00                0.00            1.00
{s_nationkey}      4312.00        1.66           25.00               1.00                0.00            1.00
{s_suppkey}        4312.00        1.66           3497.00             1.85                0.00            1.00

----Stats for q8_inner_join_7----
column_names       row_count  distinct_count  null_count
{c_custkey}        2603       2385            0
{c_nationkey}      2603       5               0
{l_discount}       2603       11              0
{l_extendedprice}  2603       2540            0
{l_orderkey}       2603       2567            0
{l_partkey}        2603       1221            0
{l_suppkey}        2603       1895            0
{n_nationkey}      2603       5               0
{n_regionkey}      2603       1               0
{o_custkey}        2603       2385            0
{o_orderdate}      2603       708             0
{o_orderkey}       2603       2567            0
{p_partkey}        2603       1221            0
{p_type}           2603       1               0
{r_name}           2603       1               0
{r_regionkey}      2603       1               0
{s_nationkey}      2603       25              0
{s_suppkey}        2603       1895            0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{c_custkey}        4130.00        1.59           3837.00             1.61                0.00            1.00
{c_nationkey}      4130.00        1.59           5.00                1.00                0.00            1.00
{l_discount}       4130.00        1.59           11.00               1.00                0.00            1.00
{l_extendedprice}  4130.00        1.59           4102.00             1.61                0.00            1.00
{l_orderkey}       4130.00        1.59           4059.00             1.58                0.00            1.00
{l_partkey}        4130.00        1.59           1332.00             1.09                0.00            1.00
{l_suppkey}        4130.00        1.59           3378.00             1.78                0.00            1.00
{n_nationkey}      4130.00        1.59           5.00                1.00                0.00            1.00
{n_regionkey}      4130.00        1.59           1.00                1.00                0.00            1.00
{o_custkey}        4130.00        1.59           3837.00             1.61                0.00            1.00
{o_orderdate}      4130.00        1.59           728.00              1.03                0.00            1.00
{o_orderkey}       4130.00        1.59           4059.00             1.58                0.00            1.00
{p_partkey}        4130.00        1.59           1332.00             1.09                0.00            1.00
{p_type}           4130.00        1.59           1.00                1.00                0.00            1.00
{r_name}           4130.00        1.59           1.00                1.00                0.00            1.00
{r_regionkey}      4130.00        1.59           1.00                1.00                0.00            1.00
{s_nationkey}      4130.00        1.59           25.00               1.00                0.00            1.00
{s_suppkey}        4130.00        1.59           3378.00             1.78                0.00            1.00

----Stats for q8_scan_8----
column_names   row_count  distinct_count  null_count
{s_nationkey}  10000      25              0
{s_suppkey}    10000      9920            0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{s_nationkey}  10000.00       1.00           25.00               1.00                0.00            1.00
{s_suppkey}    10000.00       1.00           9920.00             1.00                0.00            1.00

----Stats for q8_inner_join_9----
column_names       row_count  distinct_count  null_count
{c_custkey}        2603       2385            0
{c_nationkey}      2603       5               0
{l_discount}       2603       11              0
{l_extendedprice}  2603       2540            0
{l_orderkey}       2603       2567            0
{l_partkey}        2603       1221            0
{l_suppkey}        2603       1895            0
{n_nationkey}      2603       5               0
{n_regionkey}      2603       1               0
{o_custkey}        2603       2385            0
{o_orderdate}      2603       708             0
{o_orderkey}       2603       2567            0
{p_partkey}        2603       1221            0
{p_type}           2603       1               0
{r_name}           2603       1               0
{r_regionkey}      2603       1               0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{c_custkey}        3880.00        1.49           3620.00             1.52                0.00            1.00
{c_nationkey}      3880.00        1.49           5.00                1.00                0.00            1.00
{l_discount}       3880.00        1.49           11.00               1.00                0.00            1.00
{l_extendedprice}  3880.00        1.49           3862.00             1.52                0.00            1.00
{l_orderkey}       3880.00        1.49           3817.00             1.49                0.00            1.00
{l_partkey}        3880.00        1.49           1332.00             1.09                0.00            1.00
{l_suppkey}        3880.00        1.49           3211.00             1.69                0.00            1.00
{n_nationkey}      3880.00        1.49           5.00                1.00                0.00            1.00
{n_regionkey}      3880.00        1.49           1.00                1.00                0.00            1.00
{o_custkey}        3880.00        1.49           3620.00             1.52                0.00            1.00
{o_orderdate}      3880.00        1.49           727.00              1.03                0.00            1.00
{o_orderkey}       3880.00        1.49           3817.00             1.49                0.00            1.00
{p_partkey}        3880.00        1.49           1332.00             1.09                0.00            1.00
{p_type}           3880.00        1.49           1.00                1.00                0.00            1.00
{r_name}           3880.00        1.49           1.00                1.00                0.00            1.00
{r_regionkey}      3880.00        1.49           1.00                1.00                0.00            1.00

----Stats for q8_lookup_join_10----
column_names   row_count  distinct_count  null_count
{c_custkey}    29952      29952           0
{c_nationkey}  29952      5               0
{n_nationkey}  29952      5               0
{n_regionkey}  29952      1               0
{r_name}       29952      1               0
{r_regionkey}  29952      1               0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{c_custkey}    30000.00       1.00           27672.00            1.08                0.00            1.00
{c_nationkey}  30000.00       1.00           5.00                1.00                0.00            1.00
{n_nationkey}  30000.00       1.00           5.00                1.00                0.00            1.00
{n_regionkey}  30000.00       1.00           1.00                1.00                0.00            1.00
{r_name}       30000.00       1.00           1.00                1.00                0.00            1.00
{r_regionkey}  30000.00       1.00           1.00                1.00                0.00            1.00

----Stats for q8_lookup_join_11----
column_names   row_count  distinct_count  null_count
{n_nationkey}  5          5               0
{n_regionkey}  5          1               0
{r_name}       5          1               0
{r_regionkey}  5          1               0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{n_nationkey}  5.00           1.00           5.00                1.00                0.00            1.00
{n_regionkey}  5.00           1.00           1.00                1.00                0.00            1.00
{r_name}       5.00           1.00           1.00                1.00                0.00            1.00
{r_regionkey}  5.00           1.00           1.00                1.00                0.00            1.00

----Stats for q8_select_12----
column_names   row_count  distinct_count  null_count
{r_name}       1          1               0
{r_regionkey}  1          1               0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{r_name}       1.00           1.00           1.00                1.00                0.00            1.00
{r_regionkey}  1.00           1.00           1.00                1.00                0.00            1.00

----Stats for q8_scan_13----
column_names   row_count  distinct_count  null_count
{r_name}       5          5               0
{r_regionkey}  5          5               0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{r_name}       5.00           1.00           5.00                1.00                0.00            1.00
{r_regionkey}  5.00           1.00           5.00                1.00                0.00            1.00

----Stats for q8_lookup_join_14----
column_names       row_count  distinct_count  null_count
{l_discount}       13389      11              0
{l_extendedprice}  13389      12076           0
{l_orderkey}       13389      13389           0
{l_partkey}        13389      1451            0
{l_suppkey}        13389      4044            0
{o_custkey}        13389      12274           0
{o_orderdate}      13389      731             0
{o_orderkey}       13389      13389           0
{p_partkey}        13389      1451            0
{p_type}           13389      1               0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       12015.00       1.11           11.00               1.00                0.00            1.00
{l_extendedprice}  12015.00       1.11           11924.00            1.01                0.00            1.00
{l_orderkey}       12015.00       1.11           11858.00            1.13                0.00            1.00
{l_partkey}        12015.00       1.11           1332.00             1.09                0.00            1.00
{l_suppkey}        12015.00       1.11           6965.00             1.72                0.00            1.00
{o_custkey}        12015.00       1.11           11317.00            1.08                0.00            1.00
{o_orderdate}      12015.00       1.11           731.00              1.00                0.00            1.00
{o_orderkey}       12015.00       1.11           11858.00            1.13                0.00            1.00
{p_partkey}        12015.00       1.11           1332.00             1.09                0.00            1.00
{p_type}           12015.00       1.11           1.00                1.00                0.00            1.00

----Stats for q8_lookup_join_15----
column_names       row_count  distinct_count  null_count
{l_discount}       43693      11              0
{l_extendedprice}  43693      32247           0
{l_orderkey}       43693      43349           0
{l_partkey}        43693      1451            0
{l_suppkey}        43693      4358            0
{p_partkey}        43693      1451            0
{p_type}           43693      1               0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       40109.00       1.09           11.00               1.00                0.00            1.00
{l_extendedprice}  40109.00       1.09           39253.00            1.22                0.00            1.00
{l_orderkey}       40109.00       1.09           39587.00            1.10                0.00            1.00
{l_partkey}        40109.00       1.09           1332.00             1.09                0.00            1.00
{l_suppkey}        40109.00       1.09           9746.00             2.24 <==            0.00            1.00
{p_partkey}        40109.00       1.09           1332.00             1.09                0.00            1.00
{p_type}           40109.00       1.09           1.00                1.00                0.00            1.00

----Stats for q8_lookup_join_16----
column_names    row_count  distinct_count  null_count
{l_linenumber}  43693      7               0
{l_orderkey}    43693      43349           0
{l_partkey}     43693      1451            0
{p_partkey}     43693      1451            0
{p_type}        43693      1               0
~~~~
column_names    row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_linenumber}  40109.00       1.09           7.00                1.00                0.00            1.00
{l_orderkey}    40109.00       1.09           39587.00            1.10                0.00            1.00
{l_partkey}     40109.00       1.09           1332.00             1.09                0.00            1.00
{p_partkey}     40109.00       1.09           1332.00             1.09                0.00            1.00
{p_type}        40109.00       1.09           1.00                1.00                0.00            1.00

----Stats for q8_select_17----
column_names  row_count  distinct_count  null_count
{p_partkey}   1451       1451            0
{p_type}      1451       1               0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{p_partkey}   1332.00        1.09           1332.00             1.09                0.00            1.00
{p_type}      1332.00        1.09           1.00                1.00                0.00            1.00

----Stats for q8_scan_18----
column_names  row_count  distinct_count  null_count
{p_partkey}   200000     199241          0
{p_type}      200000     150             0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{p_partkey}   200000.00      1.00           199241.00           1.00                0.00            1.00
{p_type}      200000.00      1.00           150.00              1.00                0.00            1.00

----Stats for q8_scan_19----
column_names   row_count  distinct_count  null_count
{n_name}       25         25              0
{n_nationkey}  25         25              0
~~~~
column_names   row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{n_name}       25.00          1.00           25.00               1.00                0.00            1.00
{n_nationkey}  25.00          1.00           25.00               1.00                0.00            1.00
----
----
