This class represents the cost of evaluating an Item.
More...
#include <item.h>
|
static constexpr double | kStrFieldCost = 1.8 |
| The cost of accessing a Field_str, relative to other Field types. More...
|
|
static constexpr double | kOtherFieldCost = 1.0 |
| The cost of accessing a Field other than Field_str. 1.0 by definition. More...
|
|
This class represents the cost of evaluating an Item.
- See also
- SortPredicates to see how this is used.
◆ AddFieldCost()
void CostOfItem::AddFieldCost |
( |
| ) |
|
|
inline |
Add the cost of accessing any other Field.
◆ AddStrFieldCost()
void CostOfItem::AddStrFieldCost |
( |
| ) |
|
|
inline |
Add the cost of accessing a Field_str.
◆ Compute()
void CostOfItem::Compute |
( |
const Item & |
item | ) |
|
|
inline |
Set '*this' to represent the cost of 'item'.
◆ ComputeInternal()
void CostOfItem::ComputeInternal |
( |
const Item & |
root | ) |
|
|
private |
Compute the cost of 'root' and its descendants.
◆ FieldCost()
double CostOfItem::FieldCost |
( |
| ) |
const |
|
inline |
Get the cost of field access when evaluating the Item associated with this object.
The cost unit is arbitrary, but the relative cost of different items reflect the fact that operating on Field_str is more expensive than other Field subclasses.
◆ IsExpensive()
bool CostOfItem::IsExpensive |
( |
| ) |
const |
|
inline |
◆ MarkExpensive()
void CostOfItem::MarkExpensive |
( |
| ) |
|
|
inline |
◆ kOtherFieldCost
constexpr double CostOfItem::kOtherFieldCost = 1.0 |
|
staticconstexprprivate |
The cost of accessing a Field other than Field_str. 1.0 by definition.
◆ kStrFieldCost
constexpr double CostOfItem::kStrFieldCost = 1.8 |
|
staticconstexprprivate |
The cost of accessing a Field_str, relative to other Field types.
(The value was determined using benchmarks.)
◆ m_computed
bool CostOfItem::m_computed {false} |
|
private |
True if 'ComputeInternal()' has been called.
◆ m_is_expensive
bool CostOfItem::m_is_expensive {false} |
|
private |
True if the associated Item calls user defined functions or stored procedures.
◆ m_other_fields
uint8 CostOfItem::m_other_fields {0} |
|
private |
The number of other Field objects accessed by the associated Item.
◆ m_str_fields
uint8 CostOfItem::m_str_fields {0} |
|
private |
The number of Field_str objects accessed by the associated Item.
The documentation for this class was generated from the following files: