We are facing slowness sometimes timeout error with UI. On Ui we are displaying 10 columns and one with record action icons also.
Data type is record type and layout is read only gridlayout.Using logical expression to filter data and user filters.The record is queried at many places in application.
Please suggest what can be possible issues because we are facing it frequently.
Discussion posts and replies are publicly visible
Are you by any chance doing some kind of secondary query to another record type or API in one of the columns?
Yes multiple such instances as we have multiple relationships with other record types.
Data need to be filtered on basis of these relationships like checking out different fields from different record types.
Are you filtering that with the related record types on the original query or do you have separate queries for that?
i.e. for the each of the rows in the grid, you make an individual query to another Record or API to get some info
Thanks Mathieu!
No API being used and no individual query for each row.
For filters parameter in data inside a!gridfield we call a rule and have logical expression consisting of 6-7 query filters like
a!queryfilter(
field:parentrecord.record1.field or parentrecord.record1.record2.fieldoperator;
value:constant or boolenan or local!value)
Is this based on a database view?
No as database is constantly updating.
Interesting. What does the performance view show?
a!gridField
Evaluation
Child
Do you have a condition on the record action? This lead to a extra query per row. And when your query takes 7 seconds, multiplied by 10 ...
Really, you need to speed up that queries!
A standard view can be used as the queries are executed in real-time, just don't use a materialized view.once you create your view, as Stefan mentioned, tune it. Run explain plan and add indexes and FKs to remove full table scans, optimize joins, limit the columns pulled, etc.
Doubt they are using views. They mentioned related record types which is only possible with synced data records which is not possible with views.
I think Stefan's hypothesis (a slow query in a Record Action) is the most plausible explanation.
Yes we have multiple record actions and visiblity rules defined for them.For one record action the visiblity rule is defined on UI just simple case of if inside a! grid field.
Will work on this and verfiy the same but seems the most valid reason.
Can you please explain the working of "This lead to a extra query per row"
When you define a visibility rule, Appian somehow needs to evaluate that rule. This can become a performance issue when you show multiple record actions on a screen. Then, Appian needs to fetch the data required for each of the evaluations.
Thank you Stefan and Mathieu!