1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Copyright (C) 2008 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
20
20
#ifndef DRIZZLED_NESTED_JOIN_H
21
21
#define DRIZZLED_NESTED_JOIN_H
23
#include <drizzled/item.h>
24
#include <drizzled/lex_string.h>
25
#include <drizzled/sql_list.h>
37
/* list of elements in the nested join */
38
List<TableList> join_list;
40
/* bitmap of tables in the nested join */
41
table_map used_tables;
43
/* tables that rejects nulls */
44
table_map not_null_tables;
46
/* the first nested table in the plan */
47
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 */
50
30
Used to count tables in the nested join in 2 isolated places:
51
1. In make_outerjoin_info().
31
1. In make_outerjoin_info().
52
32
2. check_interleaving_with_nj/restore_prev_nj_state (these are called
53
by the join optimizer.
33
by the join optimizer.
54
34
Before each use the counters are zeroed by reset_nj_counters.
58
/* Bit used to identify this nested join*/
59
std::bitset<64> nj_map;
37
nested_join_map nj_map; /* Bit used to identify this nested join*/
62
39
(Valid only for semi-join nests) Bitmap of tables outside the semi-join
63
40
that are used within the semi-join's ON condition.
65
table_map sj_depends_on;
42
table_map sj_depends_on;
66
43
/* Outer non-trivially correlated tables */
67
table_map sj_corr_tables;
69
List<Item> sj_outer_expr_list;
72
True if this join nest node is completely covered by the query execution
73
plan. This means two things.
75
1. All tables on its @c join_list are covered by the plan.
77
2. All child join nest nodes are fully covered.
79
bool is_fully_covered() const { return join_list.elements == counter_; }
44
table_map sj_corr_tables;
45
List<Item> sj_outer_expr_list;
82
} /* namespace drizzled */
84
48
#endif /* DRIZZLED_NESTED_JOIN_H */