import file=tpch_schema
----

import file=tpch_stats
----

# --------------------------------------------------
# Q9
# Product Type Profit Measure
# Determines how much profit is made on a given line of parts, broken out by
# supplier nation and year.
#
# Finds, for each nation and each year, the profit for all parts ordered in that
# year that contain a specified substring in their names and that were filled by
# a supplier in that nation. The profit is defined as the sum of:
#
#   [(l_extendedprice*(1-l_discount)) - (ps_supplycost * l_quantity)]
#
# for all lineitems describing parts in the specified line. The query lists the
#  nations in ascending alphabetical order and, for each nation, the year and
#  profit in descending order by year (most recent first).
# --------------------------------------------------
stats-quality database=tpch set=save_tables_prefix=q9
SELECT
    nation,
    o_year,
    sum(amount) AS sum_profit
FROM (
    SELECT
        n_name AS nation,
        extract(year FROM o_orderdate) AS o_year,
        l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
    FROM
        part,
        supplier,
        lineitem,
        partsupp,
        orders,
        nation
    WHERE
        s_suppkey = l_suppkey
        AND ps_suppkey = l_suppkey
        AND ps_partkey = l_partkey
        AND p_partkey = l_partkey
        AND o_orderkey = l_orderkey
        AND s_nationkey = n_nationkey
        AND p_name LIKE '%green%'
    ) AS profit
GROUP BY
    nation,
    o_year
ORDER BY
    nation,
    o_year DESC;
