public abstract class SampleBase extends Object
IMemoryManager
so they do not pose a burden on the heap. This will require us to
manage the allocation contexts so we can release samples in a timely
manner once they are no longer used and always release samples by
the time the RTO is finished. [There is an additional twist if we
have fully materialized some part of the join since we no longer
need to evaluate that path segment. If the RTO can interleave query
evaluation with exploration then we can take advantage of these
materialized solutions.]Modifier and Type | Field and Description |
---|---|
long |
estCard
The total estimated cardinality of the underlying access path (for a
vertex) or the join path segment (for a cutoff join).
|
EstimateEnum |
estimateEnum
Indicates whether the estimate is exact, an upper bound, or a lower
bound.
|
int |
limit
The limit used to produce the
sample . |
Constructor and Description |
---|
SampleBase(long estimatedCardinality,
int limit,
EstimateEnum estimateEnum,
IBindingSet[] sample) |
Modifier and Type | Method and Description |
---|---|
IBindingSet[] |
getSample()
The sampled solution set.
|
boolean |
isExact()
Return
true iff this sample is the fully materialized
solution for the vertex or join path segment. |
boolean |
isUnderflow()
Return
true iff this sample has cardinality underflow (the
sample is empty). |
String |
toString() |
protected void |
toString(StringBuilder sb)
Hook for extending
toString() . |
public final long estCard
public final int limit
sample
.public final EstimateEnum estimateEnum
EstimateEnum.Exact
, we
could run the join against the sample rather than the disk by wrapping
the sample as an inline access path.
TODO This field should be used to avoid needless re-computation of a join
whose exact solution is already known. We already do this within the
runtime optimizer. To go further than that we need to do the partial
evaluation of the join graph.public SampleBase(long estimatedCardinality, int limit, EstimateEnum estimateEnum, IBindingSet[] sample)
estimatedCardinality
- The estimated cardinality.limit
- The cutoff limit used to make that cardinality estimate.estimateEnum
- Type safe enumeration indication various edge conditions which
can arise when making a cardinality estimate.sample
- The sample.public boolean isExact()
true
iff this sample is the fully materialized
solution for the vertex or join path segment.public boolean isUnderflow()
true
iff this sample has cardinality underflow (the
sample is empty). Cardinality underflow occurs when the sampling process
was unable to find any solutions. Underflow is typically addressed by
increasing the sample size, but sometimes underflow indicates that an
access path (if it has filters) or a join may not have any solutions in
the data.public IBindingSet[] getSample()
null
if it has been
released.
TODO Wrap up as an IChunkMessage
so we can store this on
the native heap?protected void toString(StringBuilder sb)
toString()
.sb
- The buffer into which the implementation can write additional
information.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.