Avoiding the use of the CAST function

The query Processing property setting determines how Cognos handles the query or the result set. These are the processing settings:

  • Limited Local: Cognos attempts to send the query to the database. Items that Cognos cannot send to the database are processed locally on the Cognos server.
  • Database only: Cognos sends the query to the database. For items that Cognos cannot send to the database, an error occurs.

The application data source that is defined in the metadata model is set to Limited Local to avoid the processing errors that can occur if the metadata model is set to Database Only.

For reports that have queries spanning multiple Tabular Model levels, the use of the CAST function in filters or in query items can cause Cognos to perform local processing. Local processing can split a query apart into individual queries and ‘stitch’ their results in memory.

See Good native SQL vs. bad native SQL to determine if your query is being split and stitched in memory.