Package io.trino.cost

Class CostCalculatorWithEstimatedExchanges

java.lang.Object
io.trino.cost.CostCalculatorWithEstimatedExchanges
All Implemented Interfaces:
CostCalculator

@ThreadSafe public class CostCalculatorWithEstimatedExchanges extends Object implements CostCalculator
A wrapper around CostCalculator that estimates ExchangeNodes cost.

Certain rules (e.g. ReorderJoins and DetermineJoinDistributionType) are run before exchanges are added to a plan. This cost calculator adds the implied costs for the exchanges that will be added later. It is needed to account for the differences in exchange costs for different types of joins.