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
4049 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
...ctmanagerid, taskcdt.taskid, taskcdt.taskname, timecardentrycdt.hours, workrequestcdt.vendorid, timecardcdt.resourceid, timecardcdt.tpid, timecardperiodcdt.startdate, timecardperiodcdt.enddate from timecardentrycdt, workrequestcdt, taskcdt, timecardcdt, timecardperiodcdt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
Just as a disclaimer I am not a mysql expert so any suggestions are welcome.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sariqs
over 8 years ago
From your query it looks like you are creating the table by selecting data from different tables. Few questions,
How many records you have for this select query ? You can do count of records and check.
What is the size of each row you are fetching from different tables ?
Why you are creating table by select query, is there a chance you can use batch process which periodically adds records to your already created table in case you have lot of data.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
We are trying to do some performance tuning and we thought the best way would be to extra the data from these tables into a single table since our view code is taking so long to render.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Have you checked that there are indexes on each of the primary keys used by the select, and that the view is using them? Try using EXPLAIN SELECT <the view sql> command and look for full table scans.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Also, try running the select that the view uses separate to the view; if it runs faster when it's not the view then it's probably the view not using indexes.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
Thank you for the feedback. I will give it a try.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinitl522
A Score Level 2
over 8 years ago
Hello ,
Even I have a same scenario, where we are combining data from 5-6 different table and created a view, and the service backed record is used, it takes some time to fetch the record, and sometimes it displays an error. We are also looking if we can apply indexing on the table and the view.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 8 years ago
All of my tables have indexes so that is not the issue. I think it is just the amount of calculations that we are performing that is causing the performance hit.
If you find any solutions please post it. I will do the same.
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 post your view sql and the table structures that you are querying in the view? How many rows are you expecting to get in the view?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>