From 8a7fe6f60ad5b8a7f37df40f25f893f9881d72e2 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 5 Dec 2024 13:27:59 -0800 Subject: [PATCH] improve initial importer show page load time --- db/migrate/20241205212513_faster_first_entry.rb | 7 +++++++ spec/test_app/db/schema.rb | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20241205212513_faster_first_entry.rb diff --git a/db/migrate/20241205212513_faster_first_entry.rb b/db/migrate/20241205212513_faster_first_entry.rb new file mode 100644 index 00000000..e0ac8804 --- /dev/null +++ b/db/migrate/20241205212513_faster_first_entry.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true +class FasterFirstEntry < ActiveRecord::Migration[5.2] + def change + add_index :bulkrax_entries, [:importerexporter_id, :importerexporter_type, :id], name: 'index_bulkrax_entries_on_importerexporter_id_type_and_id' unless index_exists?(:bulkrax_entries, [:importerexporter_id, :importerexporter_type, :id], + name: 'index_bulkrax_entries_on_importerexporter_id_type_and_id') + end +end diff --git a/spec/test_app/db/schema.rb b/spec/test_app/db/schema.rb index c57a7ced..f14b49ad 100644 --- a/spec/test_app/db/schema.rb +++ b/spec/test_app/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2024_12_03_010707) do +ActiveRecord::Schema.define(version: 2024_12_05_212513) do create_table "accounts", force: :cascade do |t| t.string "name" @@ -44,6 +44,7 @@ t.string "status_message", default: "Pending" t.string "error_class" t.index ["identifier", "importerexporter_id", "importerexporter_type"], name: "bulkrax_identifier_idx" + t.index ["importerexporter_id", "importerexporter_type", "id"], name: "index_bulkrax_entries_on_importerexporter_id_type_and_id" t.index ["importerexporter_id", "importerexporter_type"], name: "bulkrax_entries_importerexporter_idx" t.index ["type"], name: "index_bulkrax_entries_on_type" end @@ -103,8 +104,6 @@ t.integer "total_file_set_entries", default: 0 t.integer "processed_works", default: 0 t.integer "failed_works", default: 0 - t.integer "processed_children", default: 0 - t.integer "failed_children", default: 0 t.index ["importer_id"], name: "index_bulkrax_importer_runs_on_importer_id" end