Closed miaoyc666 closed 4 months ago
Can you also include the changes in UI as well?
Can you also include the changes in UI as well?
Do you mean adding paging parameters in the fe as well? Of course, it's just that it takes time. 😂
Can you also include the changes in UI as well?
@ajinabraham ui done!
@miaoyc666 Do you have any suggestions for optimizing the database? I found that when the amount of data exceeds 30,000, data query will become extremely slow, even if the page display is still very slow
@miaoyc666 Do you have any suggestions for optimizing the database? I found that when the amount of data exceeds 30,000, data query will become extremely slow, even if the page display is still very slow
@ohyeah521
When you query a database, the first thing to control is the number of rows you query. You need to add offset and limit parameters to your SQL statement for pagination queries, limiting the number of rows returned. Secondly, you need to select the fields that need to be displayed for select queries. Do not search for useless fields and cannot use select * because it will query all fields in a record, which will consume additional network bandwidth and CPU computing resources. You can take a look at the code I commited, perform pagination queries in django, and only query the fields displayed on the page in the recent list of samples.
@miaoyc666 thanks
@miaoyc666 Thanks for taking your time and working on the UI bits. I will review this soon and get back to you.
Initial testing looks good. I will see if I can improve up on the UI based on https://realpython.com/django-pagination/
Describe the Pull Request
When MobSF has a large amount of sample data in the system, the recent scans api speed has been very slow because it will retrieve full table data from the database.
To fix this, recent scans api add page jump, default display 10 items per page
Renderings
Checklist for PR
tox -e lint,test
StaticAnalyzer/tests.py
)Additional Comments (if any)