#include <Ql_algiterop.hxx>
Inherits Ql_iterop.
Inherited by Ql_upiterop.
Inheritance diagram for Ql_algiterop:
| Ql_algiterop::Ql_algiterop | ( | int | n, | |
| Ql_iterop * | i, | |||
| int | li | |||
| ) |
Construction of an algiterop operation. Parameters are used for the initialization of superclass Ql_iterop
| Ql_algiterop::~Ql_algiterop | ( | ) |
Destruction of an algiterop operation
| Ql_scanop* Ql_algiterop::scan_vars | ( | int | i | ) | [inline] |
| Ql_scanop** Ql_algiterop::scan_vars | ( | ) | [inline] |
| int Ql_algiterop::nb_scan_vars | ( | ) | [inline] |
| Ql_scanop* Ql_algiterop::schema_scan_vars | ( | int | i | ) | [inline] |
| Ql_scanop** Ql_algiterop::schema_scan_vars | ( | ) | [inline] |
| int Ql_algiterop::nb_schema_scan_vars | ( | ) | [inline] |
| Ql_scanop* Ql_algiterop::data_scan_vars | ( | int | i | ) | [inline] |
| Ql_scanop** Ql_algiterop::data_scan_vars | ( | ) | [inline] |
| int Ql_algiterop::nb_data_scan_vars | ( | ) | [inline] |
| Ql_operation* Ql_algiterop::criteria | ( | int | i | ) | [inline] |
| Ql_operation** Ql_algiterop::criteria | ( | ) | [inline] |
| int Ql_algiterop::nb_criteria | ( | ) | [inline] |
| Ql_operation* Ql_algiterop::projection | ( | ) | [inline] |
| Ql_operation* Ql_algiterop::projection | ( | int | i | ) | [inline] |
| int Ql_algiterop::res_computed | ( | ) | [inline] |
| int Ql_algiterop::nb_proj | ( | ) | [inline] |
| void Ql_algiterop::scan_vars | ( | Ql_scanop ** | v | ) | [inline] |
Set the array of scan variables defined in this iterator to v
| void Ql_algiterop::nb_scan_vars | ( | int | n | ) | [inline] |
Set the number of scan variables defined in this iterator to n
| void Ql_algiterop::schema_scan_vars | ( | Ql_scanop ** | v | ) | [inline] |
Set the array of schema scan variables defined in this iterator to v
| void Ql_algiterop::nb_schema_scan_vars | ( | int | n | ) | [inline] |
Set the number of schema scan variables defined in this iterator to n
| void Ql_algiterop::data_scan_vars | ( | Ql_scanop ** | v | ) | [inline] |
Set the array of data scan variables defined in this iterator to v
| void Ql_algiterop::nb_data_scan_vars | ( | int | n | ) | [inline] |
Set the number of data scan variables defined in this iterator to n
| void Ql_algiterop::inc_nb_scan_vars | ( | ) | [inline] |
Increase the number of scan variables defined in this iterator by 1
| void Ql_algiterop::inc_nb_schema_scan_vars | ( | ) | [inline] |
Increase the number of schema scan variables defined in this iterator by 1
| void Ql_algiterop::inc_nb_data_scan_vars | ( | ) | [inline] |
Increase the number of data scan variables defined in this iterator by 1
| void Ql_algiterop::criteria | ( | Ql_operation ** | c | ) | [inline] |
Set the array of criteria for this iterator to c
| void Ql_algiterop::nb_criteria | ( | int | n | ) | [inline] |
Set the number of criteria to n
| void Ql_algiterop::projection | ( | Ql_operation ** | c | ) | [inline] |
Set the list of projections for this iterator to c
| void Ql_algiterop::res_computed | ( | int | n | ) | [inline] |
Set an indicator to true (1) the first time that the result of "this" iterator is computed (and a corresponding bag is created), so that if there is a next time, we don't need to create the bag again
| void Ql_algiterop::nb_proj | ( | int | n | ) | [inline] |
Set the number of projections to n
| Ql_operation * Ql_algiterop::exists_var | ( | char * | var_name | ) | [virtual] |
Look for a variable in an algebraic iterator and its embedding iterators. Recursive function
| the | name of the variable we are looking for |
Implements Ql_iterop.
| int Ql_algiterop::is_equiv | ( | Ql_operation * | op, | |
| Ql_renaming * | renaming, | |||
| Ql_iterop * | circle | |||
| ) | [virtual] |
USED FOR TESTING THE EQUIVALENCE OF TWO ITERATORS.
The function is_equiv is recursive and is called in turn on every couple of OPERATIONS (i.e. iterator and non iterator) inside the iterators being tested until failure or success. It is always invoked with two parameters: one indicating the iterator on which the iterators we are testing depends (NULL if constant), and one indicating possible scan variables renaming of the inner iterators (the original couple of iterators + couples of iterators found on the way going down). The idea is that inside the surrounding iterator (circle <> NULL), the two operations must be equivalent (scan variable renaming) and that outside (circle == NULL) they must be strictly equal (i.e. pointers equality)
| op | the operation to check equivalence with | |
| renaming | possible scan variables renaming of the inner iterators (the original couple of iterators + couples of iterators found on the way going down) | |
| circle | indicates if we are inside a surrounding iterator (if <> NULL) or just inside the main query and not inside any iterator (if == NULL) |
Implements Ql_operation.
| int Ql_algiterop::type_infer | ( | int * | error_code | ) |
Type inference for an algebraic iterator. Creates type for the result as well as a bag to store it, if necessary
Reimplemented in Ql_upiterop.
| int Ql_algiterop::add_proj_criteria_sfw | ( | Ql_query * | query, | |
| Ql_tree_node * | query_tree, | |||
| Ql_dup_cell * | cnf_dup_table, | |||
| Ql_argument * | ql_arguments, | |||
| int * | error_code, | |||
| Ql_iterop * | current_iter | |||
| ) |
Used for constructing the projection and criteria attributes of a sfw filter. A sfw always has one criterium per scan variable + 1. v_criteria[0] is used for the conditions depending one more than one variables (join conditions) or on another iterator (join or dependent join conditions) (and-ed if more than one/null if none). Conditions on others iterator occur too rarely to be optimized. They won't be evaluated more than needed anyway. v_criteria[0] is tested after each new assignment of any of the scan variables. v_criteria[i] contains the conditions dependending on one scan variable only (anded if more than one/null if none) and i=the scan var position + 1. For anding together several criteria, we use the above function (add_condition_in_criterium_sfw()). v_criteria[i] is evaluated after each assignment on variable i, if it is not "pushable" to the underlying DBMS, (i.e. expressible in its query language) * so that it can be pushed in the scan query and be evaluated by the DBMS.
| query | the query graph | |
| query_tree | the parse tree of the query | |
| cnf_dup_table | a table containing should be duplicated syntactical subtrees (because of conjunctive normal form) | |
| ql_arguments | ||
| error_code | a placeholder, where an error code is put, in case of error |
| void Ql_algiterop::add_condition_in_criterium_sfw | ( | Ql_operation * | one_condition, | |
| int | criterium_pos | |||
| ) |
Add a condition in a sfw criterium If the criterium is empty, just put it in If it contains an and_n op, add a parameter in the and operation If it contains another op, create an and operation and add the new op and the existing op as its parameters
| one_condition | the condition to be added | |
| criterium_pos | the position in the criteria array where the condition should be put. If it is a filtering condition (that depends only on one variable) it is put in criteria[i+1], where i is the position of the variable in the scan vars array. Join conditions (that depends on more than one scan variables) are put in criteria[0] |
| void Ql_algiterop::my_add_condition_in_criterium_sfw | ( | Ql_operation * | condition, | |
| int | criterium_pos | |||
| ) |
Simpler version of the add_proj_criteria_sfw. Creates always nested binary and operations, instead of n-ary, in the case of multiple conditions that should be put in the same position in the criteria array
| one_condition | the condition to be added | |
| criterium_pos | the position in the criteria array where the condition should be put. If it is a filtering condition (that depends only on one variable) it is put in criteria[i+1], where i is the position of the variable in the scan vars array. Join conditions (that depends on more than one scan variables) are put in criteria[0] |
| int Ql_algiterop::add_proj_criteria_sort | ( | Ql_query * | query, | |
| Ql_tree_node * | query_tree, | |||
| Ql_dup_cell * | cnf_dup_table, | |||
| Ql_argument * | ql_arguments, | |||
| int * | error_code | |||
| ) |
-- Not implemented in current version! -- Used for constructing the proj and criteria attributes of a sort.
| int Ql_algiterop::add_criteria_group | ( | Ql_query * | query, | |
| Ql_tree_node * | query_tree, | |||
| Ql_dup_cell * | cnf_dup_table, | |||
| Ql_argument * | ql_arguments, | |||
| int * | error_code | |||
| ) |
-- Not implemented in current version! -- Used for constructing the criteria attributes of a group
| int Ql_algiterop::add_partition_group | ( | int * | error_code | ) |
-- Not implemented in current version! -- Used for constructing the partition name_var for a group
| int Ql_algiterop::add_with_group | ( | Ql_query * | query, | |
| Ql_tree_node * | query_tree, | |||
| Ql_dup_cell * | cnf_dup_table, | |||
| Ql_argument * | ql_arguments, | |||
| int * | error_code | |||
| ) |
-- Not implemented in current version! -- Used for constructing the with name_vars for a group
| int Ql_algiterop::add_proj_group | ( | Ql_query * | query, | |
| Ql_tree_node * | query_tree, | |||
| int * | error_code | |||
| ) |
-- Not implemented in current version! -- Used for constructing the projection att for a group
| void Ql_algiterop::sfw_order_scans | ( | ) |
Reorder the scans in this iterator so that schema scans are evaluated before data scans
| void Ql_algiterop::optimize | ( | int * | ) | [inline] |
Dummy method - no explicit optimization/rewriting implemented ... yet, except for scans reordering by sfw_order_scans()
1.5.0