~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-10 23:35:59 UTC
  • mto: (1115.3.10 captain)
  • mto: This revision was merged to the branch mainline in revision 1120.
  • Revision ID: osullivan.padraig@gmail.com-20090810233559-2ax654ye148d7fst
Added an optimizer namespace and sub-directory within drizzled. Moved the
Position class into its own header file within this sub-dir and declared the
Position class within the drizzled::optimizer namespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include "drizzled/index_hint.h"
48
48
 
49
49
#include <drizzled/sql_union.h>
 
50
#include <drizzled/optimizer/position.h>
50
51
 
51
52
#include <string>
52
53
#include <iostream>
53
54
#include <algorithm>
54
55
 
55
56
using namespace std;
 
57
using namespace drizzled;
56
58
 
57
59
static const string access_method_str[]=
58
60
{
4249
4251
  return 0;
4250
4252
}
4251
4253
 
4252
 
int join_read_const_table(JoinTable *tab, Position *pos)
 
4254
int join_read_const_table(JoinTable *tab, optimizer::Position *pos)
4253
4255
{
4254
4256
  int error;
4255
4257
  Table *table=tab->table;
5575
5577
    uint32_t tablenr= tab - join->join_tab;
5576
5578
    ha_rows table_records= table->file->stats.records;
5577
5579
    bool group= join->group && order == join->group_list;
5578
 
    Position cur_pos;
 
5580
    optimizer::Position cur_pos;
5579
5581
 
5580
5582
    /*
5581
5583
      If not used with LIMIT, only use keys if the whole query can be
7470
7472
                                     tab->table->file->records());
7471
7473
        else
7472
7474
        {
7473
 
          Position cur_pos= join->getPosFromOptimalPlan(i);
 
7475
          optimizer::Position cur_pos= join->getPosFromOptimalPlan(i);
7474
7476
          examined_rows= cur_pos.getFanout();
7475
7477
        }
7476
7478
 
7483
7485
          float f= 0.0;
7484
7486
          if (examined_rows)
7485
7487
          {
7486
 
            Position cur_pos= join->getPosFromOptimalPlan(i);
 
7488
            optimizer::Position cur_pos= join->getPosFromOptimalPlan(i);
7487
7489
            f= (float) (100.0 * cur_pos.getFanout() /
7488
7490
                        examined_rows);
7489
7491
          }