![]() |
mutable
A Database System for Research and Fast Prototyping
|
A Query
in a QueryGraph
is a DataSource
that represents a nested query.
More...
#include <QueryGraph.hpp>
Public Member Functions | |
QueryGraph & | query_graph () const |
Returns a reference to the internal QueryGraph . | |
ThreadSafePooledOptionalString | name () const override |
Returns the name of this DataSource . | |
bool | is_correlated () const override |
Returns true iff the data source is correlated. | |
std::size_t | id () const |
Returns the id of this DataSource . | |
const ThreadSafePooledOptionalString & | alias () const |
Returns the alias of this DataSource . | |
const cnf::CNF & | filter () const |
Returns the filter of this DataSource . | |
void | update_filter (cnf::CNF filter) |
Adds filter to the current filter of this DataSource by logical conjunction. | |
void | add_join (Join &join) |
Adds join to the set of Join s of this DataSource . | |
const auto & | joins () const |
Returns a reference to the Join s using this DataSource . | |
bool | operator== (const DataSource &other) const |
bool | operator!= (const DataSource &other) const |
Private Member Functions | |
Query (std::size_t id, ThreadSafePooledOptionalString alias, std::unique_ptr< QueryGraph > query_graph) | |
void | remove_join (Join &join) |
Private Attributes | |
std::unique_ptr< QueryGraph > | query_graph_ |
query graph of the sub-query | |
cnf::CNF | filter_ |
filter condition on this data source | |
std::vector< std::reference_wrapper< Join > > | joins_ |
joins with this data source | |
ThreadSafePooledOptionalString | alias_ |
alias of this data source, may not have a value if this data source has no alias | |
std::size_t | id_ |
unique identifier of this data source within its query graph | |
bool | decorrelated_ = true |
indicates whether this source is already decorrelated | |
Friends | |
struct | QueryGraph |
A Query
in a QueryGraph
is a DataSource
that represents a nested query.
As such, a Query
contains a QueryGraph
. A Query
must be evaluated to acquire its sequence of tuples.
Definition at line 115 of file QueryGraph.hpp.
|
inlineprivate |
Definition at line 123 of file QueryGraph.hpp.
|
inlineinherited |
Adds join
to the set of Join
s of this DataSource
.
Definition at line 67 of file QueryGraph.hpp.
|
inlineinherited |
Returns the alias of this DataSource
.
May not have a value.
Definition at line 58 of file QueryGraph.hpp.
|
inlineinherited |
|
inlineinherited |
Returns the id of this DataSource
.
Definition at line 56 of file QueryGraph.hpp.
|
overridevirtual |
Returns true
iff the data source is correlated.
Implements m::DataSource.
Definition at line 21 of file QueryGraph.cpp.
References query_graph_.
|
inlineinherited |
Returns a reference to the Join
s using this DataSource
.
Definition at line 69 of file QueryGraph.hpp.
|
inlineoverridevirtual |
Returns the name of this DataSource
.
Either the same as alias()
, if an alias is given, otherwise the name of the referenced Table
. Returned value might be empty for anonymous nested queries (e.g. in a WHERE clause).
Implements m::DataSource.
Definition at line 131 of file QueryGraph.hpp.
|
inlineinherited |
Definition at line 84 of file QueryGraph.hpp.
|
inlineinherited |
Definition at line 83 of file QueryGraph.hpp.
References m::DataSource::id_.
|
inline |
Returns a reference to the internal QueryGraph
.
Definition at line 129 of file QueryGraph.hpp.
|
inlineprivateinherited |
Definition at line 75 of file QueryGraph.hpp.
|
inlineinherited |
Adds filter
to the current filter of this DataSource
by logical conjunction.
Definition at line 65 of file QueryGraph.hpp.
References and().
Referenced by m::QueryGraph::add_custom_filter().
|
friend |
Definition at line 117 of file QueryGraph.hpp.
|
privateinherited |
alias of this data source, may not have a value if this data source has no alias
Definition at line 41 of file QueryGraph.hpp.
|
privateinherited |
indicates whether this source is already decorrelated
Definition at line 44 of file QueryGraph.hpp.
|
privateinherited |
filter condition on this data source
Definition at line 39 of file QueryGraph.hpp.
|
privateinherited |
unique identifier of this data source within its query graph
Definition at line 42 of file QueryGraph.hpp.
Referenced by m::DataSource::operator==().
|
privateinherited |
joins with this data source
Definition at line 40 of file QueryGraph.hpp.
|
private |
query graph of the sub-query
Definition at line 120 of file QueryGraph.hpp.
Referenced by is_correlated().