public class SelectPlan extends ReduceRecordsPlan
Plan class corresponding to the select relational
algebra operator.| Constructor and Description |
|---|
SelectPlan(Plan p,
Predicate pred)
Creates a new select node in the query tree, having the specified
subquery and predicate.
|
| Modifier and Type | Method and Description |
|---|---|
long |
blocksAccessed()
Estimates the number of block accesses in the selection.
|
static Bucket |
constantRangeBucket(Bucket bkt,
ConstantRange cRange)
Creates a new bucket by keeping the statistics of records and values in
the specified bucket falling within the specified search range.
|
static Histogram |
constantRangeHistogram(Histogram hist,
Map<String,ConstantRange> cRanges)
Returns a histogram that, for each field, approximates the distribution
of values from the specified histogram falling within the specified
search range.
|
Histogram |
histogram()
Returns the histogram that approximates the join distribution of the
field values of query results.
|
static Bucket |
joinFieldBucket(Bucket bkt1,
Bucket bkt2,
double numRec)
Creates a new bucket by keeping the statistics of joining records and
values from the two specified buckets.
|
static Histogram |
joinFieldsHistogram(Histogram hist,
Set<String> group)
Returns a histogram that, for each field, approximates the distribution
of values from the specified histogram joining with other fields in the
specified group.
|
Scan |
open()
Creates a select scan for this query.
|
static Histogram |
predHistogram(Histogram hist,
Predicate pred)
Returns a histogram that, for each field, approximates the distribution
of field values from the specified histogram satisfying the specified
predicate.
|
long |
recordsOutput()
Returns an estimate of the number of records in the query's output table.
|
Schema |
schema()
Returns the schema of the selection, which is the same as in the
underlying query.
|
String |
toString() |
syncHistogrampublic static Histogram predHistogram(Histogram hist, Predicate pred)
Assumes that:
hist - the input join distribution of field valuespred - the predicatepublic static Histogram constantRangeHistogram(Histogram hist, Map<String,ConstantRange> cRanges)
Assumes that:
hist - the input histogramcRanges - a map from fields to search rangespublic static Bucket constantRangeBucket(Bucket bkt, ConstantRange cRange)
Assumes that:
bkt - the input bucketcRange - the search rangepublic static Histogram joinFieldsHistogram(Histogram hist, Set<String> group)
Assumes that:
hist - the input histogramgroup - the group of joining fieldspublic static Bucket joinFieldBucket(Bucket bkt1, Bucket bkt2, double numRec)
Assumes that:
bkt1 - the input bucket 1bkt2 - the input bucket 2numRec - the total number of records in the histogram where
bkt1 and bkt2 belong topublic Scan open()
Plan.open()public long blocksAccessed()
Plan.blocksAccessed()public Schema schema()
Plan.schema()public Histogram histogram()
Plan.histogram()public long recordsOutput()
PlanCopyright © 2022 VanillaDB Organization. All rights reserved.