<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-tp-connections-table">
      </a>
      29.12.16.1 The tp_connections Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045069904720">
  </a>
  <a class="indexterm" name="idm46045069903232">
  </a>
  <p>
   The
   <code class="literal">
    tp_connections
   </code>
   table contains one row
          per connection managed by the Thread Pool plugin. Each row
          provides information about the current state of a thread pool
          connection.
  </p>
  <p>
   The
   <code class="literal">
    tp_connections
   </code>
   table contains the
          following rows:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       CONNECTION_ID
      </code>
     </p>
     <p>
      The connection ID as reported by
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      <a class="link" href="information-functions.html#function_connection-id">
       <code class="literal">
        CONNECTION_ID()
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TP_GROUP_ID
      </code>
     </p>
     <p>
      The index of the thread group in the global array. This
              column and
      <code class="literal">
       TP_PROCESSING_THREAD_NUMBER
      </code>
      serve as a foreign key into the
      <a class="link" href="performance-schema-tp-thread-state-table.html" title="29.12.16.4 The tp_thread_state Table">
       <code class="literal">
        tp_thread_state
       </code>
      </a>
      table.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TP_PROCESSING_THREAD_NUMBER
      </code>
     </p>
     <p>
      This may be NULL if no thread is currently attached to the
              connection.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       THREAD_ID
      </code>
     </p>
     <p>
      The Performance Schema thread ID.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STATE
      </code>
     </p>
     <p>
      The connection state; this is one of
      <code class="literal">
       Established
      </code>
      ,
      <code class="literal">
       Armed
      </code>
      ,
      <code class="literal">
       Queued
      </code>
      ,
      <code class="literal">
       Waiting for
              Credit
      </code>
      ,
      <code class="literal">
       Attached
      </code>
      ,
      <code class="literal">
       Expired
      </code>
      , or
      <code class="literal">
       Killed
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ACTIVE_FLAG
      </code>
     </p>
     <p>
      When this is
      <code class="literal">
       0
      </code>
      , the connection is not
              attached to any worker thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       KILLED_STATE
      </code>
     </p>
     <p>
      Reports the current stage in the process of killing the
              connection.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CLEANUP_STATE
      </code>
     </p>
     <p>
      Reports the current stage in the cleanup process when
              closing the connection.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_LAST_EVENT_COMPLETION
      </code>
     </p>
     <p>
      Timestamp showing when the connection last processed a
              request.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_EXPIRY
      </code>
     </p>
     <p>
      Timestamp showing when an idle connection will expire if
              no new request arrives before then; this is
      <code class="literal">
       NULL
      </code>
      when the thread is currently
              processing a request.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_ADD
      </code>
     </p>
     <p>
      Timestamp showing when the connection was added to the
              thread pool's connection request queue.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_POP
      </code>
     </p>
     <p>
      Timestamp showing when the connection was dequeued
              (popped) from the queue by a connection handler thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_ARM
      </code>
     </p>
     <p>
      Timestamp showing when the connection file descriptor was
              last added to the set monitored by
      <code class="literal">
       poll()
      </code>
      or
      <code class="literal">
       epoll()
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CONNECT_HANDLER_INDEX
      </code>
     </p>
     <p>
      The index of the connection handler thread in the group
              which processed the connection request; a higher number
              means the connection load has triggered the creation of
              additional connection handler threads.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TYPE
      </code>
     </p>
     <p>
      The connection type; this is one of
      <code class="literal">
       User
      </code>
      ,
      <code class="literal">
       Admin_interface
      </code>
      or
      <code class="literal">
       Admin_privilege
      </code>
      ;
      <code class="literal">
       Admin_privilege
      </code>
      means that this
              connection had been using the normal interface, but was
              placed in the
      <code class="literal">
       admin
      </code>
      group due to the
              user having the
      <a class="link" href="privileges-provided.html#priv_tp-connection-admin">
       <code class="literal">
        TP_CONNECTION_ADMIN
       </code>
      </a>
      privilege.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DIRECT_QUERY_EVENTS
      </code>
     </p>
     <p>
      The number of queries executed directly by this
              connection.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       QUEUED_QUERY_EVENTS
      </code>
     </p>
     <p>
      The number of queued queries executed by this connection.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_OF_EVENT_ARRIVAL
      </code>
     </p>
     <p>
      A timestamp showing when
      <code class="literal">
       poll_wait()
      </code>
      returns with an event for the connection; this value is
              needed to calculate
      <code class="literal">
       MANAGEMENT_TIME
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MANAGEMENT_TIME
      </code>
     </p>
     <p>
      The accumulated time between the return from waiting on
              file descriptors; this includes the time spent queued for
              queries which are not executed directly.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
