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

FEATURE: Implement flushByTags for the PDO cache backend #2720

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

Sebobo
Copy link
Member

@Sebobo Sebobo commented Mar 2, 2022

What I did

With this change the flushByTags is optimised to run in batches.
The maximum batch size can and should be configured based on the used data source.

This change relies on the interface changes in #2718

How I did it

Instead of querying identifiers for each tag separately, they are now queried in batches
for a number of tags and then deleted.

How to verify it

Configure PDO backend for the Neos content cache and force a flush by publishing something.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch

@Sebobo Sebobo added the P: Cache label Mar 2, 2022
@Sebobo
Copy link
Member Author

Sebobo commented Mar 2, 2022

Still a draft, as I want to check out if we can combine the SELECT with the first DELETE query by using a JOIN as hinted by @bwaidelich

@bwaidelich
Copy link
Member

DELETE c FROM cache c JOIN tags t ON t.identifier = c.identifier WHERE t.tag IN ('tag1', 'tag2');

should work

@Sebobo Sebobo self-assigned this Mar 2, 2022
@Sebobo
Copy link
Member Author

Sebobo commented Mar 18, 2022

@bwaidelich can't get it to work. Always get syntax error with the JOIN even though the same query works when directly executed in MySQL 😕

@bwaidelich
Copy link
Member

@Sebobo can you share your WIP?

@Sebobo
Copy link
Member Author

Sebobo commented Mar 18, 2022

I tried various combinations of aliases etc., maybe its easier via screen share. I'll ping you.

With this change the `flushByTags` is optimised to run
in batches. The maximum batch size can and should be
configured based on the used data source.

This change relies on the interface changes in neos#2717
@Sebobo Sebobo force-pushed the feature/flush-by-tags-pdo-backend branch from 220a2c3 to 1aeccfd Compare March 18, 2022 21:22
@Sebobo Sebobo marked this pull request as ready for review March 18, 2022 21:22
@Sebobo Sebobo requested a review from kdambekalns March 18, 2022 22:10
@albe albe self-requested a review March 21, 2022 09:39
@robertlemke robertlemke merged commit 9c13300 into neos:master Mar 23, 2022
@Sebobo Sebobo deleted the feature/flush-by-tags-pdo-backend branch March 23, 2022 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants