<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="drop-index">
      </a>
      15.1.27 DROP INDEX Statement
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045183449712">
  </a>
  <a class="indexterm" name="idm46045183448640">
  </a>
  <a class="indexterm" name="idm46045183447152">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96365373"><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">DROP</span> <span class="token keyword">INDEX</span> <em class="replaceable">index_name</em> <span class="token keyword">ON</span> <em class="replaceable">tbl_name</em>
    <span class="token punctuation">[</span><em class="replaceable">algorithm_option</em> <span class="token operator">|</span> <em class="replaceable">lock_option</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<em class="replaceable">algorithm_option</em>:
    <span class="token keyword">ALGORITHM</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> {<span class="token keyword">DEFAULT</span> <span class="token operator">|</span> <span class="token keyword">INPLACE</span> <span class="token operator">|</span> <span class="token keyword">COPY</span>}

<em class="replaceable">lock_option</em>:
    <span class="token keyword">LOCK</span> <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span> {<span class="token keyword">DEFAULT</span> <span class="token operator">|</span> <span class="token keyword">NONE</span> <span class="token operator">|</span> <span class="token keyword">SHARED</span> <span class="token operator">|</span> <span class="token keyword">EXCLUSIVE</span>}</code></pre>
  </div>
  <p>
   <a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
    <code class="literal">
     DROP INDEX
    </code>
   </a>
   drops the index named
   <em class="replaceable">
    <code>
     index_name
    </code>
   </em>
   from the table
   <em class="replaceable">
    <code>
     tbl_name
    </code>
   </em>
   . This statement is mapped to
      an
   <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    <code class="literal">
     ALTER TABLE
    </code>
   </a>
   statement to drop
      the index. See
   <a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    Section 15.1.9, “ALTER TABLE Statement”
   </a>
   .
  </p>
  <p>
   To drop a primary key, the index name is always
   <code class="literal">
    PRIMARY
   </code>
   , which must be specified as a quoted
      identifier because
   <code class="literal">
    PRIMARY
   </code>
   is a reserved word:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa92942772"><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">DROP</span> <span class="token keyword">INDEX</span> <span class="token punctuation">`</span><span class="token keyword">PRIMARY</span><span class="token punctuation">`</span> <span class="token keyword">ON</span> t<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Indexes on variable-width columns of
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   tables are dropped online; that
      is, without any table copying. The table is not locked against
      access from other NDB Cluster API nodes, although it is locked
      against other operations on the
   <span class="emphasis">
    <em>
     same
    </em>
   </span>
   API node
      for the duration of the operation. This is done automatically by
      the server whenever it determines that it is possible to do so;
      you do not have to use any special SQL syntax or server options to
      cause it to happen.
  </p>
  <p>
   <code class="literal">
    ALGORITHM
   </code>
   and
   <code class="literal">
    LOCK
   </code>
   clauses
      may be given to influence the table copying method and level of
      concurrency for reading and writing the table while its indexes
      are being modified. They have the same meaning as for the
   <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    <code class="literal">
     ALTER TABLE
    </code>
   </a>
   statement. For more
      information, see
   <a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    Section 15.1.9, “ALTER TABLE Statement”
   </a>
  </p>
  <p>
   MySQL NDB Cluster supports online operations using the same
   <code class="literal">
    ALGORITHM=INPLACE
   </code>
   syntax supported in the
      standard MySQL Server. See
   <a class="xref" href="mysql-cluster-online-operations.html" title="25.6.12 Online Operations with ALTER TABLE in NDB Cluster">
    Section 25.6.12, “Online Operations with ALTER TABLE in NDB Cluster”
   </a>
   , for more
      information.
  </p>
 </div>
 <br/>
</div>
