snipe-it
snipe-it copied to clipboard
Long loading time on "Checkout License Seat" due to thousands of queries
Expected Behavior (or desired behavior if a feature request)
Loading the "Checkout License Seat" page in appropriate time like all others.
Actual Behavior
Loading the "Checkout License Seat" page runs into long loading times and/or timeouts due to the execution of 5643 Queries independent from amount of seats in license (currently chosen).
Mostly executing this two queries over and over with different user or model id's:
select * from users where users.id is null limit 1
select * from models where models.id = '13' limit 1
As it seems to prepare the drop down list to assign the seat to an asset or user the system loads them all and executing every time a single query.
Summary of Items 2.814 Assets 1.303 Licenses 49 Accessories 14 Consumables 514 Users
Please confirm you have done the following before posting your bug report:
- [X] I have enabled debug mode
- [X] I have read checked the Common Issues page
Please provide answers to these questions before posting your bug report:
- Version of Snipe-IT you're running -> v3.3.0-3-g7ef4f23
- What OS and web server you're running Snipe-IT on -> Ubuntu 14.04
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) -> Install via install.sh as far as I remember
- If you're getting an error in your browser, include that error -> No error
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error -> As mentioned above, the "checkout license seat" page
- If a stacktrace is provided in the error, include that too. -> No error
- Any errors that appear in your browser's error console. -> No Error
- Confirm whether the error is reproduceable on the demo. -> Not reproducable but in the Demo there is 226 Queries for 10 license entries (18 seats in sum) compared to 311 license entries (1303 seats in sum). Also as the issue is most likely related to the Asset and Checkout to list loading, in the Demo there are only 3 Assets and 28 Users
- Include any additional information you can find in
app/storage/logsand your webserver's logs. -> No specific data except usual access log data - Include what you've done so far in the installation, and if you got any error messages along the way. -> No error
- Indicate whether or not you've manually edited any data directly in the database -> Not at all