Skip to content
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

Grouped query performance of total_count using Arel #1022

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Oct 29, 2020

  1. Fix 'STI total_count with GROUP BY clause' test

    This test's data was built using a hash keyed by a name which was
    included twice, so it would always pass as long as total_count builds a
    valid query. Fixed by using a 2D array instead.
    bendilley committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    2c9339a View commit details
    Browse the repository at this point in the history
  2. Grouped query performance of total_count using Arel

    Improved performance for total_count on grouped ActiveRecord::Relation.
    
    This re-implements kaminari#979 using Arel to avoid issues kaminari#1012 and kaminari#1015
    bendilley committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    5a582e9 View commit details
    Browse the repository at this point in the history
  3. Implementing review suggestions

    Using `Arel.star` so it does not depend on an alias set in the subquery,
    as suggested by @guigs on kaminari#1022.
    bendilley committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    121fa7e View commit details
    Browse the repository at this point in the history
  4. Attempt to accommodate total_count(column_name)

    Only count non-null values of column_name if supplied. This meets the
    semantics of the SQL count function without requiring that column_name
    is one of the grouped columns.
    bendilley committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    221c68f View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2020

  1. Fall back to SQL solution if ActiveRecord < 5

    Arel::SelectManager.new without args is unsupported in ActiveRecord < 5.
    bendilley committed Nov 3, 2020
    Configuration menu
    Copy the full SHA
    f6d4b56 View commit details
    Browse the repository at this point in the history