
Group[@0]
  Logical Expressions:
    [1] id:72#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:117#0 | cost=54,000,000,000 [cpu=54,000,000,000, mem=0, net=0] | estRows=-1 | children=[] | PhysicalFileScan[118]@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: 117
  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: 117#0
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 117#0
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@1]
  Logical Expressions:
    [1] id:75#1 | cost=null | estRows=3,000,000 | children=[@0] | LogicalFilter[76] ( predicates=AND[(event_date#0 = 2026-06-15),cast(element_at(message#7, 'mainDomain') as TEXT) IN ('www.example.com', 'api.example.com'),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) >= 400),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) <= 599),(cast(element_at(message, 'url') as TEXT) like '%/api/%')] )
  Physical Expressions:
    [1] id:114#1 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@0] | PhysicalFilter[115]@1 ( stats=null, predicates=AND[(event_date#0 = 2026-06-15),cast(element_at(message#7, 'mainDomain') as TEXT) IN ('www.example.com', 'api.example.com'),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) >= 400),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) <= 599),(cast(element_at(message, 'url') as TEXT) like '%/api/%')] )
  Enforcers:
    (none)
  Chosen Expression ID: 114
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=3000000.0
    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=3000000.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=3000000.0000, min=1780272000000.000000(1780272000000), max=1785455999999.000000(1785455999999), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_id#3 -> ndv=3000000.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: 114#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 114#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@2]
  Logical Expressions:
    [1] id:78#2 | cost=null | estRows=3,000,000 | children=[@1] | LogicalProject[79] ( distinct=false, projects=[1 AS `1`#13] )
  Physical Expressions:
    [1] id:109#2 | cost=1 [cpu=1, mem=0, net=0] | estRows=-1 | children=[@1] | PhysicalProject[110]@2 ( stats=null, projects=[1 AS `1`#13] )
  Enforcers:
    [1] id:132#2 | cost=45,000 [cpu=0, mem=0, net=30,000] | estRows=3,000,000 | children=[@2] | PhysicalDistribute[133]@2 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Expression ID: 109
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=3000000.0
    tupleSize=1.0
    width=1
    1#13 -> ndv=1.0000, min=1.000000(1), max=1.000000(1), count=0.0000, numNulls=0.0000, avgSizeByte=1.000000, hotValues=(1:100.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,001
    Properties: ANY
    Expression ID: 109#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,001
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 109#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ──────────────────────────────
    Cost: 54,000,045,001
    Properties: GATHER
    Expression ID: 132#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@3]
  Logical Expressions:
    [1] id:81#3 | cost=null | estRows=1 | children=[@2] | LogicalAggregate[82] ( groupByExpr=[], outputExpr=[count(*) AS `matched`#10], hasRepeat=false )
  Physical Expressions:
    [1] id:98#3 | cost=6,000,000 [cpu=3,000,000, mem=3,000,000, net=0] | estRows=-1 | children=[@2] | PhysicalHashAggregate[99]@3 ( stats=null, aggPhase=GLOBAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(*) AS `matched`#10], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
    [2] id:104#3 | cost=2.02 [cpu=1.02, mem=1, net=0] | estRows=1 | children=[@5] | PhysicalHashAggregate[105]@3 ( stats=null, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(partial_count(*)#14) AS `matched`#10], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    (none)
  Chosen Expression ID: 104
  Chosen Properties: GATHER
  Statistics
    rows=1.0
    tupleSize=8.0
    width=1
    matched#10 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,002,000,003.04
    Properties: ANY
    Expression ID: 104#3
    ChildrenRequires:
      [0] GATHER
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,002,000,003.04
    Properties: GATHER
    Expression ID: 104#3
    ChildrenRequires:
      [0] GATHER
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[{0}], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

ROOT Group[@4]
  Logical Expressions:
    [1] id:84#4 | cost=null | estRows=1 | children=[@3] | LogicalResultSink[85] ( outputExprs=[matched#10] )
  Physical Expressions:
    [1] id:89#4 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@3] | PhysicalResultSink[90] ( outputExprs=[matched#10] )
  Enforcers:
    (none)
  Chosen Expression ID: 89
  Chosen Properties: GATHER
  Statistics
    rows=1.0
    tupleSize=8.0
    width=1
    matched#10 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,002,000,003.04
    Properties: ANY
    Expression ID: 89#4
    ChildrenRequires:
      [0] GATHER
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,002,000,003.04
    Properties: GATHER
    Expression ID: 89#4
    ChildrenRequires:
      [0] GATHER
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

