~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/range.cc

  • Committer: Djellel E. Difallah
  • Date: 2010-03-19 11:42:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1377.
  • Revision ID: ded@ubuntu-20100319114212-s5wfvi5dcmpnrwu3
rename class COST_VECT to CostVector and move it to ./drizzled/optimizer directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
#include "drizzled/sql_base.h"
120
120
#include "drizzled/sql_select.h"
121
121
#include "drizzled/error.h"
122
 
#include "drizzled/cost_vect.h"
 
122
#include "drizzled/optimizer/cost_vector.h"
123
123
#include "drizzled/item/cmpfunc.h"
124
124
#include "drizzled/field/num.h"
125
125
#include "drizzled/check_stack_overrun.h"
206
206
static void get_sweep_read_cost(Table *table,
207
207
                                ha_rows nrows,
208
208
                                bool interrupted,
209
 
                                optimizer::COST_VECT *cost)
 
209
                                optimizer::CostVector *cost)
210
210
{
211
211
  cost->zero();
212
212
  if (table->cursor->primary_key_is_clustered())
213
213
  {
214
 
    cost->setio_count(table->cursor->read_time(table->s->primary_key,
 
214
    cost->setIOCount(table->cursor->read_time(table->s->primary_key,
215
215
                                             static_cast<uint32_t>(nrows),
216
216
                                             nrows));
217
217
  }
224
224
    if (busy_blocks < 1.0)
225
225
      busy_blocks= 1.0;
226
226
 
227
 
    cost->setio_count(busy_blocks);
 
227
    cost->setIOCount(busy_blocks);
228
228
 
229
229
    if (! interrupted)
230
230
    {
231
231
      /* Assume reading is done in one 'sweep' */
232
 
      cost->setavg_io_cost((DISK_SEEK_BASE_COST +
 
232
      cost->setAvgIOCost((DISK_SEEK_BASE_COST +
233
233
                          DISK_SEEK_PROP_COST*n_blocks/busy_blocks));
234
234
    }
235
235
  }
312
312
                                  bool update_tbl_stats,
313
313
                                  uint32_t *mrr_flags,
314
314
                                  uint32_t *bufsize,
315
 
                                  optimizer::COST_VECT *cost);
 
315
                                  optimizer::CostVector *cost);
316
316
 
317
317
static optimizer::RangeReadPlan *get_key_scans_params(optimizer::Parameter *param,
318
318
                                                      SEL_TREE *tree,
1298
1298
 
1299
1299
  /* Calculate cost(rowid_to_row_scan) */
1300
1300
  {
1301
 
    optimizer::COST_VECT sweep_cost;
 
1301
    optimizer::CostVector sweep_cost;
1302
1302
    JOIN *join= param->session->lex->select_lex.join;
1303
1303
    bool is_interrupted= test(join && join->tables == 1);
1304
1304
    get_sweep_read_cost(param->table, non_cpk_scan_records, is_interrupted,
1416
1416
  */
1417
1417
  double roru_total_cost;
1418
1418
  {
1419
 
    optimizer::COST_VECT sweep_cost;
 
1419
    optimizer::CostVector sweep_cost;
1420
1420
    JOIN *join= param->session->lex->select_lex.join;
1421
1421
    bool is_interrupted= test(join && join->tables == 1);
1422
1422
    get_sweep_read_cost(param->table, roru_total_records, is_interrupted,
1883
1883
  info->total_cost= info->index_scan_costs;
1884
1884
  if (!info->is_covering)
1885
1885
  {
1886
 
    optimizer::COST_VECT sweep_cost;
 
1886
    optimizer::CostVector sweep_cost;
1887
1887
    JOIN *join= info->param->session->lex->select_lex.join;
1888
1888
    bool is_interrupted= test(join && join->tables == 1);
1889
1889
    get_sweep_read_cost(info->param->table, double2rows(info->out_rows),
2305
2305
    if (*key)
2306
2306
    {
2307
2307
      ha_rows found_records;
2308
 
      optimizer::COST_VECT cost;
 
2308
      optimizer::CostVector cost;
2309
2309
      double found_read_time= 0.0;
2310
2310
      uint32_t mrr_flags, buf_size;
2311
2311
      uint32_t keynr= param->real_keynr[idx];
4611
4611
                           bool update_tbl_stats,
4612
4612
                           uint32_t *mrr_flags,
4613
4613
                           uint32_t *bufsize,
4614
 
                           optimizer::COST_VECT *cost)
 
4614
                           optimizer::CostVector *cost)
4615
4615
{
4616
4616
  SEL_ARG_RANGE_SEQ seq;
4617
4617
  RANGE_SEQ_IF seq_if = {sel_arg_range_seq_init, sel_arg_range_seq_next};
5037
5037
  optimizer::QuickRange *range= NULL;
5038
5038
  uint32_t part;
5039
5039
  bool create_err= false;
5040
 
  optimizer::COST_VECT cost;
 
5040
  optimizer::CostVector cost;
5041
5041
 
5042
5042
  old_root= session->mem_root;
5043
5043
  /* The following call may change session->mem_root */
5704
5704
                                           param,
5705
5705
                                           &cur_param_idx);
5706
5706
      /* Check if this range tree can be used for prefix retrieval. */
5707
 
      optimizer::COST_VECT dummy_cost;
 
5707
      optimizer::CostVector dummy_cost;
5708
5708
      uint32_t mrr_flags= HA_MRR_USE_DEFAULT_IMPL;
5709
5709
      uint32_t mrr_bufsize= 0;
5710
5710
      cur_quick_prefix_records= check_quick_select(param,