Source:
<code>public void estimateCost(Optimizable innerTable, OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, CostEstimate innerCost) throws StandardException{ if(outerCost.isUninitialized() ||(outerCost.localCost()==0d && outerCost.getEstimatedRowCount()==1.0)){ RowOrdering ro = outerCost.getRowOrdering(); if(ro!=null) outerCost.setRowOrdering(ro); return; } SpliceLogUtils.trace(LOG,"rightResultSetCostEstimate outerCost=%s, innerFullKeyCost=%s",outerCost,innerCost); innerCost.setBase(innerCost.cloneMe()); double estimatedRowCount = innerCost.getEstimatedRowCount(); SConfiguration configuration=EngineDriver.driver().getConfiguration(); long rowCountThreshold = configuration.getBroadcastRegionRowThreshold(); <START> broadcastInner = estimatedRowCount < rowCountThreshold; <END> double joinSelectivity = SelectivityUtil.estimateJoinSelectivity(innerTable, cd, predList, (long) innerCost.rowCount(), (long) outerCost.rowCount(), outerCost, SelectivityUtil.JoinPredicateType.ALL); double totalOutputRows = SelectivityUtil.getTotalRows(joinSelectivity, outerCost.rowCount(), innerCost.rowCount()); double totalJoinedRows = outerCost.rowCount() * innerCost.rowCount(); double joinCost = crossJoinStrategyLocalCost(innerCost, outerCost, totalJoinedRows); innerCost.setLocalCost(joinCost); innerCost.setLocalCostPerPartition(joinCost); double remoteCostPerPartition = SelectivityUtil.getTotalPerPartitionRemoteCost(innerCost, outerCost, totalOutputRows); innerCost.setRemoteCost(remoteCostPerPartition); innerCost.setRemoteCostPerPartition(remoteCostPerPartition); innerCost.setRowCount(totalOutputRows); innerCost.setEstimatedHeapSize((long) SelectivityUtil.getTotalHeapSize(innerCost, outerCost, totalOutputRows)); innerCost.setNumPartitions(outerCost.partitionCount()); innerCost.setRowOrdering(null); }</code><technical_language>I realize share CrossJoinStrategy for cross joins in query, set braodcastInner flag in cross join applied cross joins in query, is right</technical_language>

Target:
public void estimateCost(Optimizable innerTable, OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, CostEstimate innerCost) throws StandardException{ if(outerCost.isUninitialized() ||(outerCost.localCost()==0d && outerCost.getEstimatedRowCount()==1.0)){ RowOrdering ro = outerCost.getRowOrdering(); if(ro!=null) outerCost.setRowOrdering(ro); return; } SpliceLogUtils.trace(LOG,"rightResultSetCostEstimate outerCost=%s, innerFullKeyCost=%s",outerCost,innerCost); innerCost.setBase(innerCost.cloneMe()); double joinSelectivity = SelectivityUtil.estimateJoinSelectivity(innerTable, cd, predList, (long) innerCost.rowCount(), (long) outerCost.rowCount(), outerCost, SelectivityUtil.JoinPredicateType.ALL); double totalOutputRows = SelectivityUtil.getTotalRows(joinSelectivity, outerCost.rowCount(), innerCost.rowCount()); double totalJoinedRows = outerCost.rowCount() * innerCost.rowCount(); double joinCost = crossJoinStrategyLocalCost(innerCost, outerCost, totalJoinedRows); innerCost.setLocalCost(joinCost); innerCost.setLocalCostPerPartition(joinCost); double remoteCostPerPartition = SelectivityUtil.getTotalPerPartitionRemoteCost(innerCost, outerCost, totalOutputRows); innerCost.setRemoteCost(remoteCostPerPartition); innerCost.setRemoteCostPerPartition(remoteCostPerPartition); innerCost.setRowCount(totalOutputRows); innerCost.setEstimatedHeapSize((long) SelectivityUtil.getTotalHeapSize(innerCost, outerCost, totalOutputRows)); innerCost.setNumPartitions(outerCost.partitionCount()); innerCost.setRowOrdering(null); }