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 Details

    • chooseAggregate

      AggregateImpl chooseAggregate(double maxCost, double minCostBenefitRatio, Cost cost)
      Chooses the next un-materialized aggregate with the highest incremental benefit.
      Parameters:
      maxCost - Maximum cost
      minCostBenefitRatio - Minimum cost/benefit ratio
      cost - Output parameter, is populated with the benefit and the number of queries which will benefit by materializing the chosen aggregate
      Returns:
      Chosen aggregate
    • materialize

      void materialize(AggregateImpl aggregate)
      Materializes an aggregate.
      Parameters:
      aggregate - Aggregate
    • getMaterializedAggregates

      List<AggregateImpl> getMaterializedAggregates()
    • costBenefitOf

      Algorithm.CostBenefit costBenefitOf(AggregateImpl aggregate)
      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.