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

Fix pagination issue #9176

Open
wants to merge 2 commits into
base: 2.4
Choose a base branch
from
Open

Fix pagination issue #9176

wants to merge 2 commits into from

Conversation

Benni0
Copy link
Contributor

@Benni0 Benni0 commented Jul 6, 2023

What does it do?

Fixes Issue: #9175
Bug: When attributes are fetched using pagination pages can be empty or not full when items are skipped

Questions

  • Does it require a DB change?
  • Are you using it in production?
  • Does it require a change in the API (PyMISP for example)?

Note

This fix should be considered as an example because of the fact that this implementation has an impact on performance. The main impact is, that all previous pages must be fetched in any case, otherwise the exact beginning of a page could not be determined.

A better solution would be, to do the filtering on SQL-level but this wouldn't be a quick fix.

Maybe we should also consider to avoid the n+1 select (indirect recursive call) when decay-score is included:

  1. attachScoresToAttribute
  2. getScore
  3. fetchAttributes

To avoid this it could be possible to add the most recent sighting date to the attribute like the last seen date.

@adulau
Copy link
Member

adulau commented Apr 23, 2024

Could you update the PR as proposed by @iglocska in #9175 (comment) that would be awesome.

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.

None yet

2 participants