Commit 32666427 authored by Andreas Brandl's avatar Andreas Brandl

Add feature flag for tablesample counting.

parent 3a7d9b4b
......@@ -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.
......
......@@ -163,6 +163,10 @@ describe Gitlab::Database::Count do
end
describe '.enabled?' do
before do
stub_feature_flags(tablesample_counts: true)
end
it 'is enabled for PostgreSQL' do
allow(Gitlab::Database).to receive(:postgresql?).and_return(true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment