@ledsun blog

無味の味は佳境に入らざればすなわち知れず

2022-07-22から1日間の記事一覧

ActiveRecordのバルクインサート比較 その1

手始めにRails6で追加されたinsert_allとimport(とその他)のパフォーマンス検証 - Qiita を追証します。 次のように検証用のRailsアプリケーションを用意します。 bundle exec rails new . bulk_insert -MCAJT bin/rails g user name:string bin/rails db:pr…

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been depre

bundleコマンドを実行したら表題の警告が出ました。 ledsun@MSI:~/activerecord-bulk-insert►bundle Bundler 2.3.7 is running, but your lockfile was generated with 2.2.22. Installing Bundler 2.2.22 and restarting using that version. Fetching gem …

PostgreSQLのインデックスが肥大化するとInsertがおそくなる

先月末からJSONファイルからDBに一括取り込みする処理の高速化をしています。 activerecord-importを使っていたので、つぎの方法を試しました。 activerecord-importに渡すデータ生成のチューニング ActiveRecordインスタンスからハッシュに変更 ActiveRecor…