Commit 9ac093e2 authored by Andreas Brandl's avatar Andreas Brandl
Browse files

Add feature flag for tablesample counting.

parent 6df99924ac6c
......@@ -172,6 +172,10 @@ def count
{}
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 @@
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