----
----
sort
 ├── save-table-name: q9_sort_1
 ├── columns: nation:58(char!null) o_year:63(float) sum_profit:65(float!null)
 ├── immutable
 ├── stats: [rows=1548.499, distinct(58)=25, null(58)=0, distinct(63)=957.145, null(63)=0, distinct(65)=1548.5, null(65)=0, distinct(58,63)=1548.5, null(58,63)=0]
 ├── key: (58,63)
 ├── fd: (58,63)-->(65)
 ├── ordering: +58,-63
 └── group-by (hash)
      ├── save-table-name: q9_group_by_2
      ├── columns: n_name:58(char!null) o_year:63(float) sum:65(float!null)
      ├── grouping columns: n_name:58(char!null) o_year:63(float)
      ├── immutable
      ├── stats: [rows=1548.499, distinct(58)=25, null(58)=0, distinct(63)=957.145, null(63)=0, distinct(65)=1548.5, null(65)=0, distinct(58,63)=1548.5, null(58,63)=0]
      ├── key: (58,63)
      ├── fd: (58,63)-->(65)
      ├── project
      │    ├── save-table-name: q9_project_3
      │    ├── columns: o_year:63(float) amount:64(float!null) n_name:58(char!null)
      │    ├── immutable
      │    ├── stats: [rows=2450.416, distinct(58)=25, null(58)=0, distinct(63)=957.145, null(63)=0, distinct(64)=958.326, null(64)=0, distinct(58,63)=1548.5, null(58,63)=0]
      │    ├── inner-join (hash)
      │    │    ├── save-table-name: q9_inner_join_4
      │    │    ├── columns: p_partkey:1(int!null) p_name:2(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_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) o_orderkey:46(int!null) o_orderdate:50(date!null) n_nationkey:57(int!null) n_name:58(char!null)
      │    │    ├── multiplicity: left-rows(exactly-one), right-rows(zero-or-more)
      │    │    ├── stats: [rows=2450.416, distinct(1)=1065.01, null(1)=0, distinct(2)=2405.95, null(2)=0, distinct(12)=1064.52, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=1066.43, null(21)=0, distinct(22)=1065.01, null(22)=0, distinct(23)=1064.52, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=958.165, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=958.326, null(39)=0, distinct(40)=958.326, null(40)=0, distinct(42)=956.829, null(42)=0, distinct(46)=1066.43, null(46)=0, distinct(50)=957.145, null(50)=0, distinct(57)=25, null(57)=0, distinct(58)=25, null(58)=0, distinct(50,58)=1548.5, null(50,58)=0, distinct(25-27,42)=958.326, null(25-27,42)=0]
      │    │    ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (57)-->(58), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21), (15)==(57), (57)==(15)
      │    │    ├── inner-join (hash)
      │    │    │    ├── save-table-name: q9_inner_join_5
      │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(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_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) o_orderkey:46(int!null) o_orderdate:50(date!null)
      │    │    │    ├── multiplicity: left-rows(zero-or-more), right-rows(exactly-one)
      │    │    │    ├── stats: [rows=2450.416, distinct(1)=1223.85, null(1)=0, distinct(2)=2405.95, null(2)=0, distinct(12)=1224.18, null(12)=0, distinct(15)=25, null(15)=0, distinct(21)=1227.35, null(21)=0, distinct(22)=1223.85, null(22)=0, distinct(23)=1224.18, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1058.35, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1058.59, null(39)=0, distinct(40)=1058.59, null(40)=0, distinct(42)=1056.39, null(42)=0, distinct(46)=1227.35, null(46)=0, distinct(50)=1056.85, null(50)=0]
      │    │    │    ├── fd: (1)-->(2), (12)-->(15), (39,40)-->(42), (46)-->(50), (12)==(23,40), (23)==(12,40), (40)==(12,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21)
      │    │    │    ├── scan supplier@s_nk
      │    │    │    │    ├── save-table-name: q9_scan_6
      │    │    │    │    ├── 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 (lookup orders)
      │    │    │    │    ├── save-table-name: q9_lookup_join_7
      │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null) o_orderkey:46(int!null) o_orderdate:50(date!null)
      │    │    │    │    ├── key columns: [21] = [46]
      │    │    │    │    ├── lookup columns are key
      │    │    │    │    ├── stats: [rows=2430.813, distinct(1)=1535.46, null(1)=0, distinct(2)=2387.05, null(2)=0, distinct(21)=1535.6, null(21)=0, distinct(22)=1535.46, null(22)=0, distinct(23)=1220.18, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1219.79, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1220.18, null(39)=0, distinct(40)=1220.18, null(40)=0, distinct(42)=1216.52, null(42)=0, distinct(46)=1535.6, null(46)=0, distinct(50)=1217.29, null(50)=0]
      │    │    │    │    ├── fd: (1)-->(2), (39,40)-->(42), (46)-->(50), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (21)==(46), (46)==(21)
      │    │    │    │    ├── inner-join (lookup lineitem)
      │    │    │    │    │    ├── save-table-name: q9_lookup_join_8
      │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_quantity:25(float!null) l_extendedprice:26(float!null) l_discount:27(float!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null)
      │    │    │    │    │    ├── key columns: [21 24] = [21 24]
      │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    ├── stats: [rows=2430.813, distinct(1)=2429.06, null(1)=0, distinct(2)=2387.05, null(2)=0, distinct(21)=1535.6, null(21)=0, distinct(22)=2429.06, null(22)=0, distinct(23)=1536.11, null(23)=0, distinct(25)=50, null(25)=0, distinct(26)=1535.27, null(26)=0, distinct(27)=11, null(27)=0, distinct(39)=1536.11, null(39)=0, distinct(40)=1536.11, null(40)=0, distinct(42)=1528.33, null(42)=0]
      │    │    │    │    │    ├── fd: (1)-->(2), (39,40)-->(42), (23)==(40), (40)==(23), (1)==(22,39), (22)==(1,39), (39)==(1,22)
      │    │    │    │    │    ├── inner-join (lookup lineitem@l_pk_sk)
      │    │    │    │    │    │    ├── save-table-name: q9_lookup_join_9
      │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) l_orderkey:21(int!null) l_partkey:22(int!null) l_suppkey:23(int!null) l_linenumber:24(int!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null)
      │    │    │    │    │    │    ├── key columns: [39 40] = [22 23]
      │    │    │    │    │    │    ├── stats: [rows=812.7722, distinct(1)=807.834, null(1)=0, distinct(2)=807.748, null(2)=0, distinct(21)=812.556, null(21)=0, distinct(22)=812.772, null(22)=0, distinct(23)=812.772, null(23)=0, distinct(24)=7, null(24)=0, distinct(39)=812.772, null(39)=0, distinct(40)=812.772, null(40)=0, distinct(42)=809.246, null(42)=0]
      │    │    │    │    │    │    ├── key: (21,24)
      │    │    │    │    │    │    ├── fd: (1)-->(2), (39,40)-->(42), (21,24)-->(22,23), (1)==(22,39), (22)==(1,39), (39)==(1,22), (23)==(40), (40)==(23)
      │    │    │    │    │    │    ├── inner-join (merge)
      │    │    │    │    │    │    │    ├── save-table-name: q9_merge_join_10
      │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null) ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null)
      │    │    │    │    │    │    │    ├── left ordering: +39
      │    │    │    │    │    │    │    ├── right ordering: +1
      │    │    │    │    │    │    │    ├── stats: [rows=267682.5, distinct(1)=66618.7, null(1)=0, distinct(2)=65464.1, null(2)=0, distinct(39)=66618.7, null(39)=0, distinct(40)=9920, null(40)=0, distinct(42)=93404.7, null(42)=0]
      │    │    │    │    │    │    │    ├── key: (39,40)
      │    │    │    │    │    │    │    ├── fd: (1)-->(2), (39,40)-->(42), (1)==(39), (39)==(1)
      │    │    │    │    │    │    │    ├── scan partsupp
      │    │    │    │    │    │    │    │    ├── save-table-name: q9_scan_11
      │    │    │    │    │    │    │    │    ├── columns: ps_partkey:39(int!null) ps_suppkey:40(int!null) ps_supplycost:42(float!null)
      │    │    │    │    │    │    │    │    ├── stats: [rows=800000, distinct(39)=199241, null(39)=0, distinct(40)=9920, null(40)=0, distinct(42)=100379, null(42)=0]
      │    │    │    │    │    │    │    │    │   histogram(39)=  0 79.993 3912.7 79.993 3933.7 79.993 3920.7 79.993 3917.7 79.993 3929.7 79.993 3912.7 79.993 3932.7 79.993 3918.7 158.99 3914.7 79.993 3928.7 79.993  3910.7 79.993  3904.7 79.993  3924.7 79.993  3914.7 79.993  3909.7 79.993  3917.7 79.993  3926.7 79.993  3913.7 79.993  3905.7 79.993  3912.7 79.993  3931.7 79.993  3926.7 79.993  3926.7 79.993  3906.7 79.993  3923.7 79.993  3904.7 79.993  3904.7 79.993  3907.7 158.99  3979.6 79.993  3906.7 79.993  3914.7 79.993  3918.7 79.993  3917.7 79.993  3826.7 158.99  3936.7 79.993  3908.7 79.993  3926.7 79.993  3930.7 79.993  3967.6 79.993  3910.7 79.993  3922.7 79.993  3914.7 79.993  3913.7 79.993  3915.7 79.993  3919.7 79.993  3916.7 79.993  3920.7 79.993  3926.7 79.993  3908.7 79.993  3904.7 158.99  3926.7 79.993  3922.7 79.993  3918.7 79.993  3908.7 79.993  3919.7 79.993  3908.7 79.993  3907.7 79.993  3916.7 79.993  3917.7 79.993  3905.7 79.993  3918.7 79.993  3940.7 79.993  3916.7 79.993  3923.7 79.993  3909.7 79.993  3915.7 79.993  3911.7 79.993  3915.7 79.993  3914.7 79.993  3948.6 79.993  3924.7 79.993  3916.7 79.993  3943.7 79.993  3933.7 79.993  3915.7 79.993  3916.7 79.993  3914.7 79.993  3919.7 79.993  3916.7 79.993  3912.7 79.993  3904.7 79.993  3913.7 79.993  3909.7 79.993  3914.7 79.993  3910.7 79.993  3923.7 79.993  3913.7 79.993  3914.7 79.993  3921.7 79.993  3927.7 79.993  3921.7 79.993  3924.7 158.99  3910.7 79.993  3916.7 79.993  3949.6 79.993  3922.7 79.993  3915.7 79.993  3942.7 79.993  3915.7 79.993  3917.7 79.993  3842.7  158.99  3911.7  79.993  3923.7  79.993  3923.7  79.993  3906.7  79.993  3925.7  79.993  3951.6  79.993  3933.7  79.993  3916.7  79.993  3903.7  79.993  3923.7  79.993  3932.7  79.993  3928.7  79.993  3905.7  79.993  3921.7  79.993  3920.7  79.993  3910.7  79.993  3912.7  79.993  3916.7  79.993  3922.7  79.993  3911.7  79.993  3906.7  79.993  3921.7  79.993  3911.7  79.993  3911.7  79.993  3926.7  79.993  3912.7  79.993  3945.6  79.993  3910.7  79.993  3922.7  79.993  3918.7  79.993  3911.7  79.993  3917.7  79.993  3945.6  79.993  3926.7  79.993  3926.7  79.993  3917.7  79.993  3904.7  79.993  3925.7  79.993  3912.7  79.993  3912.7  79.993  3954.6  79.993  3915.7  79.993  3912.7  79.993  3910.7  79.993  3909.7  79.993  3911.7  79.993  3903.7  79.993  3915.7  79.993  3949.6  79.993  3923.7  79.993  3921.7  79.993  3909.7  79.993  3905.7  79.993  3988.6  79.993  3988.6  79.993  3999.6  79.993  4003.6  79.993  3998.6  79.993  4021.6  79.993  4027.6  79.993  4005.6  79.993  3999.6  79.993  3997.6  79.993  3988.6  79.993  3989.6  79.993  4004.6  79.993  3984.6  79.993  3999.6  79.993  3999.6  79.993  4019.6  79.993  4011.6  79.993  4020.6  79.993  4012.6  79.993  3996.6  79.993  4029.6  79.993  4004.6  158.99  3912.7  79.993  3995.6  79.993  3989.6  79.993  3991.6  79.993  3986.6  79.993  3986.6  79.993  4006.6  79.993  3988.6  79.993  3989.6  79.993  3989.6  79.993  3998.6  79.993  4012.6  79.993  4017.6  79.993  4017.6  79.993  3996.6  79.993  3994.6  79.993  4009.6  79.993  3995.6  79.993  3996.6  79.993  3991.6  79.993  4006.6  79.993  4020.6  79.993
      │    │    │    │    │    │    │    │    │                 <---- 13 --------- 942 --------- 2097 -------- 3127 -------- 4125 -------- 5247 -------- 6181 -------- 7326 -------- 8333 -------- 9292 -------- 10410 -------- 11308 -------- 12057 -------- 13131 -------- 14088 -------- 14972 -------- 15975 -------- 17072 -------- 18019 -------- 18798 -------- 19734 -------- 20877 -------- 21973 -------- 23067 -------- 23887 -------- 24957 -------- 25716 -------- 26450 -------- 27291 -------- 28733 -------- 29539 -------- 30499 -------- 31512 -------- 32509 -------- 33286 -------- 34464 -------- 35311 -------- 36406 -------- 37541 -------- 38918 -------- 39818 -------- 40879 -------- 41843 -------- 42789 -------- 43757 -------- 44778 -------- 45769 -------- 46806 -------- 47899 -------- 48763 -------- 49507 -------- 50607 -------- 51663 -------- 52669 -------- 53525 -------- 54549 -------- 55415 -------- 56261 -------- 57242 -------- 58242 -------- 59036 -------- 60050 -------- 61259 -------- 62240 -------- 63307 -------- 64178 -------- 65152 -------- 66063 -------- 67040 -------- 68005 -------- 69273 -------- 70354 -------- 71339 -------- 72569 -------- 73724 -------- 74695 -------- 75684 -------- 76646 -------- 77670 -------- 78657 -------- 79587 -------- 80331 -------- 81281 -------- 82150 -------- 83115 -------- 84014 -------- 85082 -------- 86031 -------- 86990 -------- 88034 -------- 89138 -------- 90187 -------- 91260 -------- 92150 -------- 93140 -------- 94413 -------- 95469 -------- 96443 -------- 97666 -------- 98637 -------- 99633 -------- 100664 -------- 101572 -------- 102643 -------- 103706 -------- 104522 -------- 105605 -------- 106892 -------- 108047 -------- 109036 -------- 109721 -------- 110790 -------- 111938 -------- 113052 -------- 113830 -------- 114873 -------- 115912 -------- 116814 -------- 117737 -------- 118721 -------- 119776 -------- 120692 -------- 121500 -------- 122545 -------- 123457 -------- 124366 -------- 125466 -------- 126391 -------- 127638 -------- 128533 -------- 129586 -------- 130602 -------- 131508 -------- 132509 -------- 133756 -------- 134848 -------- 135944 -------- 136945 -------- 137706 -------- 138791 -------- 139720 -------- 140657 -------- 141959 -------- 142929 -------- 143854 -------- 144743 -------- 145629 -------- 146548 -------- 147238 -------- 148209 -------- 149481 -------- 150548 -------- 151598 -------- 152481 -------- 153250 -------- 154137 -------- 155017 -------- 156060 -------- 157143 -------- 158169 -------- 159406 -------- 160686 -------- 161794 -------- 162837 -------- 163860 -------- 164730 -------- 165623 -------- 166716 -------- 167485 -------- 168526 -------- 169568 -------- 170793 -------- 171958 -------- 173192 -------- 174365 -------- 175367 -------- 176660 -------- 177754 -------- 178681 -------- 179672 -------- 180568 -------- 181502 -------- 182344 -------- 183171 -------- 184286 -------- 185174 -------- 186068 -------- 186966 -------- 187997 -------- 189168 -------- 190375 -------- 191583 -------- 192588 -------- 193575 -------- 194722 -------- 195713 -------- 196725 -------- 197653 -------- 198767 -------- 199999
      │    │    │    │    │    │    │    │    │   histogram(40)=  0 160 3920 160  3920  80   3920  160  3920  160  3920  240  3760  240  3920  80   3840  240  3920  240  3840  320  3760  240  3920  80   3840  160  3920  240  3920  320  3920  80   3920  80   3920  80   3840  160  3920  240   3760  240   3920   80   3840  160   3920   80   3920  160   3920   80   3920  160   3920   80   3920  160   3920   80   3760  240   3840  240   3920   80   3920   80   3840  240   3760  240   3920   80   3840  160   3840  160   3920   80   3920   80   3920  160   3760  240   3920  240   3920   80   3920  160   3920   80   3840  160   3920  160   3920   80   3840  160   3840  240   3920  160   3840  160   3920  160   3920   80   3840  160   3920  160   3840  160   3840  160   3920   80   3920  160   3920  160   3920   80   3920   80   3840  160   3840  160   3840  160   3920   80   3920   80   3840  240   3840  160   3920  320   3840  160   3840  240   3920   80   3920   80   3760  240   3840  160   3920  160   3920   80   3840  240   3920   80   3920   80   3920  160   3920   80   3920   80   3920   80   3920   80   3840  160   3920   80   3920  160   3760  320   3920   80   3920   80   3840  160   3920  240   3920   80   3920   80   3920   80   3920  160   3840  160   3760  400   3760  240   3680  320   3840  240   3840   80   3840  160   3840  160   3920   80   3920   80   3920   80   3840  160   3920   80   3760  240   3920   80   3840  240   3840   80   3840  160   3920  240   3840   80   3840   80   3840  160   3920   80   3760  240   3920   80   3920  160   3840  160   3760  240   3760  240   3840   80   3920  160   3840   80   3920   80   3920   80   3840  400   3760  160   3840   80   3840  160   3760  160   3840  240   3840  160   3680  320   3760  160   3920   80   3920   80   3920   80   3920   80   3920   80   3840  160   3760  240   3840  160   3920   80   3840  160   3920  240   3840  160   3840   80   3840  160   3840   80   3920   80   3920   80   3920  160   3840  160   3840  160   3840  160   3760  160   3920   80   3920   80   3920   80   3920   80   3760  240   3920   80   3920  320   3760  160   3840   80   3840   80   3920  160   3840   80   3920  160   3760  160   3920   80   3920   80   3920  160   3840  160   3840   80   3840  160   3920   80   3920   80   3920   80   3840  160   3840  240   3840  160   3840   80   3920   80   3840  240   3840   80   3920   80   3920   80   3840   160
      │    │    │    │    │    │    │    │    │                 <--- 2 ------ 50 ------ 104 ------ 153 ------ 213 ------ 281 ------ 320 ------ 366 ------ 411 ------ 462 ------ 515 ------ 548 ------ 600 ------ 649 ------ 697 ------ 743 ------ 793 ------ 845 ------ 893 ------ 953 ------ 1006 ------ 1052 ------ 1103 ------ 1158 ------ 1199 ------ 1246 ------ 1302 ------ 1375 ------ 1418 ------ 1475 ------ 1524 ------ 1563 ------ 1628 ------ 1689 ------ 1740 ------ 1799 ------ 1850 ------ 1901 ------ 1948 ------ 2017 ------ 2055 ------ 2099 ------ 2157 ------ 2214 ------ 2267 ------ 2319 ------ 2373 ------ 2428 ------ 2478 ------ 2546 ------ 2602 ------ 2657 ------ 2707 ------ 2760 ------ 2808 ------ 2852 ------ 2913 ------ 2968 ------ 3030 ------ 3069 ------ 3115 ------ 3165 ------ 3210 ------ 3256 ------ 3306 ------ 3365 ------ 3419 ------ 3469 ------ 3523 ------ 3576 ------ 3641 ------ 3694 ------ 3738 ------ 3806 ------ 3851 ------ 3900 ------ 3957 ------ 4004 ------ 4050 ------ 4095 ------ 4145 ------ 4201 ------ 4251 ------ 4293 ------ 4335 ------ 4380 ------ 4432 ------ 4484 ------ 4541 ------ 4593 ------ 4650 ------ 4706 ------ 4744 ------ 4804 ------ 4845 ------ 4897 ------ 4945 ------ 4992 ------ 5044 ------ 5108 ------ 5160 ------ 5207 ------ 5261 ------ 5319 ------ 5358 ------ 5404 ------ 5450 ------ 5490 ------ 5538 ------ 5590 ------ 5639 ------ 5686 ------ 5742 ------ 5788 ------ 5837 ------ 5884 ------ 5940 ------ 5985 ------ 6037 ------ 6090 ------ 6135 ------ 6185 ------ 6228 ------ 6271 ------ 6323 ------ 6376 ------ 6434 ------ 6474 ------ 6527 ------ 6586 ------ 6633 ------ 6674 ------ 6711 ------ 6751 ------ 6797 ------ 6835 ------ 6880 ------ 6918 ------ 6982 ------ 7026 ------ 7069 ------ 7123 ------ 7179 ------ 7238 ------ 7287 ------ 7336 ------ 7388 ------ 7438 ------ 7480 ------ 7528 ------ 7574 ------ 7620 ------ 7664 ------ 7706 ------ 7755 ------ 7805 ------ 7847 ------ 7896 ------ 7954 ------ 8014 ------ 8064 ------ 8108 ------ 8159 ------ 8207 ------ 8250 ------ 8304 ------ 8361 ------ 8410 ------ 8462 ------ 8513 ------ 8562 ------ 8608 ------ 8644 ------ 8706 ------ 8752 ------ 8799 ------ 8840 ------ 8902 ------ 8954 ------ 8995 ------ 9063 ------ 9106 ------ 9152 ------ 9202 ------ 9256 ------ 9310 ------ 9362 ------ 9409 ------ 9462 ------ 9504 ------ 9551 ------ 9598 ------ 9644 ------ 9689 ------ 9741 ------ 9800 ------ 9855 ------ 9896 ------ 9945 ------ 10000
      │    │    │    │    │    │    │    │    │   histogram(42)=  0   80   7.9984e+05    80
      │    │    │    │    │    │    │    │    │                 <--- 1.14 ------------ 999.93
      │    │    │    │    │    │    │    │    ├── key: (39,40)
      │    │    │    │    │    │    │    │    ├── fd: (39,40)-->(42)
      │    │    │    │    │    │    │    │    └── ordering: +39
      │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    ├── save-table-name: q9_select_12
      │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null)
      │    │    │    │    │    │    │    │    ├── stats: [rows=66666.67, distinct(1)=66618.7, null(1)=0, distinct(2)=66666.7, null(2)=0]
      │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │    ├── fd: (1)-->(2)
      │    │    │    │    │    │    │    │    ├── ordering: +1
      │    │    │    │    │    │    │    │    ├── scan part
      │    │    │    │    │    │    │    │    │    ├── save-table-name: q9_scan_13
      │    │    │    │    │    │    │    │    │    ├── columns: p_partkey:1(int!null) p_name:2(varchar!null)
      │    │    │    │    │    │    │    │    │    ├── stats: [rows=200000, distinct(1)=199241, null(1)=0, distinct(2)=198131, null(2)=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(2)=  0                 20                  1.9996e+05                   20
      │    │    │    │    │    │    │    │    │    │                <--- 'almond aquamarine blue puff tan' ------------ 'yellow wheat goldenrod orange blush'
      │    │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │    │    ├── fd: (1)-->(2)
      │    │    │    │    │    │    │    │    │    └── ordering: +1
      │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │         └── p_name:2 LIKE '%green%' [type=bool, outer=(2), constraints=(/2: (/NULL - ])]
      │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    └── filters (true)
      │    │    │    │    └── filters (true)
      │    │    │    └── filters
      │    │    │         └── s_suppkey:12 = l_suppkey:23 [type=bool, outer=(12,23), constraints=(/12: (/NULL - ]; /23: (/NULL - ]), fd=(12)==(23), (23)==(12)]
      │    │    ├── scan nation
      │    │    │    ├── save-table-name: q9_scan_14
      │    │    │    ├── columns: n_nationkey:57(int!null) n_name:58(char!null)
      │    │    │    ├── stats: [rows=25, distinct(57)=25, null(57)=0, distinct(58)=25, null(58)=0]
      │    │    │    │   histogram(57)=  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(58)=  0      1      23      1
      │    │    │    │                 <--- 'ALGERIA' ---- 'VIETNAM'
      │    │    │    ├── key: (57)
      │    │    │    └── fd: (57)-->(58)
      │    │    └── filters
      │    │         └── s_nationkey:15 = n_nationkey:57 [type=bool, outer=(15,57), constraints=(/15: (/NULL - ]; /57: (/NULL - ]), fd=(15)==(57), (57)==(15)]
      │    └── projections
      │         ├── extract('year', o_orderdate:50) [as=o_year:63, type=float, outer=(50), immutable]
      │         └── (l_extendedprice:26 * (1.0 - l_discount:27)) - (ps_supplycost:42 * l_quantity:25) [as=amount:64, type=float, outer=(25-27,42), immutable]
      └── aggregations
           └── sum [as=sum:65, type=float, outer=(64)]
                └── amount:64 [type=float]

----Stats for q9_sort_1----
column_names  row_count  distinct_count  null_count
{nation}      175        25              0
{o_year}      175        7               0
{sum_profit}  175        175             0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{nation}      1548.00        8.85 <==       25.00               1.00                0.00            1.00
{o_year}      1548.00        8.85 <==       957.00              136.71 <==          0.00            1.00
{sum_profit}  1548.00        8.85 <==       1548.00             8.85 <==            0.00            1.00

----Stats for q9_group_by_2----
column_names  row_count  distinct_count  null_count
{n_name}      175        25              0
{o_year}      175        7               0
{sum}         175        175             0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{n_name}      1548.00        8.85 <==       25.00               1.00                0.00            1.00
{o_year}      1548.00        8.85 <==       957.00              136.71 <==          0.00            1.00
{sum}         1548.00        8.85 <==       1548.00             8.85 <==            0.00            1.00

----Stats for q9_project_3----
column_names  row_count  distinct_count  null_count
{amount}      319404     315234          0
{n_name}      319404     25              0
{o_year}      319404     7               0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{amount}      2450.00        130.37 <==     958.00              329.05 <==          0.00            1.00
{n_name}      2450.00        130.37 <==     25.00               1.00                0.00            1.00
{o_year}      2450.00        130.37 <==     957.00              136.71 <==          0.00            1.00

----Stats for q9_inner_join_4----
column_names       row_count  distinct_count  null_count
{l_discount}       319404     11              0
{l_extendedprice}  319404     212580          0
{l_orderkey}       319404     288573          0
{l_partkey}        319404     10632           0
{l_quantity}       319404     50              0
{l_suppkey}        319404     9799            0
{n_name}           319404     25              0
{n_nationkey}      319404     25              0
{o_orderdate}      319404     2406            0
{o_orderkey}       319404     288573          0
{p_name}           319404     10680           0
{p_partkey}        319404     10632           0
{ps_partkey}       319404     10632           0
{ps_suppkey}       319404     9799            0
{ps_supplycost}    319404     34839           0
{s_nationkey}      319404     25              0
{s_suppkey}        319404     9799            0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       2450.00        130.37 <==     11.00               1.00                0.00            1.00
{l_extendedprice}  2450.00        130.37 <==     958.00              221.90 <==          0.00            1.00
{l_orderkey}       2450.00        130.37 <==     1066.00             270.71 <==          0.00            1.00
{l_partkey}        2450.00        130.37 <==     1065.00             9.98 <==            0.00            1.00
{l_quantity}       2450.00        130.37 <==     50.00               1.00                0.00            1.00
{l_suppkey}        2450.00        130.37 <==     1065.00             9.20 <==            0.00            1.00
{n_name}           2450.00        130.37 <==     25.00               1.00                0.00            1.00
{n_nationkey}      2450.00        130.37 <==     25.00               1.00                0.00            1.00
{o_orderdate}      2450.00        130.37 <==     957.00              2.51 <==            0.00            1.00
{o_orderkey}       2450.00        130.37 <==     1066.00             270.71 <==          0.00            1.00
{p_name}           2450.00        130.37 <==     2406.00             4.44 <==            0.00            1.00
{p_partkey}        2450.00        130.37 <==     1065.00             9.98 <==            0.00            1.00
{ps_partkey}       2450.00        130.37 <==     958.00              11.10 <==           0.00            1.00
{ps_suppkey}       2450.00        130.37 <==     958.00              10.23 <==           0.00            1.00
{ps_supplycost}    2450.00        130.37 <==     957.00              36.40 <==           0.00            1.00
{s_nationkey}      2450.00        130.37 <==     25.00               1.00                0.00            1.00
{s_suppkey}        2450.00        130.37 <==     1065.00             9.20 <==            0.00            1.00

----Stats for q9_inner_join_5----
column_names       row_count  distinct_count  null_count
{l_discount}       319404     11              0
{l_extendedprice}  319404     212580          0
{l_orderkey}       319404     288573          0
{l_partkey}        319404     10632           0
{l_quantity}       319404     50              0
{l_suppkey}        319404     9799            0
{o_orderdate}      319404     2406            0
{o_orderkey}       319404     288573          0
{p_name}           319404     10680           0
{p_partkey}        319404     10632           0
{ps_partkey}       319404     10632           0
{ps_suppkey}       319404     9799            0
{ps_supplycost}    319404     34839           0
{s_nationkey}      319404     25              0
{s_suppkey}        319404     9799            0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       2450.00        130.37 <==     11.00               1.00                0.00            1.00
{l_extendedprice}  2450.00        130.37 <==     1058.00             200.93 <==          0.00            1.00
{l_orderkey}       2450.00        130.37 <==     1227.00             235.19 <==          0.00            1.00
{l_partkey}        2450.00        130.37 <==     1224.00             8.69 <==            0.00            1.00
{l_quantity}       2450.00        130.37 <==     50.00               1.00                0.00            1.00
{l_suppkey}        2450.00        130.37 <==     1224.00             8.01 <==            0.00            1.00
{o_orderdate}      2450.00        130.37 <==     1057.00             2.28 <==            0.00            1.00
{o_orderkey}       2450.00        130.37 <==     1227.00             235.19 <==          0.00            1.00
{p_name}           2450.00        130.37 <==     2406.00             4.44 <==            0.00            1.00
{p_partkey}        2450.00        130.37 <==     1224.00             8.69 <==            0.00            1.00
{ps_partkey}       2450.00        130.37 <==     1059.00             10.04 <==           0.00            1.00
{ps_suppkey}       2450.00        130.37 <==     1059.00             9.25 <==            0.00            1.00
{ps_supplycost}    2450.00        130.37 <==     1056.00             32.99 <==           0.00            1.00
{s_nationkey}      2450.00        130.37 <==     25.00               1.00                0.00            1.00
{s_suppkey}        2450.00        130.37 <==     1224.00             8.01 <==            0.00            1.00

----Stats for q9_scan_6----
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 q9_lookup_join_7----
column_names       row_count  distinct_count  null_count
{l_discount}       319404     11              0
{l_extendedprice}  319404     212580          0
{l_orderkey}       319404     288573          0
{l_partkey}        319404     10632           0
{l_quantity}       319404     50              0
{l_suppkey}        319404     9799            0
{o_orderdate}      319404     2406            0
{o_orderkey}       319404     288573          0
{p_name}           319404     10680           0
{p_partkey}        319404     10632           0
{ps_partkey}       319404     10632           0
{ps_suppkey}       319404     9799            0
{ps_supplycost}    319404     34839           0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       2431.00        131.39 <==     11.00               1.00                0.00            1.00
{l_extendedprice}  2431.00        131.39 <==     1220.00             174.25 <==          0.00            1.00
{l_orderkey}       2431.00        131.39 <==     1536.00             187.87 <==          0.00            1.00
{l_partkey}        2431.00        131.39 <==     1535.00             6.93 <==            0.00            1.00
{l_quantity}       2431.00        131.39 <==     50.00               1.00                0.00            1.00
{l_suppkey}        2431.00        131.39 <==     1220.00             8.03 <==            0.00            1.00
{o_orderdate}      2431.00        131.39 <==     1217.00             1.98 <==            0.00            1.00
{o_orderkey}       2431.00        131.39 <==     1536.00             187.87 <==          0.00            1.00
{p_name}           2431.00        131.39 <==     2387.00             4.47 <==            0.00            1.00
{p_partkey}        2431.00        131.39 <==     1535.00             6.93 <==            0.00            1.00
{ps_partkey}       2431.00        131.39 <==     1220.00             8.71 <==            0.00            1.00
{ps_suppkey}       2431.00        131.39 <==     1220.00             8.03 <==            0.00            1.00
{ps_supplycost}    2431.00        131.39 <==     1217.00             28.63 <==           0.00            1.00

----Stats for q9_lookup_join_8----
column_names       row_count  distinct_count  null_count
{l_discount}       319404     11              0
{l_extendedprice}  319404     212580          0
{l_orderkey}       319404     288573          0
{l_partkey}        319404     10632           0
{l_quantity}       319404     50              0
{l_suppkey}        319404     9799            0
{p_name}           319404     10680           0
{p_partkey}        319404     10632           0
{ps_partkey}       319404     10632           0
{ps_suppkey}       319404     9799            0
{ps_supplycost}    319404     34839           0
~~~~
column_names       row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_discount}       2431.00        131.39 <==     11.00               1.00                0.00            1.00
{l_extendedprice}  2431.00        131.39 <==     1535.00             138.49 <==          0.00            1.00
{l_orderkey}       2431.00        131.39 <==     1536.00             187.87 <==          0.00            1.00
{l_partkey}        2431.00        131.39 <==     2429.00             4.38 <==            0.00            1.00
{l_quantity}       2431.00        131.39 <==     50.00               1.00                0.00            1.00
{l_suppkey}        2431.00        131.39 <==     1536.00             6.38 <==            0.00            1.00
{p_name}           2431.00        131.39 <==     2387.00             4.47 <==            0.00            1.00
{p_partkey}        2431.00        131.39 <==     2429.00             4.38 <==            0.00            1.00
{ps_partkey}       2431.00        131.39 <==     1536.00             6.92 <==            0.00            1.00
{ps_suppkey}       2431.00        131.39 <==     1536.00             6.38 <==            0.00            1.00
{ps_supplycost}    2431.00        131.39 <==     1528.00             22.80 <==           0.00            1.00

