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
4044 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
0
helmuta
over 8 years ago
The view sql is part of my initial post. The view brings back 34165 rows of data and it is growing. The table structures can be posted but there are 5 tables and they are pretty large.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
If you can send the table structures (not data!) for the following tables, I might be able to help you rewrite the view SQL.
timecardentrycdt
workrequestcdt
taskcdt
timecardcdt
timecardperiodcdt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
Here are images of the table structure. Thank you for offering your help
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Are you able to export the tables in SQL format - structure only - to produce a file that looks like CREATE TABLE timecardentrycdt(... so that I can create them locally to make sure the SQL works?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
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
0
helmuta
over 8 years ago
Your view creation code does not do what is required of our view. I have attached the view code to show you the complicated calculations that we are running.
view code.sql
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
It looks like you've created a view that does selects across other views; this means indexes will not be used correctly - if at all - and is almost certainly the cause of the poor performance you're seeing.
Where I've had this issue before, I've rolled the SQL in the subviews up into the main view and seen much better performance.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
Thanks for the input Phil. I will work with my team to see how to best split the view into multiple views and then combine in the end.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<