Class: NoSE::Cost::EntityCountCost
- Includes:
- Subtype
- Defined in:
- lib/nose/cost/entity_count.rb
Overview
A cost model which estimates the number of entities transferred
Instance Method Summary collapse
-
#delete_cost(step) ⇒ Object
Cost estimate as number of entities deleted.
-
#index_lookup_cost(step) ⇒ Numeric
Rough cost estimate as the number of entities retrieved at each step.
-
#insert_cost(step) ⇒ Object
Cost estimate as number of entities inserted.
Methods included from Subtype
Methods inherited from Cost
#filter_cost, #initialize, #limit_cost, #pruned_cost, #sort_cost
Methods included from Supertype
Methods included from Listing
Constructor Details
This class inherits a constructor from NoSE::Cost::Cost
Instance Method Details
#delete_cost(step) ⇒ Object
Cost estimate as number of entities deleted
17 18 19 |
# File 'lib/nose/cost/entity_count.rb', line 17 def delete_cost(step) step.state.cardinality end |
#index_lookup_cost(step) ⇒ Numeric
Rough cost estimate as the number of entities retrieved at each step
11 12 13 14 |
# File 'lib/nose/cost/entity_count.rb', line 11 def index_lookup_cost(step) # Simply count the number of entities at each step step.state.cardinality end |
#insert_cost(step) ⇒ Object
Cost estimate as number of entities inserted
22 23 24 |
# File 'lib/nose/cost/entity_count.rb', line 22 def insert_cost(step) step.state.cardinality end |