
Group[@0]
  Logical Expressions:
    [1] id:139#0 | cost=null | estRows=10,800,000,000 | children=[] | LogicalFileScan ( qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, output=[event_date#0, event_time#1, event_time_ms#2, event_id#3, source#4, dw_keyword#5, load_version#6, message#7, _row_id#8, _last_updated_sequence_number#9], operativeCols=[event_date#0, message#7] )
  Physical Expressions:
    [1] id:216#0 | cost=54,000,000,000 [cpu=54,000,000,000, mem=0, net=0] | estRows=-1 | children=[] | PhysicalFileScan[217]@0 ( table=browser_access_pk_variant_unshredded, stats=null, qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, selected partitions num=0, operativeCols=[event_date#0, message#7] )
  Enforcers:
    (none)
  Chosen Expression ID: 216
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.08E10
    tupleSize=70.0
    width=1
    event_date#0 -> ndv=60.0000, min=20260601000000.000000(2026-06-01), max=20260730000000.000000(2026-07-30), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    event_time#1 -> ndv=5250066432.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_time_ms#2 -> ndv=5247328768.0000, min=1780272000000.000000(1780272000000), max=1785455999999.000000(1785455999999), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_id#3 -> ndv=10774758400.0000, min=32199684108857392.000000(req-0000000076b7ae98), max=32199684112410216.000000(req-ffffffffb0ebb403), count=10800000000.0000, numNulls=0.0000, avgSizeByte=20.000000, hotValues=(null)
    source#4 -> ndv=1.0000, min=27710370788631920.000000(browser-rum), max=27710370788631920.000000(browser-rum), count=10800000000.0000, numNulls=0.0000, avgSizeByte=11.000000, hotValues=(null)
    dw_keyword#5 -> ndv=1.0000, min=27710370788631920.000000(browser_access_log), max=27710370788631920.000000(browser_access_log), count=10800000000.0000, numNulls=0.0000, avgSizeByte=18.000000, hotValues=(null)
    load_version#6 -> ndv=1.0000, min=1.000000(1), max=1.000000(1), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    message#7 -> unknown(1.08E10)
    _row_id#8 -> unknown(1.08E10)
    _last_updated_sequence_number#9 -> unknown(1.08E10)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,000
    Properties: ANY
    Expression ID: 216#0
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 216#0
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@1]
  Logical Expressions:
    [1] id:142#1 | cost=null | estRows=180,000,000 | children=[@0] | LogicalFilter[143] ( predicates=(event_date#0 = 2026-06-15) )
  Physical Expressions:
    [1] id:213#1 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@0] | PhysicalFilter[214]@1 ( stats=null, predicates=(event_date#0 = 2026-06-15) )
  Enforcers:
    (none)
  Chosen Expression ID: 213
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.8E8
    tupleSize=70.0
    width=1
    event_date#0 -> ndv=1.0000, min=20260615000000.000000(2026-06-15), max=20260615000000.000000(2026-06-15), count=0.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(2026-06-15:100.0)
    event_time#1 -> ndv=180000000.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_time_ms#2 -> ndv=180000000.0000, min=1780272000000.000000(1780272000000), max=1785455999999.000000(1785455999999), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_id#3 -> ndv=180000000.0000, min=32199684108857392.000000(req-0000000076b7ae98), max=32199684112410216.000000(req-ffffffffb0ebb403), count=10800000000.0000, numNulls=0.0000, avgSizeByte=20.000000, hotValues=(null)
    source#4 -> ndv=1.0000, min=27710370788631920.000000(browser-rum), max=27710370788631920.000000(browser-rum), count=10800000000.0000, numNulls=0.0000, avgSizeByte=11.000000, hotValues=(null)
    dw_keyword#5 -> ndv=1.0000, min=27710370788631920.000000(browser_access_log), max=27710370788631920.000000(browser_access_log), count=10800000000.0000, numNulls=0.0000, avgSizeByte=18.000000, hotValues=(null)
    load_version#6 -> ndv=1.0000, min=1.000000(1), max=1.000000(1), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    message#7 -> unknown(1.08E10)
    _row_id#8 -> unknown(1.08E10)
    _last_updated_sequence_number#9 -> unknown(1.08E10)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,000
    Properties: ANY
    Expression ID: 213#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 213#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@2]
  Logical Expressions:
    [1] id:145#2 | cost=null | estRows=180,000,000 | children=[@1] | LogicalProject[146] ( distinct=false, projects=[cast(element_at(message#7, 'mainDomain') as TEXT) AS `domain`#10, cast(element_at(message#7, 'totalCostMs') as BIGINT) AS `cast(element_at(message, 'totalCostMs') as BIGINT)`#13] )
  Physical Expressions:
    [1] id:208#2 | cost=5.4 [cpu=5.4, mem=0, net=0] | estRows=-1 | children=[@1] | PhysicalProject[209]@2 ( stats=null, projects=[cast(element_at(message#7, 'mainDomain') as TEXT) AS `domain`#10, cast(element_at(message#7, 'totalCostMs') as BIGINT) AS `cast(element_at(message, 'totalCostMs') as BIGINT)`#13] )
  Enforcers:
    [1] id:231#2 | cost=62,700,000 [cpu=60,000,000, mem=0, net=1,800,000] | estRows=180,000,000 | children=[@2] | PhysicalDistribute[232]@2 ( stats=null, distributionSpec=DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) )
  Chosen Expression ID: 208
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.8E8
    tupleSize=2.0
    width=1
    domain#10 -> unknown(1.0)
    cast(element_at(message, 'totalCostMs') as BIGINT)#13 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,005.4
    Properties: ANY
    Expression ID: 208#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,005.4
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 208#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ──────────────────────────────
    Cost: 54,062,700,005.4
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 231#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #4 ──────────────────────────────
    Cost: 54,062,700,005.4
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 231#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@3]
  Logical Expressions:
    [1] id:148#3 | cost=null | estRows=60,000,000 | children=[@2] | LogicalAggregate[149] ( groupByExpr=[domain#10], outputExpr=[domain#10, count(*) AS `visits`#11, avg(cast(element_at(message, 'totalCostMs') as BIGINT)#13) AS `avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#14], hasRepeat=false )
  Physical Expressions:
    [1] id:197#3 | cost=120,000,000 [cpu=60,000,000, mem=60,000,000, net=0] | estRows=-1 | children=[@2] | PhysicalHashAggregate[198]@3 ( stats=null, aggPhase=GLOBAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[domain#10], outputExpr=[domain#10, count(*) AS `visits`#11, avg(cast(element_at(message, 'totalCostMs') as BIGINT)#13) AS `avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
    [2] id:203#3 | cost=40,000,000.04 [cpu=20,000,000.04, mem=20,000,000, net=0] | estRows=20,000,000 | children=[@9] | PhysicalHashAggregate[204]@3 ( stats=null, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[domain#10], outputExpr=[domain#10, count(partial_count(*)#15) AS `visits`#11, avg(partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT))#16) AS `avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    (none)
  Chosen Expression ID: 203
  Chosen Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  Statistics
    rows=6.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,180,900,005.44
    Properties: ANY
    Expression ID: 203#3
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,180,900,005.44
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 203#3
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[{0}], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@4]
  Logical Expressions:
    [1] id:151#4 | cost=null | estRows=30,000,000 | children=[@3] | LogicalFilter[152] ( predicates=(visits#11 > 0) )
  Physical Expressions:
    [1] id:188#4 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@3] | PhysicalFilter[189]@4 ( stats=null, predicates=(visits#11 > 0) )
  Enforcers:
    (none)
  Chosen Expression ID: 188
  Chosen Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  Statistics
    rows=3.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,180,900,005.44
    Properties: ANY
    Expression ID: 188#4
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,180,900,005.44
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 188#4
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[{0}], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@5]
  Logical Expressions:
    [1] id:154#5 | cost=null | estRows=30,000,000 | children=[@4] | LogicalProject[155] ( distinct=false, projects=[domain#10, visits#11, cast(avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14 as DECIMALV3(20, 4)) AS `avg_cost`#12] )
  Physical Expressions:
    [1] id:183#5 | cost=1.1 [cpu=1.1, mem=0, net=0] | estRows=-1 | children=[@4] | PhysicalProject[184]@5 ( stats=null, projects=[domain#10, visits#11, cast(avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14 as DECIMALV3(20, 4)) AS `avg_cost`#12] )
  Enforcers:
    [1] id:261#5 | cost=450,000 [cpu=0, mem=0, net=300,000] | estRows=30,000,000 | children=[@5] | PhysicalDistribute[262]@5 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Expression ID: 183
  Chosen Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  Statistics
    rows=3.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg_cost#12 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,180,900,006.54
    Properties: ANY
    Expression ID: 183#5
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,180,900,006.54
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 183#5
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #3 ──────────────────────────────
    Cost: 54,181,350,006.54
    Properties: GATHER
    Expression ID: 261#5
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

