Class: AwesomeExplain::SqlPlanStats
- Inherits:
-
Object
- Object
- AwesomeExplain::SqlPlanStats
- Defined in:
- app/models/awesome_explain/sql_plan_stats.rb
Instance Attribute Summary collapse
-
#actual_total_time ⇒ Object
Returns the value of attribute actual_total_time.
-
#index_stats ⇒ Object
Returns the value of attribute index_stats.
-
#node_type_stats ⇒ Object
Returns the value of attribute node_type_stats.
-
#seq_scans ⇒ Object
Returns the value of attribute seq_scans.
-
#table_stats ⇒ Object
Returns the value of attribute table_stats.
-
#total_loops ⇒ Object
Returns the value of attribute total_loops.
-
#total_rows ⇒ Object
Returns the value of attribute total_rows.
-
#total_rows_planned ⇒ Object
Returns the value of attribute total_rows_planned.
Instance Method Summary collapse
- #indexes? ⇒ Boolean
-
#initialize ⇒ SqlPlanStats
constructor
A new instance of SqlPlanStats.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize ⇒ SqlPlanStats
Returns a new instance of SqlPlanStats.
11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 11 def initialize @table_stats = {} @node_type_stats = {} @index_stats = {} @total_rows_planned = 0 @total_rows = 0 @total_loops = 0 @actual_total_time = 0 @seq_scans = 0 end |
Instance Attribute Details
#actual_total_time ⇒ Object
Returns the value of attribute actual_total_time.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def actual_total_time @actual_total_time end |
#index_stats ⇒ Object
Returns the value of attribute index_stats.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def index_stats @index_stats end |
#node_type_stats ⇒ Object
Returns the value of attribute node_type_stats.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def node_type_stats @node_type_stats end |
#seq_scans ⇒ Object
Returns the value of attribute seq_scans.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def seq_scans @seq_scans end |
#table_stats ⇒ Object
Returns the value of attribute table_stats.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def table_stats @table_stats end |
#total_loops ⇒ Object
Returns the value of attribute total_loops.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def total_loops @total_loops end |
#total_rows ⇒ Object
Returns the value of attribute total_rows.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def total_rows @total_rows end |
#total_rows_planned ⇒ Object
Returns the value of attribute total_rows_planned.
2 3 4 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 2 def total_rows_planned @total_rows_planned end |
Instance Method Details
#indexes? ⇒ Boolean
22 23 24 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 22 def indexes? !@index_stats.empty? end |
#to_hash ⇒ Object Also known as: to_h
26 27 28 29 30 31 32 |
# File 'app/models/awesome_explain/sql_plan_stats.rb', line 26 def to_hash { table_stats: @table_stats, node_type_stats: @node_type_stats, index_stats: @index_stats, } end |