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

slow SQL queries "INSERT INTO option ... ON DUPLICATE KEY UPDATE" in some rare cases #12400

Closed
mattab opened this issue Jan 3, 2018 · 0 comments
Labels
c: Performance For when we could improve the performance / speed of Matomo. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@mattab
Copy link
Member

mattab commented Jan 3, 2018

Creating this issue to document a rare occurence of slow yet often-executed queries, so far experience on the option table only. Our option table usually contains a couple thousands records at most and is therefore very small. Queries on the table take only a few milliseconds. But in some cases they take like 1 min to run, and we couldn't explain it.

Example 1: this query was running for 50 seconds+:

INSERT INTO `option` (option_name, option_value, autoload) VALUES ('version_xyz', '3.0.2', '1') ON DUPLICATE KEY UPDATE option_value = '3.0.2'

Example 2: this other query was running for many seconds as well:

INSERT INTO `option` (option_name, option_value, autoload) VALUES ('LastFullArchivingStartTime', '1514894465', '0') ON DUPLICATE KEY UPDATE option_value = '1514894465'

If anyone has any idea why these queries could be so slow, please leave a comment!

@mattab mattab added the c: Performance For when we could improve the performance / speed of Matomo. label Jan 3, 2018
robocoder added a commit to robocoder/matomo that referenced this issue Feb 12, 2018
robocoder added a commit to robocoder/matomo that referenced this issue Feb 12, 2018
robocoder added a commit to robocoder/matomo that referenced this issue Feb 12, 2018
robocoder added a commit to robocoder/matomo that referenced this issue Mar 24, 2018
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label May 8, 2018
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this issue Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

1 participant