wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
71 stars 25 forks source link

Closes #747 fix slow queries #749

Closed CrochetFeve0251 closed 11 months ago

CrochetFeve0251 commented 11 months ago

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

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

Test summary

If not, detail what you could not test.

Please describe any additional tests you performed.

vmanthos commented 11 months ago

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

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 commented 11 months ago

@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.