Add IP addr indexes on comments & artist/artcomm/wikipage versions.

This commit is contained in:
evazion 2017-01-12 06:28:35 +00:00
parent e8f71739be
commit 3ca638bc92
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class AddIpAddrIndexesToTables < ActiveRecord::Migration
def change
reversible { execute "set statement_timeout = 0" }
add_index :wiki_page_versions, :updater_ip_addr
add_index :artist_commentary_versions, :updater_ip_addr
add_index :artist_versions, :updater_ip_addr
add_index :comments, :ip_addr
end
end

View File

@ -4881,6 +4881,13 @@ CREATE INDEX index_artist_commentary_versions_on_post_id ON artist_commentary_ve
CREATE INDEX index_artist_commentary_versions_on_updater_id_and_post_id ON artist_commentary_versions USING btree (updater_id, post_id);
--
-- Name: index_artist_commentary_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_artist_commentary_versions_on_updater_ip_addr ON artist_commentary_versions USING btree (updater_ip_addr);
--
-- Name: index_artist_urls_on_artist_id; Type: INDEX; Schema: public; Owner: -
--
@ -4937,6 +4944,13 @@ CREATE INDEX index_artist_versions_on_name ON artist_versions USING btree (name)
CREATE INDEX index_artist_versions_on_updater_id ON artist_versions USING btree (updater_id);
--
-- Name: index_artist_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_artist_versions_on_updater_ip_addr ON artist_versions USING btree (updater_ip_addr);
--
-- Name: index_artists_on_group_name; Type: INDEX; Schema: public; Owner: -
--
@ -5035,6 +5049,13 @@ CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index);
CREATE INDEX index_comments_on_creator_id_and_post_id ON comments USING btree (creator_id, post_id);
--
-- Name: index_comments_on_ip_addr; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_comments_on_ip_addr ON comments USING btree (ip_addr);
--
-- Name: index_comments_on_post_id; Type: INDEX; Schema: public; Owner: -
--
@ -7051,6 +7072,13 @@ CREATE INDEX index_users_on_last_ip_addr ON users USING btree (last_ip_addr) WHE
CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text));
--
-- Name: index_wiki_page_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_wiki_page_versions_on_updater_ip_addr ON wiki_page_versions USING btree (updater_ip_addr);
--
-- Name: index_wiki_page_versions_on_wiki_page_id; Type: INDEX; Schema: public; Owner: -
--
@ -7409,3 +7437,4 @@ INSERT INTO schema_migrations (version) VALUES ('20161229001201');
INSERT INTO schema_migrations (version) VALUES ('20170106012138');
INSERT INTO schema_migrations (version) VALUES ('20170112021922');