Seed tablesample strategy
This produces stable approximate counts among invocations unless the table changed. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58791.
This commit is contained in:
parent
27644f63fb
commit
ded299c05b
1 changed files with 1 additions and 0 deletions
|
@ -61,6 +61,7 @@ module Gitlab
|
|||
SELECT (COUNT(*)*#{inverse})::integer AS count
|
||||
FROM #{model.table_name}
|
||||
TABLESAMPLE SYSTEM (#{portion * 100})
|
||||
REPEATABLE (0)
|
||||
#{where_clause(model)}
|
||||
SQL
|
||||
|
||||
|
|
Loading…
Reference in a new issue