PostgreSQL implementation: add indexes for all foreign keys
@@ -25,4 +25,32 @@ vacuum analyze;
-- create index on foreign keys
-- TODO: other FK indexes to be added
+CREATE INDEX forum_moderatorid ON forum (f_moderatorid);
+CREATE INDEX forum_person_forumid ON forum_person (fp_forumid);
+CREATE INDEX forum_person_personid ON forum_person (fp_personid);
+CREATE INDEX forum_tag_forumid ON forum_tag (ft_forumid);
+CREATE INDEX forum_tag_tagid ON forum_tag (ft_tagid);
+CREATE INDEX knows_person1id ON knows (k_person1id);
+CREATE INDEX knows_person2id ON knows (k_person2id);
+CREATE INDEX likes_personid ON likes (l_personid);
+CREATE INDEX likes_postid ON likes (l_postid);
+CREATE INDEX organisation_placeid ON organisation (o_placeid);
+CREATE INDEX person_placeid ON person (p_placeid);
+CREATE INDEX person_company_personid ON person_company (pc_personid);
+CREATE INDEX person_company_organisationid ON person_company (pc_organisationid);
+CREATE INDEX person_email_personid ON person_email (pe_personid);
+CREATE INDEX person_language_personid ON person_language (plang_personid);
+CREATE INDEX person_tag_personid ON person_tag (pt_personid);
+CREATE INDEX person_tag_tagid ON person_tag (pt_tagid);
+CREATE INDEX person_university_personid ON person_university (pu_personid);
+CREATE INDEX person_university_organisationid ON person_university (pu_organisationid);
+CREATE INDEX place_containerplaceid ON place (pl_containerplaceid);
+CREATE INDEX post_creatorid ON post (ps_creatorid);
+CREATE INDEX post_locationid ON post (ps_locationid);
+CREATE INDEX post_forumid ON post (ps_forumid);
CREATE INDEX post_replyof ON post (ps_replyof);
+CREATE INDEX post_country ON post (ps_country);
+CREATE INDEX post_tag_postid ON post_tag (pst_postid);
+CREATE INDEX post_tag_tagid ON post_tag (pst_tagid);
+CREATE INDEX tag_tagclassid ON tag (t_tagclassid);
+CREATE INDEX tagclass_subclassoftagclassid ON tagclass (tc_subclassoftagclassid);
