Message sizes

A Replication Server distributes database modifications using messages in ASCII format. Most replication system messages correspond to the delete, insert, update, and function execution operations.

Each table has one message size for inserts or deletes and another for updates. Each function has its own message size. Message sizes are expressed in bytes.

Message sizes for the same type of modification (insert, delete, or update) may vary depending on whether the message is in the inbound or outbound queue.

You can calculate message sizes in bytes for table updates, inserts, and deletes, for functions, and for begin/commit pairs using the formulas presented below. See “Formula components” for a description of the components.

Table updates

This formula will give you a rough estimate of the upper limit of message size:

InboundMsgSizeupdate = InboundMsgOverhead +
  ColOverhead + (RowWidth*2)
OutboundMsgSizeupdate = OutboundMsgOverhead +
  (RowWidth*2) + (NumSites*8)

To get a more precise estimate, use the RowWidthChanged figure in the calculation, as follows:

InboundMsgSizeupdate = InboundMsgOverhead +
  ColOverhead + RowWidth + RowWidthChanged
OutboundMsgSizeupdate = OutboundMsgOverhead +
  RowWidth + RowWidthChanged + (NumSites*8)

If you use the minimal columns feature, use this formula to calculate message size:

InboundMsgSizeupdate = InboundMsgOverhead +
  ColOverhead + (RowWidthChanged*2) +
  PrimaryKeyWidth
OutboundMsgSizeupdate = OutboundMsgOverhead +
  (RowWidthChanged*2) + PrimaryKeyWidth +
  (NumSites*8)

See “Table update calculations” for examples of these calculations.

Table inserts

Use the following formula to calculate message size for table inserts. (This formula also applies if you use the minimal columns feature.)

InboundMsgSizeinsert = InboundMsgOverhead +
  ColOverhead + RowWidth
OutboundMsgSizeinsert = OutboundMsgOverhead +
  RowWidth + (NumSites*8)

Table deletes

If you do not use minimal columns, use this formula to calculate message size in table deletes:

InboundMsgSizeinsert = InboundMsgOverhead +
  ColOverhead + RowWidth
OutboundMsgSizeinsert = OutboundMsgOverhead +
  RowWidth + (NumSites*8)

If you use minimal columns, use this formula to calculate table deletes:

InboundMsgSizedelete = InboundMsgOverhead +
  ColOverhead + PrimaryKeyWidth
OutboundMsgSizedelete = OutboundMsgOverhead +
  PrimaryKeyWidth + (NumSites*8)

Functions

Use these formulas to calculate message size for functions:

InboundMsgSizefunction = InboundMsgOverhead +
  ParameterWidth +(RowWidth*2)
OutboundMsgSizefunction = OutboundMsgOverhead +
  ParameterWidth + (NumSites*8)

In the formula for inbound message size, RowWidth does not apply to the replicated functions feature because before and after images of replicated functions are not sent to the inbound queue.

Begin and commit pairs

Use these formulas to calculate message sizes for begins and commits:

InboundMsgSizebegin = OutboundMsgSizebegin = 250
InboundMsgSizecommit = OutboundMsgSizecommit = 200

The total size of a begin/commit pair is 450 bytes. If typical transactions have many modifications, omit the begin or commit message sizes from your calculations. Their contribution to overall message size is negligible.

Formula components

In the preceding formulas: