-
Notifications
You must be signed in to change notification settings - Fork 21
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
Reduce SQL calls when incrementing/decrementing run counters #881
Merged
Commits on Oct 29, 2023
-
Reduce SQL calls when incrementing run counters
SQL logs before changes (using `#increment!`): ```sql Bulkrax::ImporterRun Load (8.9ms) SELECT "bulkrax_importer_runs".* FROM "bulkrax_importer_runs" WHERE "bulkrax_importer_runs"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] Bulkrax::ImporterRun Update All (2.5ms) UPDATE "bulkrax_importer_runs" SET "processed_records" = COALESCE("processed_records", 0) + 1 WHERE "bulkrax_importer_runs"."id" = $1 [["id", 1]] ``` SQL logs after changes (using `#increment_counter`): ```sql Bulkrax::ImporterRun Update All (6.5ms) UPDATE "bulkrax_importer_runs" SET "processed_records" = COALESCE("processed_records", 0) + 1 WHERE "bulkrax_importer_runs"."id" = $1 [["id", 1]] ``` The `SELECT` statement serves no purpose since the `UPDATE` statement is atomic
Configuration menu - View commit details
-
Copy full SHA for ccbc1a8 - Browse repository at this point
Copy the full SHA ccbc1a8View commit details
Commits on Oct 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e359ada - Browse repository at this point
Copy the full SHA e359adaView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae65cb7 - Browse repository at this point
Copy the full SHA ae65cb7View commit details
Commits on Oct 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3edd18c - Browse repository at this point
Copy the full SHA 3edd18cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e99708e - Browse repository at this point
Copy the full SHA e99708eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 658ff3c - Browse repository at this point
Copy the full SHA 658ff3cView commit details -
remove references to "children" ImporterRun columns
These columns (`processed_children` and `failed_children`) were renamed in the RenameChildrenCountersToRelationships migration; they no longer exist
Configuration menu - View commit details
-
Copy full SHA for d2d46d7 - Browse repository at this point
Copy the full SHA d2d46d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 321ca84 - Browse repository at this point
Copy the full SHA 321ca84View commit details -
Configuration menu - View commit details
-
Copy full SHA for de3b9b4 - Browse repository at this point
Copy the full SHA de3b9b4View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.