Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Avoid executing no-op queries. #16583

Merged
merged 7 commits into from
Nov 7, 2023
Merged

Avoid executing no-op queries. #16583

merged 7 commits into from
Nov 7, 2023

Conversation

clokep
Copy link
Member

@clokep clokep commented Oct 31, 2023

Return early for simple_insert_many_txn, simple_upsert_many_txn, and simple_update_many_txn if the iterable to update is empty.

Note that we already do this for simple_select_many_txn and simple_delete_many_txn.

This avoids hitting the database with a no-op query, the downside is that we can't pass generators into this function.

@clokep clokep marked this pull request as ready for review October 31, 2023 18:10
@clokep clokep requested a review from a team as a code owner October 31, 2023 18:10
@clokep
Copy link
Member Author

clokep commented Nov 3, 2023

I'm not 100% convinced of these changes, I want to add some tests.

@clokep
Copy link
Member Author

clokep commented Nov 3, 2023

Once #16596 is merged, I'll add tests for these changes to ensure nothing is breaking.

@clokep
Copy link
Member Author

clokep commented Nov 7, 2023

I added some additional tests (based on #16596) and some more comments. 👍

@clokep clokep merged commit 9738b1c into develop Nov 7, 2023
41 checks passed
@clokep clokep deleted the clokep/skip-inserts branch November 7, 2023 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants