-
Notifications
You must be signed in to change notification settings - Fork 367
JdbcAggregateOperations delete by query #2084
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
base: main
Are you sure you want to change the base?
Conversation
I’ve opened a draft PR for #1978. If you have any suggestions for improvement or spot any issues, I’d be glad to make the necessary changes. Thank you for reviewing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this looks pretty good.
I have on major concern though: We should not transfer the ids from the locking select to the client and use it for follow up deletes.
Instead the locking select should execute on the server only, and the delete operations should be based on the query directly.
The reason for this that this operation is very attractive for large amounts of data. In such cases transporting and converting the ids creates serious load on network and memory.
And if someone prefers to select the ids first and then delete based on these ids they can still do that using multiple methods.
Thanks for review i Changed the steps as follows:
|
Hello It looks like other commits were merged and now my previous PR has a conflict. Should I resolve it and push again?. and I can also make any improvements to my PR. |
That would be awesome |
Issue link: spring-projects#1978 Add deleteAllByQuery method to JdbcAggregateOperations This method enables deleting aggregates based on a query by performing the following steps: 1. Lock the target rows using SELECT ... FOR UPDATE based on the query conditions. 2. Delete sub-entities by leveraging a subquery that selects the matching root rows. 3. Delete the root entities using the query conditions. But if the query has no criteria, deletion is performed in the same way as deleteAll method of JdbcAggregateOperations Signed-off-by: JaeYeon Kim <[email protected]>
hello ! |
Issue link: #1978
Add deleteAllByQuery method to JdbcAggregateOperations
This method enables deleting aggregates based on a query by performing the following steps:
see
#1978