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

Closes #747 fix slow queries #749

Merged
merged 7 commits into from
Nov 1, 2023
Merged

Conversation

CrochetFeve0251
Copy link
Contributor

Description

This changes the query to filter first then make the join.
This helps how fast the query is done.

Fixes #747

Type of change

  • New feature (non-breaking change which adds functionality).

Is the solution different from the one proposed during the grooming?

I added a regex instead of likes to optimize even more queries.

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).
  • Any dependent changes have been merged and published in downstream modules.
  • If applicable, I have made corresponding changes to the documentation. Provide a link to the documentation.

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I validated all Acceptance Criteria of the related issues. (If applicable, provide proof).
  • I validated all test plan the QA Review asked me to.

If not, detail what you could not test.

Please describe any additional tests you performed.

@remyperona remyperona changed the title Enhancement/747 fix slow queries Closes #747 fix slow queries Oct 10, 2023
@vmanthos vmanthos self-requested a review October 24, 2023 12:29
@vmanthos
Copy link
Contributor

@CrochetFeve0251 With the PR, the queries are almost 5x faster! 🚀

Please check the following:

  1. None of the data is displayed in /wp-admin/upload.php?page=imagify-bulk-optimization.

The way it is with develop:
image

and with the PR:
image

  1. imagify_has_attachments_without_required_metadata() was executed on /wp-admin/options-general.php?page=imagify with develop but not with the PR. Is this expected?

@CrochetFeve0251
Copy link
Contributor Author

CrochetFeve0251 commented Oct 25, 2023

@CrochetFeve0251 With the PR, the queries are almost 5x faster! 🚀

Please check the following:

1. None of the data is displayed in `/wp-admin/upload.php?page=imagify-bulk-optimization`.

The way it is with develop: image

and with the PR: image

2. `imagify_has_attachments_without_required_metadata()` was executed on `/wp-admin/options-general.php?page=imagify` with `develop` but not with the PR. Is this expected?

@vmanthos 2. is related to the SQL query which returned a different result not calling the query.

Copy link
Contributor

@vmanthos vmanthos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected! 👍

@vmanthos vmanthos added this to the 2.1.3 milestone Nov 1, 2023
@vmanthos vmanthos added this pull request to the merge queue Nov 1, 2023
Merged via the queue into develop with commit e046686 Nov 1, 2023
6 checks passed
@vmanthos vmanthos deleted the enhancement/747-fix-slow-queries branch November 1, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very slow query with large media library
3 participants