20
20
#ifndef DRIZZLED_NESTED_JOIN_H
21
21
#define DRIZZLED_NESTED_JOIN_H
23
#include <drizzled/sql_list.h>
24
#include <drizzled/sql_bitmap.h>
25
#include <drizzled/item.h>
26
#include <drizzled/table_list.h>
33
23
struct nested_join_st
35
/* list of elements in the nested join */
36
List<TableList> join_list;
38
/* bitmap of tables in the nested join */
39
table_map used_tables;
41
/* tables that rejects nulls */
42
table_map not_null_tables;
44
/* the first nested table in the plan */
45
JoinTable *first_nested;
25
List<TableList> join_list; /* list of elements in the nested join */
26
table_map used_tables; /* bitmap of tables in the nested join */
27
table_map not_null_tables; /* tables that rejects nulls */
28
struct st_join_table *first_nested;/* the first nested table in the plan */
48
30
Used to count tables in the nested join in 2 isolated places:
49
1. In make_outerjoin_info().
31
1. In make_outerjoin_info().
50
32
2. check_interleaving_with_nj/restore_prev_nj_state (these are called
51
by the join optimizer.
33
by the join optimizer.
52
34
Before each use the counters are zeroed by reset_nj_counters.
56
/* Bit used to identify this nested join*/
57
std::bitset<64> nj_map;
37
nested_join_map nj_map; /* Bit used to identify this nested join*/
60
39
(Valid only for semi-join nests) Bitmap of tables outside the semi-join
61
40
that are used within the semi-join's ON condition.
63
table_map sj_depends_on;
42
table_map sj_depends_on;
64
43
/* Outer non-trivially correlated tables */
65
table_map sj_corr_tables;
67
List<Item> sj_outer_expr_list;
70
True if this join nest node is completely covered by the query execution
71
plan. This means two things.
73
1. All tables on its @c join_list are covered by the plan.
75
2. All child join nest nodes are fully covered.
77
bool is_fully_covered() const { return join_list.elements == counter_; }
44
table_map sj_corr_tables;
45
List<Item> sj_outer_expr_list;
80
} /* namespace drizzled */
82
48
#endif /* DRIZZLED_NESTED_JOIN_H */