remove unused indexes
This commit is contained in:
22
db/migrate/20250724213505_remove_unused_indexes.rb
Normal file
22
db/migrate/20250724213505_remove_unused_indexes.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveUnusedIndexes < ActiveRecord::Migration[7.2]
|
||||
extend T::Sig
|
||||
|
||||
sig { void }
|
||||
def up
|
||||
remove_index :domain_user_post_favs,
|
||||
name: "idx_domain_user_post_favs_on_explicit_time"
|
||||
remove_index :domain_user_post_favs,
|
||||
name: "idx_domain_user_post_favs_on_inferred_time"
|
||||
remove_index :domain_post_files, column: :blob_sha256
|
||||
remove_index :http_log_entries, column: :response_headers_id
|
||||
remove_index :http_log_entries, column: :request_headers_id
|
||||
end
|
||||
|
||||
sig { void }
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
@@ -3330,13 +3330,6 @@ CREATE UNIQUE INDEX idx_domain_post_groups_on_sofurry_id ON public.domain_post_g
|
||||
CREATE UNIQUE INDEX idx_domain_posts_on_sofurry_id ON public.domain_posts USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::Post::SofurryPost'::public.domain_post_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_user_post_favs_on_explicit_time; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idx_domain_user_post_favs_on_explicit_time ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'explicit_time'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_user_post_favs_on_fav_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -3344,13 +3337,6 @@ CREATE INDEX idx_domain_user_post_favs_on_explicit_time ON public.domain_user_po
|
||||
CREATE UNIQUE INDEX idx_domain_user_post_favs_on_fav_id ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'fav_id'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_user_post_favs_on_inferred_time; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX idx_domain_user_post_favs_on_inferred_time ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'inferred_time'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_users_e621_on_name_lower; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -3918,13 +3904,6 @@ CREATE INDEX index_domain_post_files_inkbunny_aux_on_base_table_id ON public.dom
|
||||
CREATE INDEX index_domain_post_files_inkbunny_aux_on_ib_id ON public.domain_post_files_inkbunny_aux USING btree (ib_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_domain_post_files_on_blob_sha256; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_domain_post_files_on_blob_sha256 ON public.domain_post_files USING btree (blob_sha256);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_domain_post_files_on_log_entry_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -4443,20 +4422,6 @@ CREATE INDEX index_good_jobs_on_scheduled_at ON public.good_jobs USING btree (sc
|
||||
CREATE INDEX index_http_log_entries_on_caused_by_id ON public.http_log_entries USING btree (caused_by_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_http_log_entries_on_request_headers_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_http_log_entries_on_request_headers_id ON public.http_log_entries USING btree (request_headers_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_http_log_entries_on_response_headers_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_http_log_entries_on_response_headers_id ON public.http_log_entries USING btree (response_headers_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_http_log_entries_on_response_sha256; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -5297,6 +5262,7 @@ ALTER TABLE ONLY public.domain_twitter_tweets
|
||||
SET search_path TO "$user", public;
|
||||
|
||||
INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20250724213505'),
|
||||
('20250723194407'),
|
||||
('20250723193659'),
|
||||
('20250722235434'),
|
||||
|
||||
Reference in New Issue
Block a user