Partitioning Rule: Origin Time Begin and Commit Times

If the time partitioning rule is used, the DSI scheduler looks at the origin begin and commit times of transactions to determine which transactions could not have been executed by the same process at the primary database.

A transaction whose origin begin time is earlier than the commit time of the preceding transaction can be processed by a different DSI executor thread.

Suppose the origin begin and commit times partitioning rule has been selected, and the transactions and processing times shown in the figure are all from the same primary database.

Transaction Origin Begin and Commit Times
Figure 4-7 illustrates the transaction origin begin and commit times partitioning rule. In this example there are four transactions given A, B, C, and D, with the processing time represented by an arrow divided into eight parts labeled as T 1 to T 8. In this example, the scheduler gives transaction A to executor thread X. The scheduler then compares the begin time of transaction B and the commit time of transaction A. As transaction A has committed before transaction B begins, the scheduler gives transaction B to executor thread X. Transaction C begins before transaction B commits, therefore, the scheduler assumes that transaction B and C were applied by different processes at the primary, and gives transaction C to executor thread Y.Transactions B and C are not allowed in the same group and may be processed by different D S I executor threads. Because transaction D begins before transaction C commits, the scheduler can safely give transaction D to executor thread X.

In this example, the DSI scheduler gives transaction A to DSI executor thread X. The scheduler then compares the begin time of transaction B and the commit time of transaction A. As transaction A has committed before transaction B begins, the scheduler gives transaction B to executor thread X. That is, transactions A and B may be grouped together and may be processed by the same DSI executor thread. Transaction C, however, begins before transaction B commits. Therefore, the scheduler assumes that transactions B and C were applied by different processes at the primary, and gives transaction C to executor thread Y. Transactions B and C are not allowed in the same group and may be processed by different DSI executor threads. Because transaction D begins before transaction C commits, the scheduler can safely give transaction D to executor thread X.

Note: Use of the origin begin and commit times partitioning rule may lead to contentions when large transactions are processed, as they are scheduled before the commits are seen.