Class: RailsRedshiftReplicator::Tools::Analyze
- Inherits:
-
Object
- Object
- RailsRedshiftReplicator::Tools::Analyze
- Defined in:
- lib/rails_redshift_replicator/tools/analyze.rb
Instance Method Summary collapse
-
#initialize(table = nil) ⇒ Analyze
constructor
Updates the query plan to improve performance.
- #perform ⇒ Object
Constructor Details
#initialize(table = nil) ⇒ Analyze
Updates the query plan to improve performance. see [docs.aws.amazon.com/redshift/latest/dg/r_ANALYZE.html]
7 8 9 |
# File 'lib/rails_redshift_replicator/tools/analyze.rb', line 7 def initialize(table = nil) @table = (table.blank? || table.to_s == "all") ? nil : table end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 |
# File 'lib/rails_redshift_replicator/tools/analyze.rb', line 11 def perform command = "ANALYZE #{@table};".squish RailsRedshiftReplicator.logger.debug(command) RailsRedshiftReplicator.connection.exec command end |