Hi
my query is working fine for the last 9 months and now it is showing errors as below:
Expression evaluation error at function a!queryEntity: An error occurred while retrieving the data. Details: Unexpected error executing query (type: [DetailViewDT3872], query: [queryentity expression], order by: [[Sort[AccNumber asc]]], filters:[null])
I built a new constant and it still did not work.
Could you please assist why it is starting to show this error and how to fix it?
this is my query:
a!queryEntity(
entity: cons!Detail_View,
query: a!query( selection: a!querySelection( columns: {a!queryColumn(field: "AccNumber")} ),
pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 )
),
fetchTotalCount: true
).totalCount
Discussion posts and replies are publicly visible
That's probably a timeout. It seems like you just need the total count of items. Is there a specific reason why set the batch size to -1 and return a large number of rows?
Does this query hit a view? If yes, is this view performance tuned?
yes it hit a view. and it has only 94 items, a small data set. I saw the view perfectly in Database. it was working fine before.
Yeah, that's the typical problem with views. They work great for just a few rows, and break with more data.
But, 94 is not that much. How long does it take in database and how many rows are in the source tables?
the query took 13.9104 seconds in the database. It has around 7k and 50k rows in the source tables.
it seems the timeout issue, if so, and how I can change the timeout setting?
We need to optimize the query/view first of all. In case, we can't do much after the optimization, you may need to raise a support ticket to change the timeout setting(if you are on-cloud). In case you are on-premise, you can change via configuration files in the server.
Do not try to change the timeout! That will not scale and is NOT the way to go! You absolutely have to optimize the view.
And, did you consider to switch to synced records? Then you don't need that view anymore probably.