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

Missing index for `SELECT * FROM *PREFIX*polls_polls WHERE (deleted = 0) OR (owner = "admin")` #3361

Open
3 of 12 tasks
ChristophWurst opened this issue Mar 14, 2024 · 2 comments

Comments

@ChristophWurst
Copy link
Member

ChristophWurst commented Mar 14, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Nextcloud's Code of Conduct.

What went wrong, what did you observe?

I'm analyzing a production installation of this app and noticed that the query SELECT * FROM PREFIXpolls_polls WHERE (deleted = 0) OR (owner = "admin") does not use an index.

What did you expect, how polls should behave instead?

Depending on the data the use of an index might be beneficial or not. E.g. if you only have polls of one user, then a full table scan be will more efficient anyway.

An possible index could be create index polls_polls_owner_deleted_idx on oc_polls_polls (owner, deleted);.

What steps does it need to replay this bug?

  1. Install 5.x

Installation method

Installed/updated from the appstore (Apps section of your site)

Installation type

First time installation

Affected polls version

5.4.3

Which browser did you use, when experiencing the bug?

  • Firefox
  • Chrome
  • Chromium/Chromium based (i.e. Edge)
  • Safari
  • Other/Don't know

Other browser

No response

Add your browser log here

No response

Additional client environment information

No response

NC version

Nextcloud 26

Other Nextcloud version

No response

PHP engine version

PHP 8.0

Other PHP version

No response

Database engine

MySQL

Database Engine version or other Database

No response

Which user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other/Don't know

Add your nextcloud server log here

No response

Additional environment informations

No response

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Additional Information

No response

@ChristophWurst ChristophWurst changed the title [5.x] Missing index for `SELECT * FROM *PREFIX*polls_polls WHERE (deleted = 0) OR (owner = "admin")` Missing index for `SELECT * FROM *PREFIX*polls_polls WHERE (deleted = 0) OR (owner = "admin")` Mar 14, 2024
@dartcafe
Copy link
Collaborator

Yes true, but this should be an enhancement rather than a bug, right?

@ChristophWurst
Copy link
Member Author

It's about performance so you can see it either way :)

@dartcafe dartcafe added enhancement and removed bug labels Apr 13, 2024
@dartcafe dartcafe linked a pull request Apr 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants