Processing information through search arguments

You must correctly use search arguments when specifying parameters to monitoring tables, or the efficiency of your query deteriorates. If the search condition for your query is not precisely defined on one or more parameters of the monitoring tables, information is collected for the entire result set, which must then be filtered by the Adaptive Server language layer. The following example correctly specifies the search arguments, where DBID = 1:

select * from monOpenObjectActivity
where DBID = 1

Adaptive Server uses certain search arguments (identified in monTableParameters) to filter the result set and reduce the amount of work it performs to produce the result set. These parameters are used only when you specify an exactly matching search argument; for example, when a = 2.

But if the search conditions of the query are more loosely specified, for example if DBID < 2 the DBID parameter cannot be used internally, and a result set containing a row for every object in every database is produced. Also, Adaptive Server’s language layer must filter the result set to simply return a row for each object in the master database. This adversely affects your performance.

Query the monTableParameters to determine which arguments should be specified to improve query performance. For example, the following query shows which search arguments should be specified for the monOpenObjectActivity table:

select ParameterName, TypeName
from monTableParameters
where TableName = 'monOpenObjectActivity'
ParameterName      TypeName
-----------------  ------------
DBID               int
ObjectID           int
IndexID		              int