Trino Version 363With SubQuery
Fragment 0 [SINGLE]
Output layout: [count, date_format$gid, year$gid]
Output partitioning: SINGLE []
Stage Execution Strategy: UNGROUPED_EXECUTION
Output[po_count, ordermonth, orderyear]
│ Layout: [count:bigint, date_format$gid:varchar, year$gid:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
│ po_count := count
│ ordermonth := date_format$gid
│ orderyear := year$gid
└─ RemoteSource[1]
Layout: [year$gid:bigint, date_format$gid:varchar, count:bigint]
Fragment 1 [HASH]
Output layout: [year$gid, date_format$gid, count]
Output partitioning: SINGLE []
Stage Execution Strategy: UNGROUPED_EXECUTION
Project[]
│ Layout: [year$gid:bigint, date_format$gid:varchar, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ Aggregate(FINAL)[year$gid, month$gid, date_format$gid][$hashvalue]
│ Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, $hashvalue:bigint, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
│ count := count("count_0")
└─ LocalExchange[HASH][$hashvalue] ("year$gid", "month$gid", "date_format$gid")
│ Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, count_0:bigint, $hashvalue:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ RemoteSource[2]
Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, count_0:bigint, $hashvalue_1:bigint]
Fragment 2 [SOURCE]
Output layout: [year$gid, month$gid, date_format$gid, count_0, $hashvalue_2]
Output partitioning: HASH [year$gid, month$gid, date_format$gid][$hashvalue_2]
Stage Execution Strategy: UNGROUPED_EXECUTION
Aggregate(PARTIAL)[year$gid, month$gid, date_format$gid][$hashvalue_2]
│ Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, $hashvalue_2:bigint, count_0:bigint]
│ count_0 := count(*)
└─ Project[]
│ Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, $hashvalue_2:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: 0B, network: 0B}
│ $hashvalue_2 := combine_hash(combine_hash(combine_hash(bigint '0', COALESCE("$operator$hash_code"("year$gid"), 0)), C
└─ ScanFilterProject[table = erp.purchase_orders Erp.PURCHASE_ORDERS columns=[OrderDate
Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar]
Estimates: {rows: ? (?), cpu: ?, memory: 0B, network: 0B}/{rows: ? (?), cpu: ?, memory: 0B, network: 0B}/{rows: ?
year$gid := year("orderdate")
month$gid := month("orderdate")
date_format$gid := date_format("orderdate", '%b')
orderdate := OrderDate:timestamp(0):datetime2 Without SubQuery
Fragment 0 [SINGLE]
Output layout: [count, date_format$gid, year$gid]
Output partitioning: SINGLE []
Stage Execution Strategy: UNGROUPED_EXECUTION
Output[po_count, ordermonth, orderyear]
│ Layout: [count:bigint, date_format$gid:varchar, year$gid:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
│ po_count := count
│ ordermonth := date_format$gid
│ orderyear := year$gid
└─ Project[]
│ Layout: [date_format$gid:varchar, year$gid:bigint, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ RemoteMerge[1]
Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count:bigint]
Fragment 1 [ROUND_ROBIN]
Output layout: [date_format$gid, year$gid, month$gid, count]
Output partitioning: SINGLE []
Stage Execution Strategy: UNGROUPED_EXECUTION
LocalMerge[year$gid ASC NULLS LAST, month$gid ASC NULLS LAST]
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ PartialSort[year$gid ASC NULLS LAST, month$gid ASC NULLS LAST]
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count:bigint]
└─ RemoteSource[2]
Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count:bigint]
Fragment 2 [HASH]
Output layout: [date_format$gid, year$gid, month$gid, count]
Output partitioning: ROUND_ROBIN []
Stage Execution Strategy: UNGROUPED_EXECUTION
Project[]
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ Aggregate(FINAL)[date_format$gid, year$gid, month$gid][$hashvalue]
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, $hashvalue:bigint, count:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
│ count := count("count_0")
└─ LocalExchange[HASH][$hashvalue] ("date_format$gid", "year$gid", "month$gid")
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count_0:bigint, $hashvalue:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: ?, network: ?}
└─ RemoteSource[3]
Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, count_0:bigint, $hashvalue_1:bigint]
Fragment 3 [SOURCE]
Output layout: [date_format$gid, year$gid, month$gid, count_0, $hashvalue_2]
Output partitioning: HASH [date_format$gid, year$gid, month$gid][$hashvalue_2]
Stage Execution Strategy: UNGROUPED_EXECUTION
Aggregate(PARTIAL)[date_format$gid, year$gid, month$gid][$hashvalue_2]
│ Layout: [date_format$gid:varchar, year$gid:bigint, month$gid:bigint, $hashvalue_2:bigint, count_0:bigint]
│ count_0 := count(*)
└─ Project[]
│ Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar, $hashvalue_2:bigint]
│ Estimates: {rows: ? (?), cpu: ?, memory: 0B, network: 0B}
│ $hashvalue_2 := combine_hash(combine_hash(combine_hash(bigint '0', COALESCE("$operator$hash_code"("date_format$gid"),
└─ ScanFilterProject[table = erp.purchase_orders Erp.PURCHASE_ORDERS columns=[OrderDate
Layout: [year$gid:bigint, month$gid:bigint, date_format$gid:varchar]
Estimates: {rows: ? (?), cpu: ?, memory: 0B, network: 0B}/{rows: ? (?), cpu: ?, memory: 0B, network: 0B}/{rows: ?
year$gid := year("orderdate")
month$gid := month("orderdate")
date_format$gid := date_format("orderdate", '%b')
orderdate := OrderDate:timestamp(0):datetime2