Commit 6660736a by Tuomas Riihimäki

few database indexes found from profiling

1 parent effe8361
...@@ -317,7 +317,24 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -317,7 +317,24 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE org_role_requests ADD CONSTRAINT FK_org_role_requests_requested_role FOREIGN KEY (requested_role) REFERENCES org_roles (id)", "ALTER TABLE org_role_requests ADD CONSTRAINT FK_org_role_requests_requested_role FOREIGN KEY (requested_role) REFERENCES org_roles (id)",
"ALTER TABLE org_role_requests ADD CONSTRAINT FK_org_role_requests_user_id FOREIGN KEY (user_id) REFERENCES users (id)", "ALTER TABLE org_role_requests ADD CONSTRAINT FK_org_role_requests_user_id FOREIGN KEY (user_id) REFERENCES users (id)",
}); });
// Run some profiling against local database. These were few of the low hanging fruits.
dbUpdates.add(new String[] {
// User searching in admin view (seq scan to index scan)
"CREATE INDEX idx_eventuser_event ON event_users (event_id)",
// Menu subpage parent search.
"CREATE INDEX idx_menu_navigation_parent ON menu_navigation (parent_id)",
// constraint domains case insensitive also at database level.
// Select does not hit this yet because table is so small, but might someday
"CREATE UNIQUE INDEX idx_event_domains_domainname_key_lower ON event_domains (LOWER(domainname))",
// used for placecount calculation in shopping
"CREATE INDEX idx_places_product_id ON places (products_id)",
// Used placeslots calculation in shopping
"CREATE INDEX idx_place_slots_products ON place_slots (product_id, place_id)",
});
} }
public BootstrapBean() { public BootstrapBean() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!