Disallow distinct count by large table foreign key
As discussed distinct counts by large foreign keys could be carefully considered.
There are several distinct_counts by project_id
etc - after I have raised similar issues to confine our distinct count to users, PMs explained that there are valid cases
- Users have
~6M
, and projects have13M
counts. - Yet for larger table foreign keys such as
pipeline_id
it might be a long running process, we don't have any counters
Solution Proposal
A rubocop rule could make sense here
Edited by Alper Akgun