<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="online-ddl-parallel-thread-configuration">
      </a>
      17.12.5 Configuring Parallel Threads for Online DDL Operations
     </h3>
    </div>
   </div>
  </div>
  <p>
   The workflow of an online DDL operation that creates or rebuilds a
      secondary index involves:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Scanning the clustered index and writing data to temporary
          sort files
     </p>
    </li>
    <li class="listitem">
     <p>
      Sorting the data
     </p>
    </li>
    <li class="listitem">
     <p>
      Loading sorted data from the temporary sort files into the
          secondary index
     </p>
    </li>
   </ul>
  </div>
  <p>
   The number of parallel threads that can be used to scan clustered
      index is defined by the
   <a class="link" href="innodb-parameters.html#sysvar_innodb_parallel_read_threads">
    <code class="literal">
     innodb_parallel_read_threads
    </code>
   </a>
   variable. The default setting is calculated by the number of
      available logical processors on the system divided by 8, with a
      minimum default value of 4. The maximum setting is 256, which is
      the maximum number for all sessions. The actual number of threads
      that scan the clustered index is the number defined by the
   <a class="link" href="innodb-parameters.html#sysvar_innodb_parallel_read_threads">
    <code class="literal">
     innodb_parallel_read_threads
    </code>
   </a>
   setting or the number of index subtrees to scan, whichever is
      smaller. If the thread limit is reached, sessions fall back to
      using a single thread.
  </p>
  <p>
   The number of parallel threads that sort and load data is
      controlled by the
   <a class="link" href="innodb-parameters.html#sysvar_innodb_ddl_threads">
    <code class="literal">
     innodb_ddl_threads
    </code>
   </a>
   variable. The
      default setting is 4.
  </p>
  <p>
   The following limitations apply:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Parallel threads are not supported for building indexes that
          include virtual columns.
     </p>
    </li>
    <li class="listitem">
     <p>
      Parallel threads are not supported for full-text index
          creation.
     </p>
    </li>
    <li class="listitem">
     <p>
      Parallel threads are not supported for spatial index creation.
     </p>
    </li>
    <li class="listitem">
     <p>
      Parallel scan is not supported on tables defined with virtual
          columns.
     </p>
    </li>
    <li class="listitem">
     <p>
      Parallel scan is not supported on tables defined with a
          full-text index.
     </p>
    </li>
    <li class="listitem">
     <p>
      Parallel scan is not supported on tables defined with a
          spatial index.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
