TP Performance

To achieve the best GT.M performance, transactions should:

Example:

       TSTART ():SERIAL
       SET (ACCT,^M(0))=^M(0)+1
       SET ^M(ACCT)=PREC,^PN(NAM)=ACCT
       TCOMMIT
        

This transaction encapsulates these two SETs. The first increments the tally of patients registered, storing the number in local variable ACCT for faster access in the current program, and in global variable ^M(0). The second SET stores a patient record by account number and the third cross-references the account number with the patient name. Placing the SETs within a single transaction ensures that the database always receive either all of the SETs or none of them, thus protecting database integrity against process or system failure. Similarly, another concurrent process, whether using transactions or not, never finds one of the SETs in place without also finding the other one.

Example:

       TSTART ():SERIAL
       IF $TRESTART>3 DO QUIT
       .TROLLBACK
       .WRITE !,"Too many RESTARTs"
       .QUIT
       SET (NEXT,^ID(0))=^ID(0)+1
       SET ^ID(NEXT)=RECORD,^XID(ZIP,NEXT)=""
       TCOMMIT
        

This transaction will automatically restart if it cannot serialize the SETs to the database, and will terminate with a TROLLBACK if more than 3 RESTARTs occur.

GT.M provides a way to monitor transaction restarts by reporting them to the operator logging facility. If the logical name TPRESTART_SYSLOG_DELTA is defined, GT.M reports every Nth restart where N is the numeric evaluation of the value of TPRESTART_SYSLOG_DELTA. If the logical name TPRESTART_SYSLOG_LIMIT is defined, the restart reporting begins after the number of restarts specified by the value of TPRESTART_SYSLOG_LIMIT. For example, defining both the logical name to the value 1, causes all TP restarts to be logged. When TPRESTART_SYSLOG_DELTA is defined, leaving TPRESTART_SYSLOG_LIMIT undefined is equivalent to giving it the value 1.

[Note]

For more information on enhancements related to TP performance refer to the "NOISOLATION" section under VIEW command topic in the "Commands" chapter of this manual.