Hello Team,
We replicated our production application database into test environment to recreate some issue and observed a new issue.
On record type it is timing out, we started checking record type and on Default Filters we have id selected and below expression is there to bring id's based on user role below expression is for admins . if we are passing 1,-1 it is taking more than 7 seconds .
if we are passing 1,25 still it is taking same time or sometimes more than that. it is entity backed record and data is coming from view.
Note data is same on PROD and TEST , on PROD it is taking 1 second for 1,-1 and 7 MS for 1,25. What can be the issue ?
tointeger(a!queryEntity( entity: cons!ABC_VIEW_DSE, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field:"id" ) } ), pagingInfo:a!pagingInfo(1,-1) )).data.id)
Discussion posts and replies are publicly visible
Some thoughts that might be worth looking into1. Run explain plan on your view. Is it doing any full table scans that can be removed 2. Is the ID field a PK or a field that has an index3. Since it looks like you are trying to convert the resulting set to integer in Appian, can you change the view to have that column as an integer and remove the tointeger
Thank you . Will take a look . but still trying to find a reason when data is same why working on prod and not on test. One more pointer in cloud database on test view is taking time to load data and when sorting on id it is taking more than 13 seconds, on prod less then 1 second.
As Appian is written in java so it has 2 objects, 1 controller, and 1 service class to map database object to the Appian CDT object.
Data Transformation Object
Data Acces Object
Which are mapped using a transformation service class. So basically it's a web API(with paginated) call which we are under presumption its a database call. Whenever there is a probability of a huge data set, I would recommend a stored procedure with pagination. I am sooner going to blog about this with the detailed performance of Appian database connections. I have already written one article on this aspect "https://www.linkedin.com/pulse/microservices-vs-appianbuild-microservice-praful-singhal/?trackingId=Ig3w6S0pSvi0arXGOMWgBw%3D%3D". I am now planning to deep dive into it with my next article coming on this weekend, hope my next article will help you understand the root cause and take you in the right step in direction of store procedures.
Thank you all for response. Came to know that Appian cloud database as have very less resources as compare to PROD . we were using cloud database so was not sure on resources part.