Welcome to mirror list, hosted at ThFree Co, Russian Federation.

postgres_index_bloat_estimate.rb « database « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c9b5777b74ac74bcbf7abb81e40ebad328f31ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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.
    class PostgresIndexBloatEstimate < SharedModel
      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