----Stats for q9_lookup_join_9----
column_names     row_count  distinct_count  null_count
{l_linenumber}   319404     7               0
{l_orderkey}     319404     288573          0
{l_partkey}      319404     10632           0
{l_suppkey}      319404     9799            0
{p_name}         319404     10680           0
{p_partkey}      319404     10632           0
{ps_partkey}     319404     10632           0
{ps_suppkey}     319404     9799            0
{ps_supplycost}  319404     34839           0
~~~~
column_names     row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{l_linenumber}   813.00         392.87 <==     7.00                1.00                0.00            1.00
{l_orderkey}     813.00         392.87 <==     813.00              354.95 <==          0.00            1.00
{l_partkey}      813.00         392.87 <==     813.00              13.08 <==           0.00            1.00
{l_suppkey}      813.00         392.87 <==     813.00              12.05 <==           0.00            1.00
{p_name}         813.00         392.87 <==     808.00              13.22 <==           0.00            1.00
{p_partkey}      813.00         392.87 <==     808.00              13.16 <==           0.00            1.00
{ps_partkey}     813.00         392.87 <==     813.00              13.08 <==           0.00            1.00
{ps_suppkey}     813.00         392.87 <==     813.00              12.05 <==           0.00            1.00
{ps_supplycost}  813.00         392.87 <==     809.00              43.06 <==           0.00            1.00

