Manually optimizing queries
When you write queries, adhere to these guidelines
to ensure that the queries are processed as efficiently as possible.
The performance difference, for example in the speed of the Active
Event List (AEL) and desktop event lists, obtained by efficient queries
can be significant. For example, in a production system in which the
alerts.status table contains over 30,000 alerts and VARCHAR fields,
such as the Summary field, contain long strings, optimized queries
will perform better than inefficient queries.
Procedure
Use simple SQL conditions instead of regular expressions.
The following example show how a regular expression against
a VARCHAR field can be replaced by a simple SQL condition.
This example is a bad SQL condition that worsens performance.
Summary LIKE 'NETCOOL|netcool'The previous regular expression can be replaced by the following simple condition.
Summary LIKE 'NETCOOL' OR Summary LIKE 'netcool'