Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6660736a
authored
Apr 15, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few database indexes found from profiling
1 parent
effe8361
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BootstrapBean.java
View file @
6660736
...
...
@@ -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_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
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment