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

Server pagination #1373

Merged
merged 11 commits into from Mar 1, 2021
Merged

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Feb 28, 2021

Adds server-side pagination for (some) data tables which significantly speeds up the UI - especially when there are a large number of records.

Fixes #310

The query is limited on the database side.

For a dataset of ~1000 records, this reduces query time from 6,000ms to ~100ms.

  • Check that the "limit" functionality still works for the home page
  • Unit testing for the stock list API
  • Unit testing for the part list API
  • Refactor duplicated "queryParams" function for inventreeTable

@SchrodingersGat SchrodingersGat merged commit 7aed696 into inventree:master Mar 1, 2021
@SchrodingersGat SchrodingersGat deleted the server-pagination branch March 1, 2021 02:31
@eeintech
Copy link
Contributor

eeintech commented Mar 1, 2021

@SchrodingersGat Wow very impressive! Nice work!

Seems like large BOM loading is still slow, any idea why?

@SchrodingersGat
Copy link
Member Author

@eeintech how long does it take to load the BOM table, and how many rows are in the BOM table?

@eeintech
Copy link
Contributor

eeintech commented Mar 1, 2021

@SchrodingersGat There are 67 items in the BOM and it can take close to 20 seconds

@SchrodingersGat
Copy link
Member Author

That's pretty slow indeed. With only 67 items I'd say there is something more serious going on that needs to be looked at.

For reference, before I added server-side pagination for the "parts" list, loading all parts on my test database (~1000) took around 6 seconds.

@eeintech
Copy link
Contributor

eeintech commented Mar 1, 2021

You're right, we have 200+ parts in our database and the part list is loading almost instantaneously. I'll have to investigate why our BOM doesn't follow the same logic...

@SchrodingersGat
Copy link
Member Author

SchrodingersGat commented Mar 1, 2021

Using the django debug toolbar, I was actually able to replicate this. The issue is not the data loading into the table

The server request to generate the page takes about 18s

image

But the subsequent database request is reasonably fast:

image

@SchrodingersGat
Copy link
Member Author

On further inspection it appears that any of the part detail views are very slow (~15 seconds just to load the "part detail" page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server-size pagination for tables
2 participants