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

[Bug]: $this->paginationTotalItemCount included on all pagination types. Too heavy for "simple" #1687

Open
booni3 opened this issue Mar 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@booni3
Copy link

booni3 commented Mar 13, 2024

What happened?

I have just upgraded to v3.

I have some tables with nearly 1M rows and some relationships. These worked fine in V2 using simple pagination.

V3 has introduced the code:

if ($this->isPaginationMethod('simple')) {

    $this->paginationTotalItemCount = $this->getBuilder()->count();

    return $this->getBuilder()->simplePaginate($this->getPerPage() === -1 ? $this->paginationTotalItemCount : $this->getPerPage(), ['*'], $this->getComputedPageName());

}

The getBuilder()->count() method is very heavy on big tables. On V2 I did not have the required indexes and tables would load in milliseconds. Without indexes on V3 my tables are timing out with > 30s load time.

After adding some additional indexes, I have gotten load times down between 500ms and 10s... but it is still a big performance from from V2 in this regard.

Do we need to be getting $this->paginationTotalItemCount = $this->getBuilder()->count(); for simple pagination? I thought the whole idea of simple was to make things more performant?

How to reproduce the bug

No response

Package Version

3

PHP Version

8.2.x

Laravel Version

10.34

Alpine Version

No response

Theme

None

Notes

No response

Error Message

No response

@booni3 booni3 added the bug Something isn't working label Mar 13, 2024
@lrljoe
Copy link
Sponsor Collaborator

lrljoe commented Mar 16, 2024 via email

Copy link

stale bot commented Apr 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 17, 2024
@booni3
Copy link
Author

booni3 commented Apr 17, 2024

Still interested in this.

@stale stale bot removed the wontfix This will not be worked on label Apr 17, 2024
Copy link

stale bot commented May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 18, 2024
@stale stale bot closed this as completed May 26, 2024
@lrljoe lrljoe removed the wontfix This will not be worked on label Jun 3, 2024
@lrljoe lrljoe reopened this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants