Skip to content

Conversation

@aatanasov-cloudinary
Copy link
Collaborator

@aatanasov-cloudinary aatanasov-cloudinary commented Sep 26, 2025

Hosting platforms like WP Engine have the following SELECT query checks:

  • Killed Query: Query terminated because it is over 16,000 characters.
  • Long Query: Query noted because it is over 1,024 characters.

With this PR, we ensure the query_relations SELECT queries are lower than 1024 characters.

Approach

  • Splitting the query_relations query into chunks.
  • Setting a chunk size of 25 relation hashes to ensure the length of each chunk SELECT query is lower than 1024 characters.

QA notes

Before checking out this branch:

  • Install Query Monitor.
  • Go to some pages with different content (including images and videos) and check the returned rows of this query in Query Monitor.
7b99086b-2f06-4c51-960f-086a212747cb

After checking out this branch:

  • Go to the same pages and sum the returned rows of all chunks. The number should match the previous number.
  • Grab a few chunks and check if the characters' length exceeds 1024 characters.
  • Ensure all Cloudinary delivered images on the front-end are delivered as it was before checking out this branch.

Note: It is expected that the number of hashes be more than the actual images because we also check for sized URLs.

Screenshot 2025-09-26 at 15 48 42

Copy link
Collaborator

@gabrielcld2 gabrielcld2 left a comment

Choose a reason for hiding this comment

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

Tested locally and everything works as expected 👍

@aatanasov-cloudinary aatanasov-cloudinary merged commit 13152bf into develop Sep 29, 2025
3 checks passed
@aatanasov-cloudinary aatanasov-cloudinary mentioned this pull request Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants