~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/cost_vector.h

  • Committer: Olaf van der Spek
  • Date: 2011-10-24 21:23:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2449.
  • Revision ID: olafvdspek@gmail.com-20111024212354-j32gbc2sbsw0985q
Use str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_OPTIMIZER_COST_VECTOR_H
21
 
#define DRIZZLED_OPTIMIZER_COST_VECTOR_H
22
 
 
23
 
namespace drizzled
24
 
{
25
 
namespace optimizer
26
 
{
27
 
class CostVector
28
 
{
29
 
 
 
20
#pragma once
 
21
 
 
22
namespace drizzled {
 
23
namespace optimizer {
 
24
 
 
25
class CostVector 
 
26
{
30
27
public:
31
28
  CostVector() :
32
29
    io_count(0.0),
36
33
    import_cost(0.0)
37
34
  {}
38
35
 
39
 
  double total_cost()
 
36
  double total_cost() const
40
37
  {
41
38
    return IO_COEFF*io_count*avg_io_cost + CPU_COEFF * cpu_cost +
42
39
      MEM_COEFF*mem_cost + IMPORT_COEFF*import_cost;
130
127
} /* namespace optimizer */
131
128
} /* namespace drizzled */
132
129
 
133
 
#endif /* DRIZZLED_OPTIMIZER_COST_VECTOR_H */