blob: c51f8b103b526905916415bdf614dff4c255124d [file] [log] [blame]
# TPCDS-Q93
SELECT ss_customer_sk,
sum(act_sales) sumsales
FROM
(SELECT ss_item_sk,
ss_ticket_number,
ss_customer_sk,
CASE
WHEN sr_return_quantity IS NOT NULL THEN (ss_quantity-sr_return_quantity)*ss_sales_price
ELSE (ss_quantity*ss_sales_price)
END act_sales
FROM store_sales
LEFT OUTER JOIN store_returns ON (sr_item_sk = ss_item_sk
AND sr_ticket_number = ss_ticket_number) ,reason
WHERE sr_reason_sk = r_reason_sk
AND r_reason_desc = 'reason 28') t
GROUP BY ss_customer_sk
ORDER BY sumsales,
ss_customer_sk
LIMIT 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=19.45MB Threads=4
Per-Host Resource Estimates: Memory=219MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=219.44MB mem-reservation=19.45MB thread-reservation=4 runtime-filters-memory=1.00MB
PLAN-ROOT SINK
| output exprs: ss_customer_sk, sum(act_sales)
| mem-estimate=0B mem-reservation=0B thread-reservation=0
|
06:TOP-N [LIMIT=100]
| order by: sum(act_sales) ASC, ss_customer_sk ASC
| mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
| tuple-ids=5 row-size=20B cardinality=100
| in pipelines: 06(GETNEXT), 05(OPEN)
|
05:AGGREGATE [FINALIZE]
| output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
| group by: ss_customer_sk
| mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 05(GETNEXT), 00(OPEN)
|
04:HASH JOIN [INNER JOIN]
| hash predicates: sr_reason_sk = r_reason_sk
| fk/pk conjuncts: sr_reason_sk = r_reason_sk
| runtime filters: RF000[bloom] <- r_reason_sk
| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
|--02:SCAN HDFS [tpcds_parquet.reason]
| HDFS partitions=1/1 files=1 size=1.92KB
| predicates: r_reason_desc = 'reason 28'
| stored statistics:
| table: rows=35 size=1.92KB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=35
| parquet statistics predicates: r_reason_desc = 'reason 28'
| parquet dictionary predicates: r_reason_desc = 'reason 28'
| mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
| tuple-ids=2 row-size=33B cardinality=1
| in pipelines: 02(GETNEXT)
|
03:HASH JOIN [LEFT OUTER JOIN]
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,1N row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--01:SCAN HDFS [tpcds_parquet.store_returns]
| HDFS partitions=1/1 files=1 size=15.43MB
| runtime filters: RF000[bloom] -> sr_reason_sk
| stored statistics:
| table: rows=287.51K size=15.43MB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=287.51K
| mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
| tuple-ids=1 row-size=24B cardinality=287.51K
| in pipelines: 01(GETNEXT)
|
00:SCAN HDFS [tpcds_parquet.store_sales]
HDFS partitions=1824/1824 files=1824 size=200.95MB
stored statistics:
table: rows=2.88M size=200.95MB
partitions: 1824/1824 rows=2.88M
columns: all
extrapolated-rows=disabled max-scan-range-rows=130.09K
mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=24.39MB Threads=8
Per-Host Resource Estimates: Memory=248MB
F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
PLAN-ROOT SINK
| output exprs: ss_customer_sk, sum(act_sales)
| mem-estimate=0B mem-reservation=0B thread-reservation=0
|
11:MERGING-EXCHANGE [UNPARTITIONED]
| order by: sum(act_sales) ASC, ss_customer_sk ASC
| limit: 100
| mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=5 row-size=20B cardinality=100
| in pipelines: 06(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
Per-Host Resources: mem-estimate=10.59MB mem-reservation=1.94MB thread-reservation=1
06:TOP-N [LIMIT=100]
| order by: sum(act_sales) ASC, ss_customer_sk ASC
| mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
| tuple-ids=5 row-size=20B cardinality=100
| in pipelines: 06(GETNEXT), 10(OPEN)
|
10:AGGREGATE [FINALIZE]
| output: sum:merge(act_sales)
| group by: ss_customer_sk
| mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 10(GETNEXT), 00(OPEN)
|
09:EXCHANGE [HASH(ss_customer_sk)]
| mem-estimate=607.79KB mem-reservation=0B thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
Per-Host Resources: mem-estimate=108.06MB mem-reservation=17.44MB thread-reservation=2 runtime-filters-memory=1.00MB
05:AGGREGATE [STREAMING]
| output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
| group by: ss_customer_sk
| mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 00(GETNEXT)
|
04:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: sr_reason_sk = r_reason_sk
| fk/pk conjuncts: sr_reason_sk = r_reason_sk
| runtime filters: RF000[bloom] <- r_reason_sk
| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
|--08:EXCHANGE [BROADCAST]
| | mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| | tuple-ids=2 row-size=33B cardinality=1
| | in pipelines: 02(GETNEXT)
| |
| F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
| 02:SCAN HDFS [tpcds_parquet.reason, RANDOM]
| HDFS partitions=1/1 files=1 size=1.92KB
| predicates: r_reason_desc = 'reason 28'
| stored statistics:
| table: rows=35 size=1.92KB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=35
| parquet statistics predicates: r_reason_desc = 'reason 28'
| parquet dictionary predicates: r_reason_desc = 'reason 28'
| mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
| tuple-ids=2 row-size=33B cardinality=1
| in pipelines: 02(GETNEXT)
|
03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,1N row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--07:EXCHANGE [BROADCAST]
| | mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
| | tuple-ids=1 row-size=24B cardinality=287.51K
| | in pipelines: 01(GETNEXT)
| |
| F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
| 01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
| HDFS partitions=1/1 files=1 size=15.43MB
| runtime filters: RF000[bloom] -> sr_reason_sk
| stored statistics:
| table: rows=287.51K size=15.43MB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=287.51K
| mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
| tuple-ids=1 row-size=24B cardinality=287.51K
| in pipelines: 01(GETNEXT)
|
00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
HDFS partitions=1824/1824 files=1824 size=200.95MB
stored statistics:
table: rows=2.88M size=200.95MB
partitions: 1824/1824 rows=2.88M
columns: all
extrapolated-rows=disabled max-scan-range-rows=130.09K
mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=42.77MB Threads=9
Per-Host Resource Estimates: Memory=143MB
F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
PLAN-ROOT SINK
| output exprs: ss_customer_sk, sum(act_sales)
| mem-estimate=0B mem-reservation=0B thread-reservation=0
|
11:MERGING-EXCHANGE [UNPARTITIONED]
| order by: sum(act_sales) ASC, ss_customer_sk ASC
| limit: 100
| mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=5 row-size=20B cardinality=100
| in pipelines: 06(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
Per-Instance Resources: mem-estimate=10.66MB mem-reservation=1.94MB thread-reservation=1
06:TOP-N [LIMIT=100]
| order by: sum(act_sales) ASC, ss_customer_sk ASC
| mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
| tuple-ids=5 row-size=20B cardinality=100
| in pipelines: 06(GETNEXT), 10(OPEN)
|
10:AGGREGATE [FINALIZE]
| output: sum:merge(act_sales)
| group by: ss_customer_sk
| mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 10(GETNEXT), 00(OPEN)
|
09:EXCHANGE [HASH(ss_customer_sk)]
| mem-estimate=679.79KB mem-reservation=0B thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
05:AGGREGATE [STREAMING]
| output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
| group by: ss_customer_sk
| mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=4 row-size=20B cardinality=82.30K
| in pipelines: 00(GETNEXT)
|
04:HASH JOIN [INNER JOIN, BROADCAST]
| hash-table-id=00
| hash predicates: sr_reason_sk = r_reason_sk
| fk/pk conjuncts: sr_reason_sk = r_reason_sk
| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
| | Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: r_reason_sk
| | runtime filters: RF000[bloom] <- r_reason_sk
| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 08:EXCHANGE [BROADCAST]
| | mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| | tuple-ids=2 row-size=33B cardinality=1
| | in pipelines: 02(GETNEXT)
| |
| F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
| 02:SCAN HDFS [tpcds_parquet.reason, RANDOM]
| HDFS partitions=1/1 files=1 size=1.92KB
| predicates: r_reason_desc = 'reason 28'
| stored statistics:
| table: rows=35 size=1.92KB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=35
| parquet statistics predicates: r_reason_desc = 'reason 28'
| parquet dictionary predicates: r_reason_desc = 'reason 28'
| mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
| tuple-ids=2 row-size=33B cardinality=1
| in pipelines: 02(GETNEXT)
|
03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
| hash-table-id=01
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,1N row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
| | Per-Instance Resources: mem-estimate=23.61MB mem-reservation=17.00MB thread-reservation=1
| JOIN BUILD
| | join-table-id=01 plan-id=02 cohort-id=01
| | build expressions: sr_item_sk, sr_ticket_number
| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
| |
| 07:EXCHANGE [BROADCAST]
| | mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
| | tuple-ids=1 row-size=24B cardinality=287.51K
| | in pipelines: 01(GETNEXT)
| |
| F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
| Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
| 01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
| HDFS partitions=1/1 files=1 size=15.43MB
| runtime filters: RF000[bloom] -> sr_reason_sk
| stored statistics:
| table: rows=287.51K size=15.43MB
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=287.51K
| mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
| tuple-ids=1 row-size=24B cardinality=287.51K
| in pipelines: 01(GETNEXT)
|
00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
HDFS partitions=1824/1824 files=1824 size=200.95MB
stored statistics:
table: rows=2.88M size=200.95MB
partitions: 1824/1824 rows=2.88M
columns: all
extrapolated-rows=disabled max-scan-range-rows=130.09K
mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
====