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

Reduce SQL calls when incrementing/decrementing run counters #881

Merged
merged 9 commits into from
Oct 31, 2023

Commits on Oct 29, 2023

  1. 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
    bkiahstroud committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    ccbc1a8 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. Configuration menu
    Copy the full SHA
    e359ada View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ae65cb7 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Configuration menu
    Copy the full SHA
    3edd18c View commit details
    Browse the repository at this point in the history
  2. fix more specs

    bkiahstroud committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    e99708e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    658ff3c View commit details
    Browse the repository at this point in the history
  4. remove references to "children" ImporterRun columns

    These columns (`processed_children` and `failed_children`) were renamed
    in the RenameChildrenCountersToRelationships migration; they no longer
    exist
    bkiahstroud committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    d2d46d7 View commit details
    Browse the repository at this point in the history
  5. prefer avoiding raw SQL

    bkiahstroud committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    321ca84 View commit details
    Browse the repository at this point in the history
  6. rubocop

    bkiahstroud committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    de3b9b4 View commit details
    Browse the repository at this point in the history