Interface Lattice
- All Known Implementing Classes:
LatticeImpl
,MonteCarloLatticeImpl
public interface Lattice
Data structure which contains the set of all possible aggregates,
arranged so that you can navigate from any aggregate to its parents
(aggregates having precisely one more attribute) and to its children
(aggregates having precisely one fewer attribute).
The top of the lattice is the aggregate with no attributes and one row, that is, the grand total. The bottom of the lattice is the aggregate with all attributes, which is the same as the fully joined star schema with any duplicate rows removed.
-
Method Summary
Modifier and TypeMethodDescriptionchooseAggregate
(double maxCost, double minCostBenefitRatio, Cost cost) Chooses the next un-materialized aggregate with the highest incremental benefit.copy()
Returns a copy of this lattice.costBenefitOf
(AggregateImpl aggregate) Returns an object representing the cost of the given aggregate, and benefit of adding it to the current lattice.void
materialize
(AggregateImpl aggregate) Materializes an aggregate.
-
Method Details
-
chooseAggregate
Chooses the next un-materialized aggregate with the highest incremental benefit.- Parameters:
maxCost
- Maximum costminCostBenefitRatio
- Minimum cost/benefit ratiocost
- Output parameter, is populated with the benefit and the number of queries which will benefit by materializing the chosen aggregate- Returns:
- Chosen aggregate
-
materialize
Materializes an aggregate.- Parameters:
aggregate
- Aggregate
-
getMaterializedAggregates
List<AggregateImpl> getMaterializedAggregates() -
costBenefitOf
Returns an object representing the cost of the given aggregate, and benefit of adding it to the current lattice.- Parameters:
aggregate
- Aggregate- Returns:
- Incremental cost/benefit of the aggregate
-
copy
Lattice copy()Returns a copy of this lattice.
-