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

[Bug]: Missing column in database index on query for time sensitive background jobs #46126

Open
4 of 8 tasks
ChristophWurst opened this issue Jun 26, 2024 · 1 comment
Open
4 of 8 tasks
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in. performance 🚀

Comments

@ChristophWurst
Copy link
Member

⚠️ This issue respects the following points: ⚠️

Bug description

The query 4f0fc707a2e82ec699067a969cd17b05

SELECT
  *
FROM
  `oc_jobs`
WHERE
  (`reserved_at` <= ?)
  AND (`last_checked` <= ?)
  AND (`time_sensitive` = ?)
ORDER BY
  `last_checked` ASC
LIMIT
  ?

does not use a covering index. The index job_lastcheck_reserved only covers last_checked and reserved_at, not time_sensitive. The database has to scan a bunch of rows every time cron picks the next job outside the maintenance window:

image

Steps to reproduce

  1. Install Nextcloud
  2. Configure a maintenance window

Expected behavior

An index on (last_checked, reserved_at, time_sensitive)

Installation method

None

Nextcloud Server version

29

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

cc @nickvergessen

@ChristophWurst ChristophWurst added bug 1. to develop Accepted and waiting to be taken care of performance 🚀 labels Jun 26, 2024
@ChristophWurst ChristophWurst changed the title [Bug]: Missing database indox on query for time sensitive background jobs [Bug]: Missing column in database index on query for time sensitive background jobs Jun 26, 2024
@nickvergessen
Copy link
Member

Sounds good

@nickvergessen nickvergessen added the good first issue Small tasks with clear documentation about how and in which place you need to fix things in. label Jun 27, 2024
@provokateurin provokateurin self-assigned this Aug 19, 2024
@provokateurin provokateurin added 3. to review Waiting for reviews and removed 1. to develop Accepted and waiting to be taken care of labels Aug 19, 2024
@provokateurin provokateurin removed their assignment Oct 1, 2024
@provokateurin provokateurin added 1. to develop Accepted and waiting to be taken care of and removed 3. to review Waiting for reviews labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in. performance 🚀
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants