<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-processlist-table">
      </a>
      28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045079168848">
  </a>
  <a class="indexterm" name="idm46045079167392">
  </a>
  <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Important
   </div>
   <p>
    <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
     <code class="literal">
      INFORMATION_SCHEMA.PROCESSLIST
     </code>
    </a>
    is
        deprecated and subject to removal in a future MySQL release. As
        such, the implementation of
    <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
     <code class="literal">
      SHOW
        PROCESSLIST
     </code>
    </a>
    which uses this table is also deprecated.
        It is recommended to use the Performance Schema implementation
        of
    <a class="link" href="performance-schema-processlist-table.html" title="29.12.22.7 The processlist Table">
     <code class="literal">
      PROCESSLIST
     </code>
    </a>
    instead.
   </p>
  </div>
  <p>
   The MySQL process list indicates the operations currently being
      performed by the set of threads executing within the server. The
   <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
    <code class="literal">
     PROCESSLIST
    </code>
   </a>
   table is one source of
      process information. For a comparison of this table with other
      sources, see
   <a class="xref" href="processlist-access.html#processlist-sources" title="Sources of Process Information">
    Sources of Process Information
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
    <code class="literal">
     PROCESSLIST
    </code>
   </a>
   table has these
      columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       ID
      </code>
     </p>
     <p>
      The connection identifier. This is the same value displayed in
          the
      <code class="literal">
       Id
      </code>
      column of the
      <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
       <code class="literal">
        SHOW PROCESSLIST
       </code>
      </a>
      statement,
          displayed in the
      <code class="literal">
       PROCESSLIST_ID
      </code>
      column of
          the Performance Schema
      <a class="link" href="performance-schema-threads-table.html" title="29.12.22.8 The threads Table">
       <code class="literal">
        threads
       </code>
      </a>
      table, and returned by the
      <a class="link" href="information-functions.html#function_connection-id">
       <code class="literal">
        CONNECTION_ID()
       </code>
      </a>
      function within
          the thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       USER
      </code>
     </p>
     <p>
      The MySQL user who issued the statement. A value of
      <code class="literal">
       system user
      </code>
      refers to a nonclient thread
          spawned by the server to handle tasks internally, for example,
          a delayed-row handler thread or an I/O or SQL thread used on
          replica hosts. For
      <code class="literal">
       system user
      </code>
      , there is no
          host specified in the
      <code class="literal">
       Host
      </code>
      column.
      <code class="literal">
       unauthenticated user
      </code>
      refers to a thread
          that has become associated with a client connection but for
          which authentication of the client user has not yet occurred.
      <code class="literal">
       event_scheduler
      </code>
      refers to the thread that
          monitors scheduled events (see
      <a class="xref" href="event-scheduler.html" title="27.4 Using the Event Scheduler">
       Section 27.4, “Using the Event Scheduler”
      </a>
      ).
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       A
       <code class="literal">
        USER
       </code>
       value of
       <code class="literal">
        system
            user
       </code>
       is distinct from the
       <a class="link" href="privileges-provided.html#priv_system-user">
        <code class="literal">
         SYSTEM_USER
        </code>
       </a>
       privilege. The
            former designates internal threads. The latter distinguishes
            the system user and regular user account categories (see
       <a class="xref" href="account-categories.html" title="8.2.11 Account Categories">
        Section 8.2.11, “Account Categories”
       </a>
       ).
      </p>
     </div>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       HOST
      </code>
     </p>
     <p>
      The host name of the client issuing the statement (except for
      <code class="literal">
       system user
      </code>
      , for which there is no host).
          The host name for TCP/IP connections is reported in
      <code class="literal">
       <em class="replaceable">
        <code>
         host_name
        </code>
       </em>
       :
       <em class="replaceable">
        <code>
         client_port
        </code>
       </em>
      </code>
      format to make it easier to determine which client is doing
          what.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DB
      </code>
     </p>
     <p>
      The default database for the thread, or
      <code class="literal">
       NULL
      </code>
      if none has been selected.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COMMAND
      </code>
     </p>
     <p>
      The type of command the thread is executing on behalf of the
          client, or
      <code class="literal">
       Sleep
      </code>
      if the session is idle.
          For descriptions of thread commands, see
      <a class="xref" href="thread-information.html" title="10.14 Examining Server Thread (Process) Information">
       Section 10.14, “Examining Server Thread (Process) Information”
      </a>
      . The value of this column
          corresponds to the
      <code class="literal">
       COM_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      commands
          of the client/server protocol and
      <code class="literal">
       Com_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      status
          variables. See
      <a class="xref" href="server-status-variables.html" title="7.1.10 Server Status Variables">
       Section 7.1.10, “Server Status Variables”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME
      </code>
     </p>
     <p>
      The time in seconds that the thread has been in its current
          state. For a replica SQL thread, the value is the number of
          seconds between the timestamp of the last replicated event and
          the real time of the replica host. See
      <a class="xref" href="replication-threads.html" title="19.2.3 Replication Threads">
       Section 19.2.3, “Replication Threads”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STATE
      </code>
     </p>
     <p>
      An action, event, or state that indicates what the thread is
          doing. For descriptions of
      <code class="literal">
       STATE
      </code>
      values,
          see
      <a class="xref" href="thread-information.html" title="10.14 Examining Server Thread (Process) Information">
       Section 10.14, “Examining Server Thread (Process) Information”
      </a>
      .
     </p>
     <p>
      Most states correspond to very quick operations. If a thread
          stays in a given state for many seconds, there might be a
          problem that needs to be investigated.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       INFO
      </code>
     </p>
     <p>
      The statement the thread is executing, or
      <code class="literal">
       NULL
      </code>
      if it is executing no statement. The
          statement might be the one sent to the server, or an innermost
          statement if the statement executes other statements. For
          example, if a
      <code class="literal">
       CALL
      </code>
      statement executes a
          stored procedure that is executing a
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      statement, the
      <code class="literal">
       INFO
      </code>
      value shows the
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      statement.
     </p>
    </li>
   </ul>
  </div>
  <h4>
   <a name="idm46045079111888">
   </a>
   Notes
  </h4>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
       <code class="literal">
        PROCESSLIST
       </code>
      </a>
      is a nonstandard
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      table.
     </p>
    </li>
    <li class="listitem">
     <p>
      Like the output from the
      <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
       <code class="literal">
        SHOW
          PROCESSLIST
       </code>
      </a>
      statement, the
      <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
       <code class="literal">
        PROCESSLIST
       </code>
      </a>
      table provides
          information about all threads, even those belonging to other
          users, if you have the
      <a class="link" href="privileges-provided.html#priv_process">
       <code class="literal">
        PROCESS
       </code>
      </a>
      privilege. Otherwise (without the
      <a class="link" href="privileges-provided.html#priv_process">
       <code class="literal">
        PROCESS
       </code>
      </a>
      privilege),
          nonanonymous users have access to information about their own
          threads but not threads for other users, and anonymous users
          have no access to thread information.
     </p>
    </li>
    <li class="listitem">
     <p>
      If an SQL statement refers to the
      <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
       <code class="literal">
        PROCESSLIST
       </code>
      </a>
      table, MySQL
          populates the entire table once, when statement execution
          begins, so there is read consistency during the statement.
          There is no read consistency for a multi-statement
          transaction.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The following statements are equivalent:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa55808365"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PROCESSLIST</span>

<span class="token keyword">SHOW</span> <span class="token keyword">FULL</span> <span class="token keyword">PROCESSLIST</span></code></pre>
  </div>
  <p>
   You can obtain information about use of this table by checking the
      values of the server status variables
   <a class="link" href="server-status-variables.html#statvar_Deprecated_use_i_s_processlist_count">
    <code class="literal">
     Deprecated_use_i_s_processlist_count
    </code>
   </a>
   and
   <a class="link" href="server-status-variables.html#statvar_Deprecated_use_i_s_processlist_last_timestamp">
    <code class="literal">
     Deprecated_use_i_s_processlist_last_timestamp
    </code>
   </a>
   .
   <code class="literal">
    Deprecated_use_i_s_processlist_count
   </code>
   shows the
      number of times the
   <code class="literal">
    PROCESSLIST
   </code>
   table has been
      accessed since the last server restart;
   <code class="literal">
    Deprecated_use_i_s_processlist_last_timestamp
   </code>
   provides the last time the table was accessed, as a Unix
      timestamp.
  </p>
 </div>
 <br/>
</div>
