~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.h

Made the best_positions member of the JOIN class private and added any
necessary accessors for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
{
32
32
  JOIN(const JOIN &rhs);                        /**< not implemented */
33
33
  JOIN& operator=(const JOIN &rhs);             /**< not implemented */
 
34
 
 
35
  /**
 
36
   * Contains the optimal query execution plan after cost-based optimization
 
37
   * has taken place. 
 
38
   */
 
39
  Position best_positions[MAX_TABLES+1];
 
40
 
34
41
public:
35
42
  JoinTable *join_tab;
36
43
  JoinTable **best_ref;
130
137
  SQL_SELECT *select; /**< created in optimisation phase */
131
138
  Array<Item_in_subselect> sj_subselects;
132
139
 
133
 
  Position positions[MAX_TABLES+1];
134
 
  Position best_positions[MAX_TABLES+1];
135
140
 
136
141
  /**
137
142
    Bitmap of nested joins embedding the position at the end of the current
139
144
  */
140
145
  nested_join_map cur_embedding_map;
141
146
 
 
147
  /**
 
148
   * Contains a partial query execution plan which is extended during
 
149
   * cost-based optimization.
 
150
   */
 
151
  Position positions[MAX_TABLES+1];
 
152
 
 
153
  /**
 
154
   * The cost for the final query execution plan chosen after optimization
 
155
   * has completed. The QEP is stored in the best_positions variable.
 
156
   */
142
157
  double best_read;
143
158
  List<Cached_item> group_fields;
144
159
  List<Cached_item> group_fields_cache;
443
458
    return (unit == &session->lex->unit && (unit->fake_select_lex == 0 ||
444
459
                                        select_lex == unit->fake_select_lex));
445
460
  }
 
461
 
 
462
  void copyPartialPlanIntoOptimalPlan(uint32_t size)
 
463
  {
 
464
    memcpy(best_positions, positions, 
 
465
           sizeof(Position) * size);
 
466
  }
 
467
 
 
468
  Position &getPosFromOptimalPlan(uint32_t index)
 
469
  {
 
470
    return best_positions[index];
 
471
  }
 
472
 
446
473
};
447
474
 
448
475
enum_nested_loop_state evaluate_join_record(JOIN *join, JoinTable *join_tab, int error);