Group[@5]
  Logical Expressions:
    (none)
  Physical Expressions:
    [1] id:101#5 | cost=2,000,000 [cpu=1,000,000, mem=1,000,000, net=0] | estRows=1 | children=[@2] | PhysicalHashAggregate[102]@5 ( stats=null, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=false, groupByExpr=[], outputExpr=[partial_count(*) AS `partial_count(*)`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    [1] id:129#5 | cost=0.01 [cpu=0, mem=0, net=0.01] | estRows=1 | children=[@5] | PhysicalDistribute[130]@5 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Enforcer(ID, RequiredProperties):
      (0)129,  GATHER
  Chosen Expression ID: 101
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.0
    tupleSize=8.0
    width=1
    partial_count(*)#14 -> unknown(1.0)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,002,000,001
    Properties: ANY
    Expression ID: 101#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,002,000,001
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 101#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ────────────────────────────── BEST
    Cost: 54,002,000,001.02
    Properties: GATHER
    Expression ID: 129#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}

========== OPTIMIZED PLAN ==========
PhysicalResultSink[190] ( outputExprs=[matched#10] )
+--PhysicalHashAggregate[186]@3 ( stats=1, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(partial_count(*)#14) AS `matched`#10], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
   +--PhysicalDistribute[182]@5 ( stats=1, distributionSpec=DistributionSpecGather )
      +--PhysicalHashAggregate[178]@5 ( stats=1, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=false, groupByExpr=[], outputExpr=[partial_count(*) AS `partial_count(*)`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
         +--PhysicalProject[174]@2 ( stats=3,000,000, projects=[1 AS `1`#13] )
            +--PhysicalFilter[170]@1 ( stats=3,000,000, predicates=AND[(event_date#0 = 2026-06-15),cast(element_at(message#7, 'mainDomain') as TEXT) IN ('www.example.com', 'api.example.com'),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) >= 400),(cast(element_at(message#7, 'httpStatusCode') as BIGINT) <= 599),(cast(element_at(message, 'url') as TEXT) like '%/api/%')] )
               +--PhysicalFileScan[166]@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] ), Rewrite compensate predicate by view fail:compensatePredicates = SplitPredicate ( equalPredicate={}, rangePredicate={cast(element_at(message#7, 'mainDomain') as TEXT) IN ('www.example.com', 'api.example.com')=org.apache.doris.nereids.rules.exploration.mv.Predicates$ExpressionInfo@ec15b98, (cast(element_at(message#7, 'httpStatusCode') as BIGINT) >= 400)=org.apache.doris.nereids.rules.exploration.mv.Predicates$ExpressionInfo@ec15b98, (cast(element_at(message#7, 'httpStatusCode') as BIGINT) <= 599)=org.apache.doris.nereids.rules.exploration.mv.Predicates$ExpressionInfo@ec15b98}, residualPredicate={(cast(element_at(message, 'url') as TEXT) like '%/api/%')=org.apache.doris.nereids.rules.exploration.mv.Predicates$ExpressionInfo@ec15b98} ),
 mvExprToMvScanExprMapping = ExpressionMapping ( expressionMapping={event_date#0=[event_date#15], cast(element_at(message#7, 'mainDomain') as TEXT)=[main_domain#17], cast(element_at(message#7, 'anomalyType') as TEXT)=[anomaly_type#18], count(*)=[visit_count#19], sum(if(( not (cast(element_at(message#7, 'anomalyType') as TEXT) = 'normal')), 1, 0))=[anomaly_count#20], date_trunc(event_time#1, 'hour')=[event_hour#16]} ),
viewToQuerySlotMapping = SlotMapping{relationSlotMap={MappedSlot{slot=_last_updated_sequence_number#9}=MappedSlot{slot=_last_updated_sequence_number#9}, MappedSlot{slot=load_version#6}=MappedSlot{slot=load_version#6}, MappedSlot{slot=_row_id#8}=MappedSlot{slot=_row_id#8}, MappedSlot{slot=event_date#0}=MappedSlot{slot=event_date#0}, MappedSlot{slot=dw_keyword#5}=MappedSlot{slot=dw_keyword#5}, MappedSlot{slot=source#4}=MappedSlot{slot=source#4}, MappedSlot{slot=event_id#3}=MappedSlot{slot=event_id#3}, MappedSlot{slot=event_time#1}=MappedSlot{slot=event_time#1}, MappedSlot{slot=message#7}=MappedSlot{slot=message#7}, MappedSlot{slot=event_time_ms#2}=MappedSlot{slot=event_time_ms#2}}}
