In-memory evaluation of row filters

Starting in release 10.2.1, Q Capture is able to evaluate simple filters for search conditions or log record variables in-memory, rather than through the database engine. Traditionally, evaluation through the database engine can incur a higher cost for high volume workloads. Evaluating in-memory allows both CPU savings and reduced contention with the DBMS, and also reduces the potential for a bottleneck to arise when publishing changes.

Both search conditions and change conditions are eligible to be evaluated in-memory. The following operators are supported:

The following SQL data types are implemented:
  • INTEGER, SMALLINT, BIGINT
  • CHAR, VARCHAR
  • TIMESTAMP
The following variables are supported (see Log record variables to filter rows (unidirectional replication)):
  • $OPERATION
  • $AUTHID
  • $AUTHTOKEN (DB2® z/OS®)
  • $PLANNAME (DB2 for z/OS)
  • $PARTITION (DB2 for z/OS)
  • $APPL_ID (DB2 for Linux, UNIX, and Windows)
  • $APPL_NAME (DB2 for Linux, UNIX, and Windows)

If a syntax error is detected, ASN7295W is issued when the expression is parsed by Q Capture. Some expressions that are provided might be too complex for the in-memory evaluator to parse (for example, expressions that contain a subselect). In this case, the engine falls back to evaluating through the database. This error is indicated with the ASN7296I message.

You can also specify to run all filters through the database by running Q Capture with the parameter IN_MEM_FILTER_EVAL=N (the default is Y).

Table 1 provides examples of filters that can be evaluated in memory.

Table 1. Examples of filters that are eligible for in-memory evaluation
IBMQREP_SUBS.SEARCH_CONDITION IBMQREP_SUBS.CHANGE_CONDITION Resulting expression that is evaluated in-memory by Q Capture
:FIRSTNAME IN (‘JANE’, ‘BOB’) NULL WHERE :USERNAME IN ('JANE', 'BOB')
NULL TRIM($PLANNAME) <> ‘ASNQAPP’ WHERE TRIM($PLANNAME) <> ‘ASNQAPP’
NULL $PLANNAME IN (‘A’, ‘B’, ‘C’) WHERE $PLANNAME IN (‘A’, ‘B’, ‘C’)
NULL ($AUTHID <> ‘JONO’ OR $PLANNAME LIKE ‘ASN%’) AND $OPERATION = ‘I’ WHERE ($AUTHID <> ‘JONO’ OR $PLANNAME LIKE ‘ASN%’) AND $OPERATION = ‘I’
:STATE LIKE ‘CA%’ NULL WHERE :STATE LIKE ‘CA%’
:FIRSTNAME IN (‘JANE’, ‘BOB’) $AUTHID = ‘DBUSER1’ WHERE (:FIRSTNAME IN (‘JANE’, ‘BLOB’)) AND ($AUTHID = ‘DBUSER1’)