<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-binary-log-transaction-compression-stats-table">
      </a>
      29.12.11.1 The binary_log_transaction_compression_stats Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045071630944">
  </a>
  <a class="indexterm" name="idm46045071629424">
  </a>
  <p>
   This table shows statistical information for transaction
          payloads written to the binary log and relay log, and can be
          used to calculate the effects of enabling binary log
          transaction compression. For information on binary log
          transaction compression, see
   <a class="xref" href="binary-log-transaction-compression.html" title="7.4.4.5 Binary Log Transaction Compression">
    Section 7.4.4.5, “Binary Log Transaction Compression”
   </a>
   .
  </p>
  <p>
   The
   <code class="literal">
    binary_log_transaction_compression_stats
   </code>
   table is populated only when the server instance has a binary
          log, and the system variable
   <a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
    <code class="literal">
     binlog_transaction_compression
    </code>
   </a>
   is set to
   <code class="literal">
    ON
   </code>
   . The statistics cover all
          transactions written to the binary log and relay log from the
          time the server was started or the table was truncated.
          Compressed transactions are grouped by the compression
          algorithm used, and uncompressed transactions are grouped
          together with the compression algorithm stated as
   <code class="literal">
    NONE
   </code>
   , so the compression ratio can be
          calculated.
  </p>
  <p>
   The
   <code class="literal">
    binary_log_transaction_compression_stats
   </code>
   table has these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       LOG_TYPE
      </code>
     </p>
     <p>
      Whether these transactions were written to the binary log
              or relay log.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COMPRESSION_TYPE
      </code>
     </p>
     <p>
      The compression algorithm used to compress the transaction
              payloads.
      <code class="literal">
       NONE
      </code>
      means the payloads for
              these transactions were not compressed, which is correct
              in a number of situations (see
      <a class="xref" href="binary-log-transaction-compression.html" title="7.4.4.5 Binary Log Transaction Compression">
       Section 7.4.4.5, “Binary Log Transaction Compression”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TRANSACTION_COUNTER
      </code>
     </p>
     <p>
      The number of transactions written to this log type with
              this compression type.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes that were compressed and then
              written to this log type with this compression type,
              counted after compression.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UNCOMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes before compression for this log
              type and this compression type.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COMPRESSION_PERCENTAGE
      </code>
     </p>
     <p>
      The compression ratio for this log type and this
              compression type, expressed as a percentage.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FIRST_TRANSACTION_ID
      </code>
     </p>
     <p>
      The ID of the first transaction that was written to this
              log type with this compression type.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FIRST_TRANSACTION_COMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes that were compressed and then
              written to the log for the first transaction, counted
              after compression.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FIRST_TRANSACTION_UNCOMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes before compression for the first
              transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FIRST_TRANSACTION_TIMESTAMP
      </code>
     </p>
     <p>
      The timestamp when the first transaction was written to
              the log.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_TRANSACTION_ID
      </code>
     </p>
     <p>
      The ID of the most recent transaction that was written to
              this log type with this compression type.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_TRANSACTION_COMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes that were compressed and then
              written to the log for the most recent transaction,
              counted after compression.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_TRANSACTION_UNCOMPRESSED_BYTES
      </code>
     </p>
     <p>
      The total number of bytes before compression for the most
              recent transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_TRANSACTION_TIMESTAMP
      </code>
     </p>
     <p>
      The timestamp when the most recent transaction was written
              to the log.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <code class="literal">
    binary_log_transaction_compression_stats
   </code>
   table has no indexes.
  </p>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is permitted for
          the
   <code class="literal">
    binary_log_transaction_compression_stats
   </code>
   table.
  </p>
 </div>
 <br/>
</div>