Group[@6]
  Logical Expressions:
    [1] id:157#6 | cost=null | estRows=30,000,000 | children=[@5] | LogicalSort[158] ( orderKeys=[visits#11 desc, domain#10 asc null first] )
  Physical Expressions:
    [1] id:175#6 | cost=105,000,000 [cpu=30,000,000, mem=30,000,000, net=30,000,000] | estRows=30,000,000 | children=[@8] | PhysicalQuickSort[176]@6 ( stats=null, orderKeys=[visits#11 desc, domain#10 asc null first], phase=MERGE_SORT )
    [2] id:178#6 | cost=3,075,000,000 [cpu=30,000,000, mem=3,000,000,000, net=30,000,000] | estRows=-1 | children=[@5] | PhysicalQuickSort[179]@6 ( stats=null, orderKeys=[visits#11 desc, domain#10 asc null first], phase=GATHER_SORT )
  Enforcers:
    (none)
  Chosen Expression ID: 175
  Chosen Properties: DistributionSpecGather Order: ([visits#11 desc, domain#10 asc null first])
  Statistics
    rows=3.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg_cost#12 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,391,350,006.54
    Properties: ANY
    Expression ID: 175#6
    ChildrenRequires:
      [0] GATHER
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,391,350,006.54
    Properties: DistributionSpecGather Order: ([visits#11 desc, domain#10 asc null first])
    Expression ID: 175#6
    ChildrenRequires:
      [0] GATHER
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

ROOT Group[@7]
  Logical Expressions:
    [1] id:160#7 | cost=null | estRows=30,000,000 | children=[@6] | LogicalResultSink[161] ( outputExprs=[domain#10, visits#11, avg_cost#12] )
  Physical Expressions:
    [1] id:165#7 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@6] | PhysicalResultSink[166] ( outputExprs=[domain#10, visits#11, avg_cost#12] )
  Enforcers:
    (none)
  Chosen Expression ID: 165
  Chosen Properties: GATHER
  Statistics
    rows=3.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg_cost#12 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,391,350,006.54
    Properties: ANY
    Expression ID: 165#7
    ChildrenRequires:
      [0] DistributionSpecGather Order: ([visits#11 desc, domain#10 asc null first])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,391,350,006.54
    Properties: GATHER
    Expression ID: 165#7
    ChildrenRequires:
      [0] DistributionSpecGather Order: ([visits#11 desc, domain#10 asc null first])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

Group[@8]
  Logical Expressions:
    (none)
  Physical Expressions:
    [1] id:172#8 | cost=105,000,000 [cpu=30,000,000, mem=30,000,000, net=30,000,000] | estRows=30,000,000 | children=[@5] | PhysicalQuickSort[173]@8 ( stats=null, orderKeys=[visits#11 desc, domain#10 asc null first], phase=LOCAL_SORT )
  Enforcers:
    [1] id:269#8 | cost=450,000 [cpu=0, mem=0, net=300,000] | estRows=30,000,000 | children=[@8] | PhysicalDistribute[270]@8 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Enforcer(ID, RequiredProperties):
      (0)269,  GATHER
  Chosen Expression ID: 172
  Chosen Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([visits#11 desc, domain#10 asc null first])
  Statistics
    rows=3.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    visits#11 -> unknown(1.0)
    avg_cost#12 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,285,900,006.54
    Properties: ANY
    Expression ID: 172#8
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,285,900,006.54
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([visits#11 desc, domain#10 asc null first])
    Expression ID: 172#8
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    ── Entry #3 ────────────────────────────── BEST
    Cost: 54,286,350,006.54
    Properties: GATHER
    Expression ID: 269#8
    ChildrenRequires:
      [0] DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([visits#11 desc, domain#10 asc null first])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

Group[@9]
  Logical Expressions:
    (none)
  Physical Expressions:
    [1] id:200#9 | cost=120,000,000 [cpu=60,000,000, mem=60,000,000, net=0] | estRows=60,000,000 | children=[@2] | PhysicalHashAggregate[201]@9 ( stats=null, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=true, groupByExpr=[domain#10], outputExpr=[domain#10, partial_count(*) AS `partial_count(*)`#15, partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT)#13) AS `partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#16], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    [1] id:228#9 | cost=20,900,000 [cpu=20,000,000, mem=0, net=600,000] | estRows=60,000,000 | children=[@9] | PhysicalDistribute[229]@9 ( stats=null, distributionSpec=DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) )
  Chosen Enforcer(ID, RequiredProperties):
      (0)228,  DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
  Chosen Expression ID: 200
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=6.0E7
    tupleSize=17.0
    width=1
    domain#10 -> unknown(1.0)
    partial_count(*)#15 -> unknown(1.0)
    partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT))#16 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,120,000,005.4
    Properties: ANY
    Expression ID: 200#9
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,120,000,005.4
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 200#9
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ────────────────────────────── BEST
    Cost: 54,140,900,005.4
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 228#9
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #4 ──────────────────────────────
    Cost: 54,140,900,005.4
    Properties: DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) Order: ([])
    Expression ID: 228#9
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}

========== OPTIMIZED PLAN ==========
PhysicalResultSink[350] ( outputExprs=[domain#10, visits#11, avg_cost#12] )
+--PhysicalQuickSort[346]@6 ( stats=30,000,000, orderKeys=[visits#11 desc, domain#10 asc null first], phase=MERGE_SORT )
   +--PhysicalDistribute[342]@8 ( stats=30,000,000, distributionSpec=DistributionSpecGather )
      +--PhysicalQuickSort[338]@8 ( stats=30,000,000, orderKeys=[visits#11 desc, domain#10 asc null first], phase=LOCAL_SORT )
         +--PhysicalProject[334]@5 ( stats=30,000,000, projects=[domain#10, visits#11, cast(avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14 as DECIMALV3(20, 4)) AS `avg_cost`#12] )
            +--PhysicalFilter[330]@4 ( stats=30,000,000, predicates=(visits#11 > 0) )
               +--PhysicalHashAggregate[326]@3 ( stats=60,000,000, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[domain#10], outputExpr=[domain#10, count(partial_count(*)#15) AS `visits`#11, avg(partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT))#16) AS `avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
                  +--PhysicalDistribute[322]@9 ( stats=60,000,000, distributionSpec=DistributionSpecHash ( orderedShuffledColumns=[10], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[10]], exprIdToEquivalenceSet={10=0} ) )
                     +--PhysicalHashAggregate[318]@9 ( stats=60,000,000, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=true, groupByExpr=[domain#10], outputExpr=[domain#10, partial_count(*) AS `partial_count(*)`#15, partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT)#13) AS `partial_avg(cast(element_at(message, 'totalCostMs') as BIGINT))`#16], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
                        +--PhysicalProject[314]@2 ( stats=180,000,000, projects=[cast(element_at(message#7, 'mainDomain') as TEXT) AS `domain`#10, cast(element_at(message#7, 'totalCostMs') as BIGINT) AS `cast(element_at(message, 'totalCostMs') as BIGINT)`#13] )
                           +--PhysicalFilter[310]@1 ( stats=180,000,000, predicates=(event_date#0 = 2026-06-15) )
                              +--PhysicalFileScan[306]@0 ( table=browser_access_pk_variant_unshredded, stats=10,800,000,000, qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, selected partitions num=0, operativeCols=[event_date#0, message#7] )

========== MATERIALIZATIONS ==========

MaterializedView
MaterializedViewRewriteSuccessAndChose:

MaterializedViewRewriteSuccessButNotChose:

MaterializedViewRewriteFail:
 CBO.internal.variant_perf_doris.mv_truewatch_spark_unshredded fail
  FailInfo: View struct info is invalid:view plan is LogicalResultSink[111] ( outputExprs=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, visit_count#13, anomaly_count#14] )
+--LogicalProject[110] ( distinct=false, projects=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, visit_count#13, sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END)#16 AS `anomaly_count`#14] )
   +--LogicalAggregate[109] ( groupByExpr=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12], outputExpr=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, count(*) AS `visit_count`#13, sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END#15) AS `sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END)`#16], hasRepeat=false )
      +--LogicalProject[108] ( distinct=false, projects=[event_date#0, date_trunc(event_time#1, 'hour') AS `event_hour`#10, cast(element_at(message#7, 'mainDomain') as TEXT) AS `main_domain`#11, cast(element_at(message#7, 'anomalyType') as TEXT) AS `anomaly_type`#12, if(( not (cast(element_at(message#7, 'anomalyType') as TEXT) = 'normal')), 1, 0) AS `CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END`#15] )
         +--LogicalFilter[107] ( predicates=(event_date#0 = 2026-06-15) )
            +--LogicalFileScan ( qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, output=[event_date#0, event_time#1, event_time_ms#2, event_id#3, source#4, dw_keyword#5, load_version#6, message#7, _row_id#8, _last_updated_sequence_number#9], operativeCols=[event_date#0, event_time#1, message#7] ), Query function roll up fail:queryExpression = avg(cast(element_at(message, 'totalCostMs') as BIGINT))#14,
 mvExprToMvScanExprQueryBased = {event_date#0=event_date#17, cast(element_at(message#7, 'mainDomain') as TEXT)=main_domain#19, cast(element_at(message#7, 'anomalyType') as TEXT)=anomaly_type#20, count(*)=visit_count#21, sum(if(( not (cast(element_at(message#7, 'anomalyType') as TEXT) = 'normal')), 1, 0))=anomaly_count#22, date_trunc(event_time#1, 'hour')=event_hour#18}, Predicate compensate fail:query predicates = Predicates ( pulledUpPredicates=[(event_date#0 = 2026-06-15), (visits#11 > 0)], predicatesUnderBreaker=[] ),
 query equivalenceClass = EquivalenceClass{equivalenceSlotMap={}}, 
view predicates = Predicates ( pulledUpPredicates=[(event_date#0 = 2026-06-15)], predicatesUnderBreaker=[] ),
 query equivalenceClass = EquivalenceClass{equivalenceSlotMap={}}
comparisonResult = valid: true 
 viewExpressions: [] 
 queryExpressions :[] 
 viewNoNullableSlot :[] 
queryAllPulledUpExpressions :[] 
 
