Skip to content

Performance with 2,000,000 rows #51

@jungleman12

Description

@jungleman12

Hello Kevin,

I tried this package for pagination, but I'm encountering few problems.

The problem I'm having here is a performance issue: I have 2,000,000 rows in my table, and the problem I'm encountering is that there's a COUNT() query that's taking a long time to execute. Is there a way around this?

Here's the code used:

        $qb = $this->createQueryBuilder('v');

        $qb
            ->orderBy('v.visitedAt', 'DESC')
        ;

        return (new EntityResult($qb))->paginate($page, self::PAGINATOR_PER_PAGE);

I would like to point out that in my template I use this if it can help:
paginator.nextPage
paginator|length

Thanks.

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