Class: MatViews::Services::ConcurrentRefresh
- Inherits:
-
BaseService
- Object
- BaseService
- MatViews::Services::ConcurrentRefresh
- Defined in:
- lib/mat_views/services/concurrent_refresh.rb
Overview
Refresh service that runs:
`REFRESH MATERIALIZED VIEW CONCURRENTLY <schema>.<rel>`
It keeps the view readable during refresh, but **requires at least one UNIQUE index** on the materialised view (a PostgreSQL constraint).
Options:
-
row_count_strategy:(Symbol, default: :none) → one of:estimated,:exact, or ‘:none or nil` to control row count reporting
Returns a MatViews::ServiceResponse
Constant Summary
Constants inherited from BaseService
BaseService::ALLOWED_ROW_STRATEGIES, BaseService::DEFAULT_NIL_STRATEGY, BaseService::DEFAULT_ROW_STRATEGY, BaseService::UNKNOWN_ROW_COUNT
Instance Attribute Summary
Attributes inherited from BaseService
#definition, #request, #response, #row_count_strategy, #use_transaction
Instance Method Summary collapse
-
#initialize(definition, row_count_strategy: :estimated) ⇒ ConcurrentRefresh
constructor
A new instance of ConcurrentRefresh.
Methods inherited from BaseService
Constructor Details
#initialize(definition, row_count_strategy: :estimated) ⇒ ConcurrentRefresh
Returns a new instance of ConcurrentRefresh.
36 37 38 39 |
# File 'lib/mat_views/services/concurrent_refresh.rb', line 36 def initialize(definition, row_count_strategy: :estimated) super @use_transaction = false end |