Class: Gitlab::Database::QueryAnalyzers::Ci::PartitioningRoutingAnalyzer

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/database/query_analyzers/ci/partitioning_routing_analyzer.rb

Overview

The purpose of this analyzer is to detect queries not going through a partitioning routing table

Constant Summary collapse

RoutingTableNotUsedError =
Class.new(QueryAnalyzerError)
ENABLED_TABLES =
%w[
  ci_builds
  ci_builds_metadata
  ci_job_artifacts
  ci_pipeline_variables
  ci_pipelines
  ci_stages
].freeze

Constants inherited from Base

Base::QueryAnalyzerError

Class Method Summary collapse

Methods inherited from Base

analyzer_key, begin!, context, context_key, end!, requires_tracking?, skip_cached?, suppress=, suppress_key, suppress_schema_issues_for_decomposed_tables, suppressed?, with_suppressed

Class Method Details

.analyze(parsed) ⇒ Object



26
27
28
29
30
31
# File 'lib/gitlab/database/query_analyzers/ci/partitioning_routing_analyzer.rb', line 26

def analyze(parsed)
  # This analyzer requires the PgQuery parsed query to be present
  return unless parsed.pg

  analyze_legacy_tables_usage(parsed)
end

.enabled?Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/gitlab/database/query_analyzers/ci/partitioning_routing_analyzer.rb', line 21

def enabled?
  ::Feature::FlipperFeature.table_exists? &&
    ::Feature.enabled?(:ci_partitioning_analyze_queries, type: :ops)
end