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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-10-28 21:48:26 +0300
committerAndreas Brandl <abrandl@gitlab.com>2018-12-03 23:26:51 +0300
commit3266642739b58d8f54733bfcd399b523d963c2aa (patch)
treecfee8701290ae1dd460b2c418107255a50f70ff5 /lib/gitlab/database
parent3a7d9b4b02934c259fa2eda46143fa67320c2f5f (diff)
Add feature flag for tablesample counting.
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r--lib/gitlab/database/count.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/database/count.rb b/lib/gitlab/database/count.rb
index 01fabcced65..8af462da4a6 100644
--- a/lib/gitlab/database/count.rb
+++ b/lib/gitlab/database/count.rb
@@ -172,6 +172,10 @@ module Gitlab
{}
end
+ def self.enabled?
+ Gitlab::Database.postgresql? && Feature.enabled?(:tablesample_counts)
+ end
+
private
def perform_count(model, estimate)
# If we estimate 0, we may not have statistics at all. Don't use them.