2020-12-10 07:09:43 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Database
|
|
|
|
# Use this model with care: Retrieving bloat statistics
|
|
|
|
# for all indexes can be expensive in a large database.
|
|
|
|
#
|
|
|
|
# Best used on a per-index basis.
|
2021-10-28 17:10:02 -04:00
|
|
|
class PostgresIndexBloatEstimate < SharedModel
|
2020-12-10 07:09:43 -05:00
|
|
|
self.table_name = 'postgres_index_bloat_estimates'
|
|
|
|
self.primary_key = 'identifier'
|
|
|
|
|
|
|
|
belongs_to :index, foreign_key: :identifier, class_name: 'Gitlab::Database::PostgresIndex'
|
|
|
|
|
|
|
|
alias_attribute :bloat_size, :bloat_size_bytes
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|