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

Remove count from async persister #1905

Merged

Conversation

oleg-andreyev
Copy link
Contributor

Async Persister is returning useless count that is not used anywhere but to calculate it, we are making an expensive COUNT() query.

— result from insertPage not used anywhere, and it is resulted in useless and expensive query to database.
$messageBus = $this->createMock(MessageBusInterface::class);
$sut = new AsyncPagerPersister($pagerPersisterRegistry, $pagerProviderRegistry, $messageBus);

$sut->insertPage(1, [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

funny fact this should have been assert result of insertPage but it's no doing it.

@oleg-andreyev
Copy link
Contributor Author

@XWB @toaotc could you please take a look.

@XWB
Copy link
Member

XWB commented May 22, 2023

Async Persister is returning useless count

Do you know why it is useless? Do you mean the count result is inaccurate?

@oleg-andreyev
Copy link
Contributor Author

Async Persister is returning useless count

Do you know why it is useless? Do you mean the count result is inaccurate?

Based on usage in AsyncPersistPageHandler, value is returned and later is not used.
So if value is not used, why do we need to execute it.

@XWB XWB merged commit 5d15338 into FriendsOfSymfony:master May 22, 2023
19 checks passed
@oleg-andreyev oleg-andreyev deleted the remove-count-from-async-persister branch May 22, 2023 18:48
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.

None yet

2 participants