Query Entity taking lot of time in fetching the data.

Hi All,

I am using a query entity to fetch the data from microsoft sql.

a!queryEntity(
entity: cons!ABc,
query: {
a!query(
seletion: {
a!querySelection(
columns: {
column1,column2,column3,column4,column5,column6,column7,column8,column9,column10
}
)
},
logicalExpression: a!queryLogicalExpression(
operator: "AND",
logicalExpressions: if(
isusermemberofgroup(
loggedInUser(),
Group1
),
a!queryLogicalExpression(
operator: "OR",
logicalExpressions: {
a!queryLogicalExpression(
operator: "AND",
logicalExpressions: a!queryLogicalExpression(
operator: "OR",
filters: {
a!queryFilter(
field: "productType",
operator: "=",
value: Value1
),
a!queryFilter(
field: "productType",
operator: "=",
value: value2
),
a!queryFilter(
field: "productType",
operator: "=",
value:value3
)
}
),
filters: a!queryFilter(
field: "transferType",
operator: "=",
value: value4
)
),
a!queryLogicalExpression(
operator: "AND",
logicalExpressions: a!queryLogicalExpression(
operator: "OR",
filters: {
a!queryFilter(
field: "productType",
operator: "=",
value: value5
),
a!queryFilter(
field: "productType",
operator: "=",
value: value6
)
}
),
filters: a!queryFilter(
field: "transferType",
operator: "=",
value:value7
)
)
}
),
if(
isusermemberofgroup(
loggedInUser(),
value9
),
a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "productType",
operator: "=",
value: value10
),
a!queryFilter(
field: "transferType",
operator: "=",
value: value11
)/*,
a!queryFilter(
field: "status",
operator: "not in",
value: {"value14","value13"}
)*/
}
),
{}
)
),
filters: {
a!queryFilter(
field: "assignee",
operator: "is null"
)
}
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1,
sort: {
a!sortInfo(
field: "Field",
ascending: true
),
a!sortInfo(
field: Date",
ascending: true
)
}
)
)
}
).data

 

 

It is taking very high time in the Prod. Can anyone suggest me how can i optimize it so that it can take less time.

 

Thanks in Advance

  Discussion posts and replies are publicly visible

Parents
  • Hello Sahil,

    You can do it by making the database call on the Grid's saveInto so whenever user will click on the next link it will call the query entity to
    fetch the data and as you already saving the paginginfo, so it will automatically take the start index as per your requirement.

    Case:
    if your batchsize is 10 - > Your query entity rule will return only 10 records
    click on next link - > startindex will become 11, and again your db call get execute and you will get another 10 set of results.
Reply
  • Hello Sahil,

    You can do it by making the database call on the Grid's saveInto so whenever user will click on the next link it will call the query entity to
    fetch the data and as you already saving the paginginfo, so it will automatically take the start index as per your requirement.

    Case:
    if your batchsize is 10 - > Your query entity rule will return only 10 records
    click on next link - > startindex will become 11, and again your db call get execute and you will get another 10 set of results.
Children
No Data