Skip to content

We still aren't able to prevent catch-all COUNT queries for index pages #2638

@seanlinsley

Description

@seanlinsley

As @Fivell pointed out, even after #2333 we're still hitting the database to get a count of all records, which is expensive if you have millions of records. This time around, it's an issue with Kaminari itself.

Specifically, we call paginate which ends up calling total_pages.

This has apparently been a long-standing issue with Kaminari, and some people have suggested fixes, but no one has yet submitted an actual pull request.

Another reference: http://engineering.nulogy.com/posts/avoiding-redundant-counting/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions