Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
18 replies
Subscribers
7 subscribers
Views
4051 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
We are in the process of making some performance improvements for our production
helmuta
over 8 years ago
We are in the process of making some performance improvements for our production environment for certain records. We are pulling data from 5 different database tables to create our record. Currently, we are using a view to combine the data but we are finding the performance is dismal. So we have decided to try and combine this data into a new table. I am was able to get the sql to work for a small subset of the data but trying to combine all of the data is killing our environment (95% + memory utilization) and it did not complete. I will post the sql code to see if anyone has a better idea.
CREATE TABLE bar (tcentryid int, wrid int,title varchar(500),groupid int, projectmanagerid int, taskid int, taskname varchar(255), hours decimal, vendorid int, resourceid int, tpid int, timeperiodstartdate date, timeperiodenddate date) SELECT timecardentrycdt.tcentryid, workrequestcdt.wrid, workrequestcdt.title, workrequestcdt.groupid, workrequestcdt.proje...
OriginalPostID-164844
OriginalPostID-164844
Discussion posts and replies are publicly visible
Parents
0
PhilB
A Score Level 1
over 8 years ago
Ok, I've made some assumptions about your tables and attached what I think they look like . Note that's I've missed some fields out of the work request table to make it simpler on my side. Try running the script I've attached and see if it's any faster than the one you provided in your original post.
You may wish to add indexes to the *foreign* keys that are in each table; assuming my interpretation of the tables is correct, you're missing a number of indexes on those foreign key fields and that may cause performance issues.
Finally, try placing EXPLAIN in front of your original SELECT as well as the SQL I've attached, run each of those and then compare the results. Feel free to export and post the EXPLAIN results if you need help interpreting them.
tc.sql
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
PhilB
A Score Level 1
over 8 years ago
Ok, I've made some assumptions about your tables and attached what I think they look like . Note that's I've missed some fields out of the work request table to make it simpler on my side. Try running the script I've attached and see if it's any faster than the one you provided in your original post.
You may wish to add indexes to the *foreign* keys that are in each table; assuming my interpretation of the tables is correct, you're missing a number of indexes on those foreign key fields and that may cause performance issues.
Finally, try placing EXPLAIN in front of your original SELECT as well as the SQL I've attached, run each of those and then compare the results. Feel free to export and post the EXPLAIN results if you need help interpreting them.
tc.sql
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data