~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.h

  • Committer: Jay Pipes
  • Date: 2009-08-20 18:28:11 UTC
  • mfrom: (1108.6.52 optimizer)
  • mto: This revision was merged to the branch mainline in revision 1120.
  • Revision ID: jpipes@serialcoder-20090820182811-akpzlv3042dyyui7
Merge Padraig's optimizer refactoring around pulling structs into real classes...

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#ifndef DRIZZLED_JOIN_H
28
28
#define DRIZZLED_JOIN_H
29
29
 
 
30
#include <drizzled/optimizer/position.h>
30
31
#include <bitset>
31
32
 
32
33
class JOIN :public Sql_alloc
38
39
   * Contains a partial query execution plan which is extended during
39
40
   * cost-based optimization.
40
41
   */
41
 
  Position positions[MAX_TABLES+1];
 
42
  drizzled::optimizer::Position positions[MAX_TABLES+1];
42
43
 
43
44
  /**
44
45
   * Contains the optimal query execution plan after cost-based optimization
45
46
   * has taken place. 
46
47
   */
47
 
  Position best_positions[MAX_TABLES+1];
 
48
  drizzled::optimizer::Position best_positions[MAX_TABLES+1];
48
49
 
49
50
public:
50
51
  JoinTable *join_tab;
468
469
  void copyPartialPlanIntoOptimalPlan(uint32_t size)
469
470
  {
470
471
    memcpy(best_positions, positions, 
471
 
           sizeof(Position) * size);
 
472
           sizeof(drizzled::optimizer::Position) * size);
472
473
  }
473
474
 
474
475
  /**
476
477
   * @return a reference to the specified position in the optimal
477
478
   *         query plan
478
479
   */
479
 
  Position &getPosFromOptimalPlan(uint32_t index)
 
480
  drizzled::optimizer::Position &getPosFromOptimalPlan(uint32_t index)
480
481
  {
481
482
    return best_positions[index];
482
483
  }
486
487
   * @return a reference to the specified position in the partial
487
488
   *         query plan
488
489
   */
489
 
  Position &getPosFromPartialPlan(uint32_t index)
 
490
  drizzled::optimizer::Position &getPosFromPartialPlan(uint32_t index)
490
491
  {
491
492
    return positions[index];
492
493
  }
495
496
   * @param[in] index the index of the position to set
496
497
   * @param[in] in_pos the value to set the position to
497
498
   */
498
 
  void setPosInPartialPlan(uint32_t index, Position &in_pos)
 
499
  void setPosInPartialPlan(uint32_t index, drizzled::optimizer::Position &in_pos)
499
500
  {
500
501
    positions[index]= in_pos;
501
502
  }
503
504
  /**
504
505
   * @return a pointer to the first position in the partial query plan
505
506
   */
506
 
  Position *getFirstPosInPartialPlan()
 
507
  drizzled::optimizer::Position *getFirstPosInPartialPlan()
507
508
  {
508
509
    return positions;
509
510
  }
513
514
   *                  query plan
514
515
   * @return a pointer to the position in the partial query plan
515
516
   */
516
 
  Position *getSpecificPosInPartialPlan(int32_t index)
 
517
  drizzled::optimizer::Position *getSpecificPosInPartialPlan(int32_t index)
517
518
  {
518
519
    return positions + index;
519
520
  }