-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use subqueries in Flop.count for queries with group_by #336
Conversation
Nice, thanks, we just need some tests 👍 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #336 +/- ##
==========================================
+ Coverage 88.29% 88.38% +0.09%
==========================================
Files 13 13
Lines 880 887 +7
==========================================
+ Hits 777 784 +7
Misses 103 103
☔ View full report in Codecov by Sentry. |
This seems to translate to: SELECT count(*) FROM (SELECT TRUE FROM ...
718c8d4
to
75d95ba
Compare
75d95ba
to
a9d088a
Compare
Looks like we don't need to wrap queries with
Maybe this was different in the past and that's why Scrivener had a special case for this. I'll remove this part. |
Ecto will wrap the query in a subquery in Repo.aggregate
a9d088a
to
c940f8a
Compare
Thank you! |
See also related discussion