~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to drizzled/nested_join.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <bitset>
27
27
 
28
 
namespace drizzled
29
 
{
30
 
class TableList;
31
 
class JoinTable;
 
28
namespace drizzled {
32
29
 
33
30
class NestedJoin
34
31
{
35
32
public:
 
33
  /*
 
34
    This constructor serves for creation of NestedJoin instances
 
35
  */
 
36
  NestedJoin() 
 
37
  :
 
38
  join_list(),
 
39
  used_tables(),
 
40
  not_null_tables(),
 
41
  first_nested(NULL),
 
42
  counter_(0),
 
43
  nj_map(),
 
44
  sj_depends_on(),
 
45
  sj_corr_tables(),
 
46
  sj_outer_expr_list()      
 
47
  { }    
 
48
 
36
49
  /* list of elements in the nested join */
37
50
  List<TableList> join_list;
38
51
 
39
52
  /* bitmap of tables in the nested join */
40
53
  table_map used_tables;
41
 
 
 
54
  
42
55
  /* tables that rejects nulls           */
43
56
  table_map not_null_tables;
44
57
 
52
65
    by the join optimizer.
53
66
    Before each use the counters are zeroed by reset_nj_counters.
54
67
  */
 
68
 
55
69
  uint32_t counter_;
56
70
 
57
71
  /* Bit used to identify this nested join*/
58
72
  std::bitset<64> nj_map;
59
73
 
60
74
  /*
 
75
     True if this join nest node is completely covered by the query execution
 
76
     plan. This means two things.
 
77
 
 
78
     1. All tables on its @c join_list are covered by the plan.
 
79
 
 
80
     2. All child join nest nodes are fully covered.
 
81
   */
 
82
 
 
83
  bool is_fully_covered() const { return join_list.size() == counter_; }
 
84
 
 
85
  /* To get the table_map sj_depends_on */
 
86
  table_map getSjDependsOn() const
 
87
  {
 
88
    return sj_depends_on;
 
89
  }
 
90
 
 
91
  /* To set the table_map sj_depends_on */
 
92
  void setSjDependsOn(const table_map &in_sj_depends_on)
 
93
  {
 
94
    sj_depends_on= in_sj_depends_on;
 
95
  }
 
96
 
 
97
  /* To get the table_map sj_corr_tables */
 
98
  table_map getSjCorrTables() const
 
99
  {
 
100
    return sj_corr_tables;
 
101
  }
 
102
  
 
103
  /* To set the table_map sj_corr_tables */
 
104
  void setSjCorrTables(const table_map &in_sj_corr_tables) 
 
105
  {
 
106
    sj_corr_tables= in_sj_corr_tables;
 
107
  }
 
108
 
 
109
  /* To get the List sj_outer_expr_list */
 
110
  const List<Item>& getSjOuterExprList() const
 
111
  {
 
112
    return sj_outer_expr_list;
 
113
  }
 
114
  
 
115
  /* To set the List sj_outer_expr_list */
 
116
  void setSjOuterExprList(const List<Item> &in_sj_outer_expr_list)
 
117
  {
 
118
    sj_outer_expr_list= in_sj_outer_expr_list;
 
119
  }
 
120
 
 
121
private:
 
122
  /*
61
123
    (Valid only for semi-join nests) Bitmap of tables outside the semi-join
62
124
    that are used within the semi-join's ON condition.
63
125
  */
64
126
  table_map sj_depends_on;
 
127
  
65
128
  /* Outer non-trivially correlated tables */
66
129
  table_map sj_corr_tables;
67
130
 
68
131
  List<Item> sj_outer_expr_list;
69
132
 
70
 
  /**
71
 
     True if this join nest node is completely covered by the query execution
72
 
     plan. This means two things.
73
 
 
74
 
     1. All tables on its @c join_list are covered by the plan.
75
 
 
76
 
     2. All child join nest nodes are fully covered.
77
 
   */
78
 
  bool is_fully_covered() const { return join_list.size() == counter_; }
79
133
};
80
134
 
81
135
} /* namespace drizzled */