db: add updated_at index on wiki pages.

The wiki pages sidebar is ordered by updated_at. The sidebar is present
on all wiki pages, so this improves load times for all wikis.
This commit is contained in:
evazion
2017-03-29 14:16:09 -05:00
parent 8376c33980
commit fcc5521f63
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
class AddUpdatedAtIndexOnWikiPages < ActiveRecord::Migration
def change
WikiPage.without_timeout do
add_index :wiki_pages, :updated_at
end
end
end

View File

@@ -7217,6 +7217,13 @@ CREATE UNIQUE INDEX index_wiki_pages_on_title ON wiki_pages USING btree (title);
CREATE INDEX index_wiki_pages_on_title_pattern ON wiki_pages USING btree (title text_pattern_ops);
--
-- Name: index_wiki_pages_on_updated_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_wiki_pages_on_updated_at ON wiki_pages USING btree (updated_at);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
@@ -7562,3 +7569,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170316224630');
INSERT INTO schema_migrations (version) VALUES ('20170319000519');
INSERT INTO schema_migrations (version) VALUES ('20170329185605');