public abstract class LatticeImpl extends Object implements Lattice
| Modifier and Type | Field and Description |
|---|---|
protected List<AggregateImpl> |
materializedAggregates
List of all materialized tables.
|
protected Schema |
schema |
| Modifier | Constructor and Description |
|---|---|
protected |
LatticeImpl(Schema schema)
Creates a lattice.
|
| Modifier and Type | Method and Description |
|---|---|
static List<Algorithm.CostBenefit> |
computeAggregateCosts(Lattice lattice,
List<AggregateImpl> aggregateList) |
List<Algorithm.CostBenefit> |
computeAggregateCosts(List<AggregateImpl> aggregateList)
|
protected double |
estimateCost(double rowCount,
double factRowCount)
Returns an estimate of the cost, in terms of storage and computation
time, of creating an aggregate table.
|
protected List<AggregateImpl> |
findMaterializedDirectAscendants(AggregateImpl aggregate)
Returns a list of aggregates that are materialized, are an ascendant
of
aggregate (that is, a strict subset of its attributes),
and there is no intervening materialized aggregate. |
protected List<AggregateImpl> |
findMaterializedDirectDescendants(AggregateImpl aggregate)
Returns a list of aggregates that are materialized, are a descendant
of
aggregate (that is, a strict superset of its attributes),
and there is no intervening materialized aggregate. |
protected AggregateImpl |
findNearestMaterializedDescendant(AggregateImpl aggregate)
Finds the aggregate which is materialized, is a descendant of
aggregate (that is, it has a superset of its
attributes), and has the fewest rows among such aggregates. |
protected AggregateImpl |
getAggregate(BitSetPlus bits) |
protected double |
getBenefit(AggregateImpl aggregate,
int[] benefitCount0)
Returns the benefit of materializing an aggregate.
|
protected List<AggregateImpl> |
getChildren(AggregateImpl aggregate)
Returns a list of aggregates which can be computed from a given
aggregate by dropping one attribute.
|
List<AggregateImpl> |
getMaterializedAggregates() |
protected List<AggregateImpl> |
getParents(AggregateImpl aggregate)
Returns a list of aggregates which can be computed from a given
aggregate by adding one attribute.
|
void |
materialize(AggregateImpl aggregate)
Materializes an aggregate.
|
protected List<AggregateImpl> |
nonMaterializedDescendants(AggregateImpl aggregate,
boolean includeSelf)
Returns a list of the non-materialized descendants of an aggregate.
|
protected BitSetPlus |
toBits(long i) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchooseAggregate, copy, costBenefitOfprotected final Schema schema
protected List<AggregateImpl> materializedAggregates
protected LatticeImpl(Schema schema)
The lattice is fully populated with aggregates. The number of tables is exponential -- not advised if you have a large number of attributes.
The cost of each aggregate is the cost of scanning the fact table.
schema - Schemapublic List<AggregateImpl> getMaterializedAggregates()
getMaterializedAggregates in interface Latticeprotected List<AggregateImpl> getChildren(AggregateImpl aggregate)
aggregate - Aggregateprotected List<AggregateImpl> getParents(AggregateImpl aggregate)
aggregate - Aggregateprotected AggregateImpl getAggregate(BitSetPlus bits)
protected BitSetPlus toBits(long i)
protected List<AggregateImpl> nonMaterializedDescendants(AggregateImpl aggregate, boolean includeSelf)
aggregate - AggregateincludeSelf - Whether to include aggregate in the listprotected double getBenefit(AggregateImpl aggregate, int[] benefitCount0)
protected double estimateCost(double rowCount,
double factRowCount)
rowCount - Number of rows in aggregate table (determines the
amount of storage required for the aggregate table)factRowCount - Number of rows in the fact table (determines
the amount of computational effort to create the aggregate table)public void materialize(AggregateImpl aggregate)
Latticematerialize in interface Latticeaggregate - Aggregateprotected AggregateImpl findNearestMaterializedDescendant(AggregateImpl aggregate)
aggregate (that is, it has a superset of its
attributes), and has the fewest rows among such aggregates.
If there is no such aggregate, returns the fact table, so this method
never returns null.
This helps us compute the benefit of materializing
aggregate.aggregate - Aggregateprotected List<AggregateImpl> findMaterializedDirectDescendants(AggregateImpl aggregate)
aggregate (that is, a strict superset of its attributes),
and there is no intervening materialized aggregate.aggregate - Aggregateprotected List<AggregateImpl> findMaterializedDirectAscendants(AggregateImpl aggregate)
aggregate (that is, a strict subset of its attributes),
and there is no intervening materialized aggregate.aggregate - Aggregatepublic List<Algorithm.CostBenefit> computeAggregateCosts(List<AggregateImpl> aggregateList)
Algorithm.computeAggregateCosts(org.pentaho.aggdes.model.Schema, java.util.Map<org.pentaho.aggdes.model.Parameter, java.lang.Object>, java.util.List<org.pentaho.aggdes.model.Aggregate>).
The lattice must be empty when this method is called.aggregateList - List of aggregatespublic static List<Algorithm.CostBenefit> computeAggregateCosts(Lattice lattice, List<AggregateImpl> aggregateList)
Copyright © 2006–2016 Julian Hyde. All rights reserved.