1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
<!DOCTYPE html>
<html><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="sqlite.css" rel="stylesheet">
<title>REINDEX</title>
<!-- path= -->
</head>
<body>
<div class=nosearch>
<a href="index.html">
<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite" border="0">
</a>
<div><!-- IE hack to prevent disappearing logo --></div>
<div class="tagline desktoponly">
Small. Fast. Reliable.<br>Choose any three.
</div>
<div class="menu mainmenu">
<ul>
<li><a href="index.html">Home</a>
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a>
<li class='wideonly'><a href='about.html'>About</a>
<li class='desktoponly'><a href="docs.html">Documentation</a>
<li class='desktoponly'><a href="download.html">Download</a>
<li class='wideonly'><a href='copyright.html'>License</a>
<li class='desktoponly'><a href="support.html">Support</a>
<li class='desktoponly'><a href="prosupport.html">Purchase</a>
<li class='search' id='search_menubutton'>
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a>
</ul>
</div>
<div class="menu submenu" id="submenu">
<ul>
<li><a href='about.html'>About</a>
<li><a href='docs.html'>Documentation</a>
<li><a href='download.html'>Download</a>
<li><a href='support.html'>Support</a>
<li><a href='prosupport.html'>Purchase</a>
</ul>
</div>
<div class="searchmenu" id="searchmenu">
<form method="GET" action="search">
<select name="s" id="searchtype">
<option value="d">Search Documentation</option>
<option value="c">Search Changelog</option>
</select>
<input type="text" name="q" id="searchbox" value="">
<input type="submit" value="Go">
</form>
</div>
</div>
<script>
function toggle_div(nm) {
var w = document.getElementById(nm);
if( w.style.display=="block" ){
w.style.display = "none";
}else{
w.style.display = "block";
}
}
function toggle_search() {
var w = document.getElementById("searchmenu");
if( w.style.display=="block" ){
w.style.display = "none";
} else {
w.style.display = "block";
setTimeout(function(){
document.getElementById("searchbox").focus()
}, 30);
}
}
function div_off(nm){document.getElementById(nm).style.display="none";}
window.onbeforeunload = function(e){div_off("submenu");}
/* Disable the Search feature if we are not operating from CGI, since */
/* Search is accomplished using CGI and will not work without it. */
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){
document.getElementById("search_menubutton").style.display = "none";
}
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */
function hideorshow(btn,obj){
var x = document.getElementById(obj);
var b = document.getElementById(btn);
if( x.style.display!='none' ){
x.style.display = 'none';
b.innerHTML='show';
}else{
x.style.display = '';
b.innerHTML='hide';
}
return false;
}
var antiRobot = 0;
function antiRobotGo(){
if( antiRobot!=3 ) return;
antiRobot = 7;
var j = document.getElementById("mtimelink");
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
}
function antiRobotDefense(){
document.body.onmousedown=function(){
antiRobot |= 2;
antiRobotGo();
document.body.onmousedown=null;
}
document.body.onmousemove=function(){
antiRobot |= 2;
antiRobotGo();
document.body.onmousemove=null;
}
setTimeout(function(){
antiRobot |= 1;
antiRobotGo();
}, 100)
antiRobotGo();
}
antiRobotDefense();
</script>
<div class=fancy>
<div class=nosearch>
<div class="fancy_title">
REINDEX
</div>
</div>
<p><b><a href="syntax/reindex-stmt.html">reindex-stmt:</a></b>
<button id='x2cf9baca' onclick='hideorshow("x2cf9baca","xb94d42e4")'>hide</button></p>
<div id='xb94d42e4' class='imgcontainer'>
<div style="max-width:619px"><svg xmlns='http://www.w3.org/2000/svg' class="pikchr" viewBox="0 0 619.286 137.376">
<circle cx="5" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="32,17 20,21 20,12" style="fill:rgb(0,0,0)"/>
<path d="M9,17L26,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M47,32L111,32A15 15 0 0 0 126 17A15 15 0 0 0 111 2L47,2A15 15 0 0 0 32 17A15 15 0 0 0 47 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="79" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">REINDEX</text>
<polygon points="167,82 156,86 156,77" style="fill:rgb(0,0,0)"/>
<path d="M126,17 L 133,17 Q 141,17 141,32 L 141,67 Q 141,82 151,82 L 162,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M182,97L279,97A15 15 0 0 0 294 82A15 15 0 0 0 279 67L182,67A15 15 0 0 0 167 82A15 15 0 0 0 182 97Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="231" y="82" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">schema-name</text>
<polygon points="317,82 305,86 305,77" style="fill:rgb(0,0,0)"/>
<path d="M294,82L311,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M332,97A15 15 0 0 0 347 82A15 15 0 0 0 332 67A15 15 0 0 0 317 82A15 15 0 0 0 332 97Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="332" y="82" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">.</text>
<polygon points="383,82 372,86 372,77" style="fill:rgb(0,0,0)"/>
<path d="M347,82L377,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="425,120 413,124 413,115" style="fill:rgb(0,0,0)"/>
<path d="M383,82 L 391,82 Q 398,82 398,97 L 398,105 Q 398,120 409,120 L 419,120" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M440,135L518,135A15 15 0 0 0 533 120A15 15 0 0 0 518 104L440,104A15 15 0 0 0 425 120A15 15 0 0 0 440 135Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="479" y="120" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">index-name</text>
<polygon points="568,120 556,124 556,115" style="fill:rgb(0,0,0)"/>
<path d="M533,120L562,120" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="609,17 598,21 598,12" style="fill:rgb(0,0,0)"/>
<path d="M568,120 L 575,120 Q 583,120 583,105 L 583,32 Q 583,17 593,17 L 604,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<circle cx="613" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="425,82 413,86 413,77" style="fill:rgb(0,0,0)"/>
<path d="M383,82L419,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M440,97L515,97A15 15 0 0 0 530 82A15 15 0 0 0 515 67L440,67A15 15 0 0 0 425 82A15 15 0 0 0 440 97Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="477" y="82" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">table-name</text>
<polygon points="568,82 556,86 556,77" style="fill:rgb(0,0,0)"/>
<path d="M530,82L562,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M568,82 L 575,82 Q 583,82 583,74 L 583,67" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="383,17 372,21 372,12" style="fill:rgb(0,0,0)"/>
<path d="M126,17L377,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M383,17L598,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="167,44 156,48 156,40" style="fill:rgb(0,0,0)"/>
<path d="M126,17 L 133,17 Q 141,17 141,30 Q 141,44 151,44 L 162,44" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M182,59L288,59A15 15 0 0 0 303 44L303,44A15 15 0 0 0 288 29L182,29A15 15 0 0 0 167 44L167,44A15 15 0 0 0 182 59Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="235" y="44" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">collation-name</text>
<polygon points="568,44 556,48 556,40" style="fill:rgb(0,0,0)"/>
<path d="M303,44L562,44" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M568,44 L 575,44 Q 583,44 583,36 L 583,29" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<polygon points="231,120 219,124 219,115" style="fill:rgb(0,0,0)"/>
<path d="M141,67 L 141,105 Q 141,120 156,120 L 210,120 L 225,120" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<path d="M231,120 L 347,120 Q 362,120 362,105 L 362,97 Q 362,82 370,82 L 377,82" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
</svg>
</div>
</div>
<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, or
when there are <a href="expridx.html">indexes on expressions</a> involving a function whose definition
has changed.
</p>
<p>If the REINDEX keyword is not followed by a collation-sequence or database
object identifier, then all indices in all attached databases are rebuilt.
</p><p>If the REINDEX keyword is followed by a collation-sequence name, then
all indices in all attached databases that use the named collation sequences
are recreated.
</p><p>Or, if the argument attached to the REINDEX identifies a specific
database table, then all indices attached to the database table are rebuilt.
If it identifies a specific database index, then just that index is recreated.
</p><p>For a command of the form "REINDEX <i>name</i>", a match
against <span class='yyterm'>collation-name</span> takes precedence over a match
against <span class='yyterm'>index-name</span> or <span class='yyterm'>table-name</span>.
This ambiguity in the syntax may be avoided by always specifying a
<span class='yyterm'>schema-name</span> when reindexing a specific table or index.
</p><p align="center"><small><i>This page last modified on <a href="https://sqlite.org/docsrc/honeypot" id="mtimelink" data-href="https://sqlite.org/docsrc/finfo/pages/lang_reindex.in?m=a26831b152">2022-01-08 05:02:57</a> UTC </small></i></p>
|