-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Unnecessary queries to DB backend? #14010
Comments
Query for twofactor is part of the user session. Maybe we could cache the result. @ChristophWurst Another question regarding your setup. By default long_query_time is 10 seconds. It looks wrong to me that a simple query like |
I added I did a quick test and browsed into a folder containing ~350 images. It resulted in 1495 Queries being logged:
btw... There are 751 queries containing
And those queries are always the same:
|
There is an index on Have you tried? https://github.com/major/MySQLTuner-perl It's very unusual that simple queries (e.g. selects without join/where/having/...) are logged to slow query log. |
If I remove What I'm saying is, that I don't understand why all those queries are fired upon loading a preview image... MySQLTuner was the reason I looked at unindexed queries, because it suggested the following: |
The full table is read here, using index is not useful here. about the two-factor providers, I saw on on instance the index being used, and on another (bigger) one it not being used. This is the database's query plan to use the index or not. I'd trust it does the right thing.
Here the query against oc_talk_participants does not use any index (fyi: put an EXPLAIN in front of SELECT in the database console to get information about the query). |
Any updates? |
Is there no way to load less (or only the required) apps for process a preview image? |
Yes, see #20865 Closing this issue as the talk query was fixed in the meantime |
While trying to optimize performance for the MariaDB back-end for NC15 I stumbled upon lot's of queries in the log that did not make sense. I was only browsing picture folders but found lot's of queries for Talk and Two Factor. Queries poped up every time the browser loaded a new preview image.
Steps to reproduce
tail -f /var/log/mysql/slow.log|egrep "oc_talk_rooms|oc_twofactor_providers"
while browsing a folder containing pictures in NC, only to find lot's of queries like this:Expected behaviour
I don't see why all those queries are necessary upon loading a new preview picture...
Actual behaviour
Cut the queries to a minimum to take load off the SQL DB.
Server configuration
Operating system: Ubuntu 18.04
Web server: Apache 2.4.29
Database: MariaDB 10.3
PHP version: 7.2.10
Nextcloud version: 15.0.2.0
Updated from an older Nextcloud/ownCloud or fresh install: Upgrade from OC 9
Where did you install Nextcloud from: Updater
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: local
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: FF 64.0
Operating system: Win7 64
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: