<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<title>REINDEX</title>
<link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
</head>
<body>
<div id="header">
<table width="100%" id="topTable">
<tr id="headerTableRow1">
<td align="left">
<span id="runningHeaderText">REINDEX</span> </td>
</tr>
<tr id="headerTableRow2">
<td align="left">
<span id="nsrTitle">SQLite Language Reference Documentation</span>
</td>
</tr>
<tr id="headerTableRow3" style="display:none">
<td>
<a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
<a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
</td>
</tr>
</table>
<table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
<tr>
<td>
<span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
<img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
<label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
Collapse All
</label>
<label id="expandAllLabel" for="toggleAllImage" style="display: none;">
Expand All
</label>
</span>
</td>
</tr>
</table>
</div>
<div id="mainSection">
<div id="mainBody">
<h1 class="heading">
SQL As Understood By SQLite</h1>
<h4>
REINDEX</h4>
<p>
<table cellpadding="10">
<tr>
<td align="right" width="1%" nowrap>
<i><font color="#ff3434">sql-statement</font></i> ::=</td>
<td>
<b><font color="#2c2cf0">REINDEX </font></b><i><font color="#ff3434">collation
name</font></i><b><font
color="#2c2cf0"></font></b></td>
</tr>
</table>
<table cellpadding="10">
<tr>
<td align="right" width="1%" nowrap>
<i><font color="#ff3434">sql-statement</font></i> ::=</td>
<td>
<b><font color="#2c2cf0">REINDEX </font></b>[<b><font color="#2c2cf0"></font></b><i><font
color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
color="#2c2cf0"> </font></b><i><font color="#ff3434">table/index-name</font></i><b><font
color="#2c2cf0"></font></b></td>
</tr>
</table>
</p>
<p>
The REINDEX command is used to delete and recreate indices from scratch. This is
useful when the definition of a collation sequence has changed.
</p>
<p>
In the first form, all indices in all attached databases that use the named collation
sequence are recreated. In the second form, if <i>[database-name.]table/index-name</i>
identifies a table, then all indices associated with the table are rebuilt. If an
index is identified, then only this specific index is deleted and recreated.
</p>
<p>
If no <i>database-name</i> is specified and there exists both a table or index and
a collation sequence of the specified name, then indices associated with the collation
sequence only are reconstructed. This ambiguity may be dispelled by always specifying
a <i>database-name</i> when reindexing a specific table or index.
</p>
<p>
<hr>
</p>
<div id="footer">
<p>
</p>
<p>
</p>
</div>
</div>
</div>
</body>
</html>