Class: Shiba::TableStats
- Inherits:
-
Object
- Object
- Shiba::TableStats
- Defined in:
- lib/shiba/table_stats.rb
Instance Method Summary collapse
- #estimate_key(table_name, key, parts) ⇒ Object
- #fuzzed?(table) ⇒ Boolean
- #get_column_size(table_name, column) ⇒ Object
-
#initialize(dump_stats, connection, manual_stats) ⇒ TableStats
constructor
A new instance of TableStats.
- #table_count(table) ⇒ Object
Constructor Details
#initialize(dump_stats, connection, manual_stats) ⇒ TableStats
Returns a new instance of TableStats.
6 7 8 9 10 |
# File 'lib/shiba/table_stats.rb', line 6 def initialize(dump_stats, connection, manual_stats) @dump_stats = Shiba::IndexStats.new(dump_stats) @db_stats = Shiba::Fuzzer.new(connection).fuzz! @manual_stats = Shiba::IndexStats.new(manual_stats) end |
Instance Method Details
#estimate_key(table_name, key, parts) ⇒ Object
13 14 15 |
# File 'lib/shiba/table_stats.rb', line 13 def estimate_key(table_name, key, parts) ask_each(:estimate_key, table_name, key, parts) end |
#fuzzed?(table) ⇒ Boolean
25 26 27 |
# File 'lib/shiba/table_stats.rb', line 25 def fuzzed?(table) !@dump_stats.tables[table] && !@manual_stats.tables[table] && @db_stats.tables[table] end |
#get_column_size(table_name, column) ⇒ Object
21 22 23 |
# File 'lib/shiba/table_stats.rb', line 21 def get_column_size(table_name, column) ask_each(:get_column_size, table_name, column) end |
#table_count(table) ⇒ Object
17 18 19 |
# File 'lib/shiba/table_stats.rb', line 17 def table_count(table) ask_each(:table_count, table) end |