Add limits to software profile 2077
Fixes #2077
Description
Please include a summary of the change, relevant motivation and context. If possible and applicable, include before and after screenshots and a URL where the changes can be seen.
I rewrote the low-performing queries, adding LIMITs, shortening trees and otherwise optimizing the execution time.
Caveats
Please list anything which has been left out of this PR or which should be considered before this PR is accepted Check any of the following which apply:
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] I have made corresponding changes to the documentation
- [ ] This change requires new dependencies (please list)
If you make changes to the Python code
- [ ] My code passes the tox check, I can receive warnings about tests, documentation or both
Screenshots
For software/Q1659584 :

Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas
- [X] My changes generate no new warnings
- [X] I have not used code from external sources without attribution
- [X] I have considered accessibility in my implementation
- [X] There are no remaining debug statements (print, console.log, ...)
There are currently tox errors that I do not understand https://github.com/WDscholia/scholia/runs/7681938562?check_suite_focus=true
I have fixed styling errors at https://github.com/WDscholia/scholia/issues/2079 but there are some other problems. Why?
I have now taken the liberty to generate a new PR with new commits at https://github.com/WDscholia/scholia/pull/2131
As far as I can tell the new PR, viewing http://127.0.0.1:8100/software/Q1659584, works ok, while not sampling, not using double LIMITs and not removing P279* where it is used.
Some of the suggestion have been done with https://github.com/WDscholia/scholia/pull/2131 that is now merge with master. I hope they are satisfying?