From bb55efb775994ba18ee8365907bc0a58d4661f32 Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Mon, 28 Oct 2019 15:32:19 -0500 Subject: [PATCH] Add index to feed source url column on articles (#4595) --- ...0191025202354_add_articles_index_for_feed_source_url.rb | 7 +++++++ db/schema.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20191025202354_add_articles_index_for_feed_source_url.rb diff --git a/db/migrate/20191025202354_add_articles_index_for_feed_source_url.rb b/db/migrate/20191025202354_add_articles_index_for_feed_source_url.rb new file mode 100644 index 000000000..e5337aafc --- /dev/null +++ b/db/migrate/20191025202354_add_articles_index_for_feed_source_url.rb @@ -0,0 +1,7 @@ +class AddArticlesIndexForFeedSourceUrl < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def change + add_index :articles, :feed_source_url, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index 77aded01f..96a136089 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -12,7 +12,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_10_25_185619) do +ActiveRecord::Schema.define(version: 2019_10_25_202354) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -137,6 +137,7 @@ ActiveRecord::Schema.define(version: 2019_10_25_185619) do t.string "video_thumbnail_url" t.index ["boost_states"], name: "index_articles_on_boost_states", using: :gin t.index ["featured_number"], name: "index_articles_on_featured_number" + t.index ["feed_source_url"], name: "index_articles_on_feed_source_url" t.index ["hotness_score"], name: "index_articles_on_hotness_score" t.index ["path"], name: "index_articles_on_path" t.index ["published"], name: "index_articles_on_published"