Documentation ¶
Index ¶
- type Aggregation
- type AndPredicate
- type ArraySizeComparisonPredicate
- type BoolEqualityPredicate
- type CountAggregation
- type ExistsPredicate
- type FloatComparisonPredicate
- type GlobalCountAggregation
- type GroupedAggregation
- type IntEqualityPredicate
- type IsStringPredicate
- type ObjectSizeComparisonPredicate
- type OrPredicate
- type Predicate
- type Query
- func (q *Query) Aggregate(agg Aggregation) *Query
- func (q *Query) Aggregation() Aggregation
- func (q *Query) AggregationIsGrouped() bool
- func (q *Query) Base() *dataset.DataSet
- func (q *Query) BaseName() string
- func (q *Query) BasedOn(query *Query) *Query
- func (q Query) CopyWithoutAggregation() Query
- func (q *Query) CreateFrom() Query
- func (q *Query) Filter(predicate Predicate) *Query
- func (q *Query) FilterPredicate() Predicate
- func (q *Query) GenerateDataset() dataset.DataSet
- func (q *Query) GetBaseQuery() *Query
- func (q Query) IsCopy() bool
- func (q *Query) Load(dataSet *dataset.DataSet) *Query
- func (q Query) MergeQuery() Query
- func (q *Query) Store(name string) *Query
- func (q *Query) StoreName() string
- func (q *Query) String() string
- type StrEqualityPredicate
- type StrPrefixPredicate
- type SumAggregation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
type Aggregation interface { // Translates the aggregation to a human readable format String() string // The target name of the attribute holding this aggregation Name() string }
A Aggregation represents operations performed during the aggregation phase
type AndPredicate ¶
AndPredicate evaluates the boolean AND operation between two predicates
func (AndPredicate) Selectivity ¶
func (p AndPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by multiplying the selectivities of the sub-predicates
func (AndPredicate) String ¶
func (q AndPredicate) String() string
type ArraySizeComparisonPredicate ¶
ArraySizeComparisonPredicate evaluates the Number comparison (<,>,<=,>=) operation between the number of entries in an array path and a given number
func (ArraySizeComparisonPredicate) Selectivity ¶
func (p ArraySizeComparisonPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.33333 is assumed and returned (predicate selects 1/3 of all documents) If min and max exists, a uniform distribution is assumed if the value is within the bounds and a selectivity of (1/(max-min)) is returned.
func (ArraySizeComparisonPredicate) String ¶
func (q ArraySizeComparisonPredicate) String() string
type BoolEqualityPredicate ¶
BoolEqualityPredicate evaluates the boolean equality operation between a path and a boolean
func (BoolEqualityPredicate) Selectivity ¶
func (p BoolEqualityPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.5 is assumed and returned (predicate selects 50% of all documents) If true/false counts exist, an exact selectivity is returned.
func (BoolEqualityPredicate) String ¶
func (q BoolEqualityPredicate) String() string
type CountAggregation ¶
type CountAggregation struct { // The path to aggregate Path string }
func (CountAggregation) Name ¶
func (q CountAggregation) Name() string
func (CountAggregation) String ¶
func (q CountAggregation) String() string
type ExistsPredicate ¶
type ExistsPredicate struct {
Path string
}
Predicate evaluating the existence of the given path
func (ExistsPredicate) Selectivity ¶
func (p ExistsPredicate) Selectivity(d dataset.DataSet) float64
func (ExistsPredicate) String ¶
func (q ExistsPredicate) String() string
type FloatComparisonPredicate ¶
FloatComparisonPredicate evaluates the Number comparison (<,>,<=,>=) operation between a path and a given number
func (FloatComparisonPredicate) Selectivity ¶
func (p FloatComparisonPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.33333 is assumed and returned (predicate selects 1/3 of all documents) If min and max exists, a uniform distribution is assumed if the value is within the bounds and a selectivity of (1/(max-min)) is returned.
func (FloatComparisonPredicate) String ¶
func (q FloatComparisonPredicate) String() string
type GlobalCountAggregation ¶
type GlobalCountAggregation struct { // The path to aggregate Path string }
func (GlobalCountAggregation) Name ¶
func (q GlobalCountAggregation) Name() string
func (GlobalCountAggregation) String ¶
func (q GlobalCountAggregation) String() string
type GroupedAggregation ¶
type GroupedAggregation struct { // The path to aggregate Path string // Subaggregation to use Agg Aggregation }
func (GroupedAggregation) Name ¶
func (q GroupedAggregation) Name() string
func (GroupedAggregation) String ¶
func (q GroupedAggregation) String() string
type IntEqualityPredicate ¶
IntEqualityPredicate evaluates the Number equality operation between a path and a given number
func (IntEqualityPredicate) Selectivity ¶
func (p IntEqualityPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.01 is assumed and returned (predicate selects 1% of all documents) If a count exists, equality assumes that exactly one element is chosen, hence a selectivity of 1/count is returned. If min and max exists, a uniform distribution is assumed if the value is within the bounds and a selectivity of (1/(max-min)) is returned.
func (IntEqualityPredicate) String ¶
func (q IntEqualityPredicate) String() string
type IsStringPredicate ¶
type IsStringPredicate struct {
Path string
}
Predicate evaluating the type of the given path
func (IsStringPredicate) Selectivity ¶
func (p IsStringPredicate) Selectivity(d dataset.DataSet) float64
func (IsStringPredicate) String ¶
func (q IsStringPredicate) String() string
type ObjectSizeComparisonPredicate ¶
ObjectSizeComparisonPredicate evaluates the Number comparison (<,>,<=,>=) operation between the number of members in a path and a given number
func (ObjectSizeComparisonPredicate) Selectivity ¶
func (p ObjectSizeComparisonPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.33333 is assumed and returned (predicate selects 1/3 of all documents) If min and max exists, a uniform distribution is assumed if the value is within the bounds and a selectivity of (1/(max-min)) is returned.
func (ObjectSizeComparisonPredicate) String ¶
func (q ObjectSizeComparisonPredicate) String() string
type OrPredicate ¶
OrPredicate evaluates the boolean OR operation between two predicates
func (OrPredicate) Selectivity ¶
func (p OrPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by adding the selectivities of the sub-predicates
func (OrPredicate) String ¶
func (q OrPredicate) String() string
type Predicate ¶
type Predicate interface { // Returns the estimated selectivity of filtering the given dataset with the predicate Selectivity(d dataset.DataSet) float64 // Translates the predicate to a human readable format String() string }
A Predicate represents operations performed during the filter phase
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query struct, specifying how the queries are constructed.
func RemoveIntermediateSets ¶
func (*Query) Aggregate ¶
func (q *Query) Aggregate(agg Aggregation) *Query
Sets the aggreation of the query
func (*Query) Aggregation ¶
func (q *Query) Aggregation() Aggregation
Gets the aggregation of the query
func (*Query) AggregationIsGrouped ¶
func (Query) CopyWithoutAggregation ¶
Creates a copy of the query without any aggregation
func (*Query) CreateFrom ¶
func (*Query) Filter ¶
Filters the loaded dataset by a predicate (e.g.: WHERE x; CHOOSE x; FILTER x;)
func (*Query) FilterPredicate ¶
Gets the name of the storing dataset
func (*Query) GenerateDataset ¶
Uses the selectivity estimation to create a new mock dataset based on the query result
func (*Query) GetBaseQuery ¶
func (Query) MergeQuery ¶
type StrEqualityPredicate ¶
StrEqualityPredicate evaluates the String equality operation between a path and a given string
func (StrEqualityPredicate) Selectivity ¶
func (p StrEqualityPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.01 is assumed and returned (predicate selects 1% of all documents) If a count exists, equality assumes that exactly one element is chosen, hence a selectivity of 1/count is returned. If min and max exists, a uniform distribution is assumed if the value is within the bounds and a selectivity of (1/(max-min)) is returned.
func (StrEqualityPredicate) String ¶
func (q StrEqualityPredicate) String() string
type StrPrefixPredicate ¶
StrPrefixPredicate checks if a given path contains a string with the given prefix
func (StrPrefixPredicate) Selectivity ¶
func (p StrPrefixPredicate) Selectivity(d dataset.DataSet) float64
Selectivity implements Predicate.Selectivity by estimating the selectivity given the data set. If no DataPath with matching type and path exists, 0 is returned If a data path exists, but has no count, 0.01 is assumed and returned (predicate selects 1% of all documents) If a count and prefix list exists with a matching prefix, uniform distribution is assumed and 1/#prefixes is returned
func (StrPrefixPredicate) String ¶
func (q StrPrefixPredicate) String() string
type SumAggregation ¶
type SumAggregation struct { // The path to aggregate Path string }
func (SumAggregation) Name ¶
func (q SumAggregation) Name() string
func (SumAggregation) String ¶
func (q SumAggregation) String() string