~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Brian Aker
  • Date: 2010-03-22 05:47:41 UTC
  • mfrom: (1336.3.3 ded_drizzle)
  • Revision ID: brian@gaz-20100322054741-mc6q8437zdddff9z
Merge DED

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "drizzled/gettext.h"
33
33
#include "drizzled/probes.h"
34
34
#include "drizzled/sql_parse.h"
35
 
#include "drizzled/cost_vect.h"
 
35
#include "drizzled/optimizer/cost_vector.h"
36
36
#include "drizzled/session.h"
37
37
#include "drizzled/sql_base.h"
38
38
#include "drizzled/transaction_services.h"
962
962
Cursor::multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
963
963
                                     void *seq_init_param,
964
964
                                     uint32_t ,
965
 
                                     uint32_t *bufsz, uint32_t *flags, COST_VECT *cost)
 
965
                                     uint32_t *bufsz, uint32_t *flags, optimizer::CostVector *cost)
966
966
{
967
967
  KEY_MULTI_RANGE range;
968
968
  range_seq_t seq_it;
1005
1005
    /* The following calculation is the same as in multi_range_read_info(): */
1006
1006
    *flags |= HA_MRR_USE_DEFAULT_IMPL;
1007
1007
    cost->zero();
1008
 
    cost->avg_io_cost= 1; /* assume random seeks */
 
1008
    cost->setAvgIOCost(1); /* assume random seeks */
1009
1009
    if ((*flags & HA_MRR_INDEX_ONLY) && total_rows > 2)
1010
 
      cost->io_count= index_only_read_time(keyno, (uint32_t)total_rows);
 
1010
      cost->setIOCount(index_only_read_time(keyno, (uint32_t)total_rows));
1011
1011
    else
1012
 
      cost->io_count= read_time(keyno, n_ranges, total_rows);
1013
 
    cost->cpu_cost= (double) total_rows / TIME_FOR_COMPARE + 0.01;
 
1012
      cost->setIOCount(read_time(keyno, n_ranges, total_rows));
 
1013
    cost->setCpuCost((double) total_rows / TIME_FOR_COMPARE + 0.01);
1014
1014
  }
1015
1015
  return total_rows;
1016
1016
}
1051
1051
*/
1052
1052
 
1053
1053
int Cursor::multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t n_rows,
1054
 
                                   uint32_t *bufsz, uint32_t *flags, COST_VECT *cost)
 
1054
                                   uint32_t *bufsz, uint32_t *flags, optimizer::CostVector *cost)
1055
1055
{
1056
1056
  *bufsz= 0; /* Default implementation doesn't need a buffer */
1057
1057
 
1058
1058
  *flags |= HA_MRR_USE_DEFAULT_IMPL;
1059
1059
 
1060
1060
  cost->zero();
1061
 
  cost->avg_io_cost= 1; /* assume random seeks */
 
1061
  cost->setAvgIOCost(1); /* assume random seeks */
1062
1062
 
1063
1063
  /* Produce the same cost as non-MRR code does */
1064
1064
  if (*flags & HA_MRR_INDEX_ONLY)
1065
 
    cost->io_count= index_only_read_time(keyno, n_rows);
 
1065
    cost->setIOCount(index_only_read_time(keyno, n_rows));
1066
1066
  else
1067
 
    cost->io_count= read_time(keyno, n_ranges, n_rows);
 
1067
    cost->setIOCount(read_time(keyno, n_ranges, n_rows));
1068
1068
  return 0;
1069
1069
}
1070
1070