Database Query

We are having issues with querying data from a view in one of our datasources.  When attempting to run the queryEntity, we get the following error.

"Expression evaluation error at function a!queryEntity [line 20]: An error occurred while retrieving the data."

The server log indicates a timeout occurred, however if I run a process model with the Query Database node and a SQL statement, the node returns the correct values in considerably less time than our timeout settings.

Thoughts?

 

Bryant

+++++++++++++++ Code Snippets ++++++++++++++++++

 

Query Entity:

a!queryEntity(
  entity: cons!SMTS_EV_PROJECT_SUMMARY_DSE,
  query: a!query(
    selection: a!querySelection(
      columns: a!queryColumn(
        field: "subprojectId"
      )
    ),
    filter: a!queryFilter(
      field: "subprojectId",
      operator: "=",
      value: 30509
    ),
    pagingInfo: a!pagingInfo(1,1)
  )
)

 

SQL Statement:

select subprojectId, bac from evm.ProjectCurrentBaselineSummary where subprojectId = 30509

 

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to ChristineH
    is on the right lines IMO. To add to what she's said, try running your SQL with EXPLAIN in front of it to see what is returned. If you see any full table scans and/or large numbers of rows, you'll need to look at rewriting your view or possibly add indexes where required. FYI - if you run a simple select as you've described and it takes any more than around 0.1 seconds, your view is probably far too slow.
Children