eclipse-basyx / basyx-java-server-sdk

MIT License
59 stars 47 forks source link

[BUG] pagination does not improve response time #532

Open mmaeffert opened 2 days ago

mmaeffert commented 2 days ago

Describe the bug When using the ?limit query parameter, it does not improve the response time compared to not setting a limit at all

To Reproduce Steps to reproduce the behavior:

  1. Create 300k twins
  2. use GET /submodels endpoint
  3. see that the response takes more than a minute
  4. use GET /submodels?limit=5 endpoint
  5. See that the response takes equally long

Expected behavior I would expect a faster response time nearly equivalent to the set limit / number of submodels ratio

BaSyx (please complete the following information):

Additional context I suspect that application still querries every submodel and just adds the first five to the response

zhangzai123 commented 1 day ago

Hi @mmaeffert , thank you for your report. What kind of persistence / backend do you use? InMemory or MongoDb?

mmaeffert commented 1 day ago

I am using MongoDB. FYI: I hosted it locally on my laptop, I suppose hosting it remotely would increase the response time even further.

zhangzai123 commented 1 day ago

Thank you for your fast response. We are aware of the pagination issue with MongoDB backend. We are working on this with the PR eclipse-basyx/basyx-java-server-sdk#516 . The pagination response time will be improved after this PR is merged.

mmaeffert commented 1 day ago

This is great news, thank you. However, is there a way to disable the functionality to get every submodel alltogether? Imagine hosting this to a customer, you would not want him to keep using that endpoint

zhangzai123 commented 1 day ago

516