Questions about Querying Data from an RDBMS

with Reference to this below URL,
forum.appian.com/.../Querying_Data_From_an_RDBMS.html
There are some doubts out of my interest.
Lets consider a scenario, like we have a view which is having 100k of data and it is trying to fetch the data with pagination with 25 records per page. we are using Query rules and we are in version 7.4
Knowing that pagination is given it will load only 25 records per page but our doubt is since pagination is used in the expression rule of displaying the data in grid,
1.Is Query Rule fetching all the records and showing 25 per page or is it hitting the db for the next 25 records,
2.Is this the same way how Query Entity works or is it different.
3.Knowing that the maximum limit of data for Query rule is 1 MB, is it the same for Query Entity or does this differ.
4.How does the performance of Query rule and Query Entity differ if the working of both are same.
Please Sugges...

OriginalPostID-196692

OriginalPostID-196692

  Discussion posts and replies are publicly visible

Parents
  • To add briefly to the performance testing, I just ran a quick test from the Appian GUI on a basic queryEntity vs Query Rule, on 15 paged records over a DB containing 2.4 million records.

    a!queryEntity() - 704 ms

    720
    762
    665
    599
    774
    694
    716
    725
    758
    625

    Query Rule - 687 ms

    838
    672
    697
    720
    619
    561
    790
    637
    672
    660

    Over 10 tests the QR wins out by 17 ms.

    load(
    local!pagingInfo: a!pagingInfo(1,15),
    /* 704 ms avg
    local!data: a!queryEntity(
    entity: cons!ENTITY_TASK_HISTORY,
    query: a!query(
    pagingInfo: local!pagingInfo
    )
    ),
    */
    /* 687 avg */
    local!data: rule!chrisTest_qrTaskHistory(local!pagingInfo),

    a!textField(
    readOnly: true,
    value: count(local!data.data)
    )
    )
  • This is consistent with my findings as well. a!queryEntity() appears to add a fixed overhead of about 10-20ms. I reported this to Support but they have not replied with any indication of fixing it. We still use a!queryEntity() everywhere as a best practice for:

    (1) Consistency
    (2) Traceable dependents
    (3) More filter operators
    (4) Expressionable filters
    (5) Potential to improve performance and overcompensate for the 10-20ms fixed penalty
Reply
  • This is consistent with my findings as well. a!queryEntity() appears to add a fixed overhead of about 10-20ms. I reported this to Support but they have not replied with any indication of fixing it. We still use a!queryEntity() everywhere as a best practice for:

    (1) Consistency
    (2) Traceable dependents
    (3) More filter operators
    (4) Expressionable filters
    (5) Potential to improve performance and overcompensate for the 10-20ms fixed penalty
Children
No Data