<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="performance-schema-system-variable-tables">
      </a>
      29.12.14 Performance Schema System Variable Tables
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="performance-schema-persisted-variables-table.html">
       29.12.14.1 Performance Schema persisted_variables Table
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="performance-schema-variables-info-table.html">
       29.12.14.2 Performance Schema variables_info Table
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <p>
   The MySQL server maintains many system variables that indicate
        how it is configured (see
   <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
    Section 7.1.8, “Server System Variables”
   </a>
   ). System variable
        information is available in these Performance Schema tables:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
       <code class="literal">
        global_variables
       </code>
      </a>
      : Global system
            variables. An application that wants only global values
            should use this table.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
       <code class="literal">
        session_variables
       </code>
      </a>
      : System
            variables for the current session. An application that wants
            all system variable values for its own session should use
            this table. It includes the session variables for its
            session, as well as the values of global variables that have
            no session counterpart.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
       <code class="literal">
        variables_by_thread
       </code>
      </a>
      : Session
            system variables for each active session. An application
            that wants to know the session variable values for specific
            sessions should use this table. It includes session
            variables only, identified by thread ID.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-persisted-variables-table.html" title="29.12.14.1 Performance Schema persisted_variables Table">
       <code class="literal">
        persisted_variables
       </code>
      </a>
      : Provides a
            SQL interface to the
      <code class="filename">
       mysqld-auto.cnf
      </code>
      file that stores persisted global system variable settings.
            See
      <a class="xref" href="performance-schema-persisted-variables-table.html" title="29.12.14.1 Performance Schema persisted_variables Table">
       Section 29.12.14.1, “Performance Schema persisted_variables Table”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-variables-info-table.html" title="29.12.14.2 Performance Schema variables_info Table">
       <code class="literal">
        variables_info
       </code>
      </a>
      : Shows, for each
            system variable, the source from which it was most recently
            set, and its range of values. See
      <a class="xref" href="performance-schema-variables-info-table.html" title="29.12.14.2 Performance Schema variables_info Table">
       Section 29.12.14.2, “Performance Schema variables_info Table”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="privileges-provided.html#priv_sensitive-variables-observer">
    <code class="literal">
     SENSITIVE_VARIABLES_OBSERVER
    </code>
   </a>
   privilege is required to view the values of sensitive system
        variables in these tables.
  </p>
  <p>
   The session variable tables
        (
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     session_variables
    </code>
   </a>
   ,
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     variables_by_thread
    </code>
   </a>
   ) contain
        information only for active sessions, not terminated sessions.
  </p>
  <p>
   The
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     global_variables
    </code>
   </a>
   and
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     session_variables
    </code>
   </a>
   tables have these
        columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       VARIABLE_NAME
      </code>
     </p>
     <p>
      The system variable name.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       VARIABLE_VALUE
      </code>
     </p>
     <p>
      The system variable value. For
      <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
       <code class="literal">
        global_variables
       </code>
      </a>
      , this column
            contains the global value. For
      <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
       <code class="literal">
        session_variables
       </code>
      </a>
      , this column
            contains the variable value in effect for the current
            session.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     global_variables
    </code>
   </a>
   and
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     session_variables
    </code>
   </a>
   tables have these
        indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Primary key on (
      <code class="literal">
       VARIABLE_NAME
      </code>
      )
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     variables_by_thread
    </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">
       THREAD_ID
      </code>
     </p>
     <p>
      The thread identifier of the session in which the system
            variable is defined.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       VARIABLE_NAME
      </code>
     </p>
     <p>
      The system variable name.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       VARIABLE_VALUE
      </code>
     </p>
     <p>
      The session variable value for the session named by the
      <code class="literal">
       THREAD_ID
      </code>
      column.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     variables_by_thread
    </code>
   </a>
   table has
        these indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Primary key on (
      <code class="literal">
       THREAD_ID
      </code>
      ,
      <code class="literal">
       VARIABLE_NAME
      </code>
      )
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
    <code class="literal">
     variables_by_thread
    </code>
   </a>
   table
        contains system variable information only about foreground
        threads. If not all threads are instrumented by the Performance
        Schema, this table misses some rows. In this case, the
   <a class="link" href="performance-schema-status-variables.html#statvar_Performance_schema_thread_instances_lost">
    <code class="literal">
     Performance_schema_thread_instances_lost
    </code>
   </a>
   status variable is greater than zero.
  </p>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is not supported
        for Performance Schema system variable tables.
  </p>
 </div>
 <br/>
</div>