----Stats for q9_merge_join_10----
column_names     row_count  distinct_count  null_count
{p_name}         42656      10680           0
{p_partkey}      42656      10632           0
{ps_partkey}     42656      10632           0
{ps_suppkey}     42656      9801            0
{ps_supplycost}  42656      34850           0
~~~~
column_names     row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{p_name}         267683.00      6.28 <==       65464.00            6.13 <==            0.00            1.00
{p_partkey}      267683.00      6.28 <==       66619.00            6.27 <==            0.00            1.00
{ps_partkey}     267683.00      6.28 <==       66619.00            6.27 <==            0.00            1.00
{ps_suppkey}     267683.00      6.28 <==       9920.00             1.01                0.00            1.00
{ps_supplycost}  267683.00      6.28 <==       93405.00            2.68 <==            0.00            1.00

----Stats for q9_scan_11----
column_names     row_count  distinct_count  null_count
{ps_partkey}     800000     199241          0
{ps_suppkey}     800000     9920            0
{ps_supplycost}  800000     100379          0
~~~~
column_names     row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{ps_partkey}     800000.00      1.00           199241.00           1.00                0.00            1.00
{ps_suppkey}     800000.00      1.00           9920.00             1.00                0.00            1.00
{ps_supplycost}  800000.00      1.00           100379.00           1.00                0.00            1.00

----Stats for q9_select_12----
column_names  row_count  distinct_count  null_count
{p_name}      10664      10664           0
{p_partkey}   10664      10632           0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{p_name}      66667.00       6.25 <==       66667.00            6.25 <==            0.00            1.00
{p_partkey}   66667.00       6.25 <==       66619.00            6.27 <==            0.00            1.00

----Stats for q9_scan_13----
column_names  row_count  distinct_count  null_count
{p_name}      200000     198131          0
{p_partkey}   200000     199241          0
~~~~
column_names  row_count_est  row_count_err  distinct_count_est  distinct_count_err  null_count_est  null_count_err
{p_name}      200000.00      1.00           198131.00           1.00                0.00            1.00
{p_partkey}   200000.00      1.00           199241.00           1.00                0.00            1.00

----Stats for q9_scan_14----
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
----
----
