-
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
🎁 Adding indices to Bulkrax Tables #813
Conversation
Note: this is a best guess of what could use indexing. The guess is based on my recent querying. - `add_index :bulkrax_entries, :identifier` :: because the identifier is an important concept for an import. - `add_index :bulkrax_entries, :type` :: because filtering on the type of an entry is important. - `add_index :bulkrax_entries, [:importerexporter_id, :importerexporter_type], name: 'bulkrax_entries_importerexporter_idx` :: this is a foreign key for the entries relationship to the importer/exporter. - `add_index :bulkrax_pending_relationships, :parent_id` :: a foreign key - `add_index :bulkrax_pending_relationships, :child_id` :: a foreign key - `add_index :bulkrax_statuses, [:statusable_id, :statusable_type], name: 'bulkrax_statuses_statusable_idx'` :: a foreign key - `add_index :bulkrax_statuses, [:runnable_id, :runnable_type], name: 'bulkrax_statuses_runnable_idx'` :: a foreign key - `add_index :bulkrax_statuses, :error_class` :: when querying what's in error, this index is helpful; also one used for grouping.
In downstream implementations, I'm seeing 1.4.0. I'm seeing 1.5.0 failing in specs.
In specs, I was seeing the following error: ``` Psych::AliasesNotEnabled: Cannot load database configuration: Alias parsing was not enabled. To enable it, pass `aliases: true` to `Psych::load` or `Psych::safe_load`. ``` Given that we rarely touch the file, I see no benefit to using an alias relative to the above error exception.
Looking at Adventist, which has a working Redis instance, I see that it uses 4.2.5; however the newer version (v5) has the following error: `ArgumentError: wrong number of arguments (given 1, expected 0)`; that error is part of redis-client which is part of redis 5.0.6
First, this is well past end of life. And second, I'm seeing the following in the 2.6 build: ``` ArgumentError: wrong number of arguments (given 4, expected 1) /home/runner/work/bulkrax/bulkrax/vendor/bundle/ruby/2.6.0/gems/psych-5.1.0/lib/psych.rb:322:in `safe_load' ``` Not interested in fighting against that.
As this is for specs, I'm favoring that functionality/implementation.
I'm seeing the following in CI: ``` ArgumentError: wrong number of arguments (given 4, expected 1) /home/runner/work/bulkrax/bulkrax/vendor/bundle/ruby/2.7.0/gems/psych-5.1.0/lib/psych.rb:322:in `safe_load' ```
cfaee2f
to
5a6ba88
Compare
@@ -4,22 +4,23 @@ | |||
# Ensure the SQLite 3 gem is defined in your Gemfile | |||
# gem 'sqlite3' | |||
# | |||
default: &default |
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.
was this not working? or do you just have a preference of explicitly stating the variables for each environment?
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.
This was not working because of some Psych stuff.
consider removing coverage task |
…lkrax into adding-indices-to-tables
Note: this is a best guess of what could use indexing. The guess is based on my recent querying.
add_index :bulkrax_entries, :identifier
:: because the identifier is an important concept for an import.add_index :bulkrax_entries, :type
:: because filtering on the type of an entry is important.add_index :bulkrax_entries, [:importerexporter_id, :importerexporter_type], name: 'bulkrax_entries_importerexporter_idx
:: this is a foreign key for the entries relationship to the importer/exporter.add_index :bulkrax_pending_relationships, :parent_id
:: a foreign keyadd_index :bulkrax_pending_relationships, :child_id
:: a foreign keyadd_index :bulkrax_statuses, [:statusable_id, :statusable_type], name: 'bulkrax_statuses_statusable_idx'
:: a foreign keyadd_index :bulkrax_statuses, [:runnable_id, :runnable_type], name: 'bulkrax_statuses_runnable_idx'
:: a foreign keyadd_index :bulkrax_statuses, :error_class
:: when querying what's in error, this index is helpful; also one used for grouping.