| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="sqlite.css" rel="stylesheet"> |
| 6 |
<title>EXPLAIN</title> |
| 7 |
<!-- path= --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="index.html"> |
| 12 |
<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='about.html'>About</a> |
| 35 |
<li><a href='docs.html'>Documentation</a> |
| 36 |
<li><a href='download.html'>Download</a> |
| 37 |
<li><a href='support.html'>Support</a> |
| 38 |
<li><a href='prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<div class=fancy> |
| 119 |
<div class=nosearch> |
| 120 |
<div class="fancy_title"> |
| 121 |
EXPLAIN |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
<h1 id="syntax"><span>1. </span>Syntax</h1> |
| 129 |
<p><b><a href="syntax/sql-stmt.html">sql-stmt:</a></b></p><div class='imgcontainer'> |
| 130 |
<div style="max-width:716px"><svg xmlns='http://www.w3.org/2000/svg' class="pikchr" viewBox="0 0 716.88 1017.36"> |
| 131 |
<circle cx="5" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 132 |
<polygon points="50,55 39,59 39,50" style="fill:rgb(0,0,0)"/> |
| 133 |
<path d="M9,17 L 16,17 Q 24,17 24,32 L 24,40 Q 24,55 34,55 L 45,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 134 |
<path d="M66,70L125,70A15 15 0 0 0 140 55L140,55A15 15 0 0 0 125 39L66,39A15 15 0 0 0 50 55L50,55A15 15 0 0 0 66 70Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 135 |
<text x="95" y="55" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">EXPLAIN</text> |
| 136 |
<polygon points="176,55 165,59 165,50" style="fill:rgb(0,0,0)"/> |
| 137 |
<path d="M140,55L170,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 138 |
<path d="M191,70L235,70A15 15 0 0 0 250 55L250,55A15 15 0 0 0 235 39L191,39A15 15 0 0 0 176 55L176,55A15 15 0 0 0 191 70Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 139 |
<text x="213" y="55" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">QUERY</text> |
| 140 |
<polygon points="267,55 255,59 255,50" style="fill:rgb(0,0,0)"/> |
| 141 |
<path d="M250,55L261,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 142 |
<path d="M282,70L311,70A15 15 0 0 0 327 55L327,55A15 15 0 0 0 311 39L282,39A15 15 0 0 0 267 55L267,55A15 15 0 0 0 282 70Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 143 |
<text x="297" y="55" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">PLAN</text> |
| 144 |
<polygon points="368,17 357,21 357,12" style="fill:rgb(0,0,0)"/> |
| 145 |
<path d="M327,55 L 334,55 Q 342,55 342,40 L 342,32 Q 342,17 352,17 L 362,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 146 |
<polygon points="182,17 170,21 170,12" style="fill:rgb(0,0,0)"/> |
| 147 |
<path d="M140,55 L 148,55 Q 155,55 155,40 L 155,32 Q 155,17 166,17 L 176,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 148 |
<path d="M182,17L357,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 149 |
<path d="M9,17L170,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 150 |
<polygon points="410,17 398,21 398,12" style="fill:rgb(0,0,0)"/> |
| 151 |
<path d="M368,17L404,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 152 |
<path d="M410,32L552,32L552,2L410,2Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 153 |
<text x="481" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">alter-table-stmt</text> |
| 154 |
<polygon points="666,17 654,21 654,12" style="fill:rgb(0,0,0)"/> |
| 155 |
<path d="M552,17L660,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 156 |
<polygon points="707,17 696,21 696,12" style="fill:rgb(0,0,0)"/> |
| 157 |
<path d="M666,17L701,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 158 |
<circle cx="711" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 159 |
<path d="M410,70L528,70L528,39L410,39Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 160 |
<text x="469" y="55" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">analyze-stmt</text> |
| 161 |
<polygon points="410,55 398,59 398,50" style="fill:rgb(0,0,0)"/> |
| 162 |
<path d="M383,39 L 383,47 Q 383,55 393,55 L 404,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 163 |
<polygon points="666,55 654,59 654,50" style="fill:rgb(0,0,0)"/> |
| 164 |
<path d="M528,55L660,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 165 |
<path d="M666,55 L 673,55 Q 681,55 681,47 L 681,40" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 166 |
<path d="M410,108L517,108L517,77L410,77Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 167 |
<text x="463" y="92" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">attach-stmt</text> |
| 168 |
<polygon points="410,92 398,97 398,88" style="fill:rgb(0,0,0)"/> |
| 169 |
<path d="M383,77 L 383,85 Q 383,92 393,92 L 404,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 170 |
<polygon points="666,92 654,97 654,88" style="fill:rgb(0,0,0)"/> |
| 171 |
<path d="M517,92L660,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 172 |
<path d="M666,92 L 673,92 Q 681,92 681,85 L 681,77" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 173 |
<path d="M410,145L511,145L511,115L410,115Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 174 |
<text x="460" y="130" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">begin-stmt</text> |
| 175 |
<polygon points="410,130 398,135 398,126" style="fill:rgb(0,0,0)"/> |
| 176 |
<path d="M383,115 L 383,123 Q 383,130 393,130 L 404,130" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 177 |
<polygon points="666,130 654,135 654,126" style="fill:rgb(0,0,0)"/> |
| 178 |
<path d="M511,130L660,130" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 179 |
<path d="M666,130 L 673,130 Q 681,130 681,123 L 681,115" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 180 |
<path d="M410,183L527,183L527,153L410,153Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 181 |
<text x="468" y="168" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">commit-stmt</text> |
| 182 |
<polygon points="410,168 398,172 398,164" style="fill:rgb(0,0,0)"/> |
| 183 |
<path d="M383,153 L 383,160 Q 383,168 393,168 L 404,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 184 |
<polygon points="666,168 654,172 654,164" style="fill:rgb(0,0,0)"/> |
| 185 |
<path d="M527,168L660,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 186 |
<path d="M666,168 L 673,168 Q 681,168 681,160 L 681,153" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 187 |
<path d="M410,221L569,221L569,191L410,191Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 188 |
<text x="489" y="206" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">create-index-stmt</text> |
| 189 |
<polygon points="410,206 398,210 398,201" style="fill:rgb(0,0,0)"/> |
| 190 |
<path d="M383,191 L 383,198 Q 383,206 393,206 L 404,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 191 |
<polygon points="666,206 654,210 654,201" style="fill:rgb(0,0,0)"/> |
| 192 |
<path d="M569,206L660,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 193 |
<path d="M666,206 L 673,206 Q 681,206 681,198 L 681,191" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 194 |
<path d="M410,259L566,259L566,228L410,228Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 195 |
<text x="488" y="244" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">create-table-stmt</text> |
| 196 |
<polygon points="410,244 398,248 398,239" style="fill:rgb(0,0,0)"/> |
| 197 |
<path d="M383,228 L 383,236 Q 383,244 393,244 L 404,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 198 |
<polygon points="666,244 654,248 654,239" style="fill:rgb(0,0,0)"/> |
| 199 |
<path d="M566,244L660,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 200 |
<path d="M666,244 L 673,244 Q 681,244 681,236 L 681,229" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 201 |
<path d="M410,297L582,297L582,266L410,266Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 202 |
<text x="496" y="281" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">create-trigger-stmt</text> |
| 203 |
<polygon points="410,281 398,286 398,277" style="fill:rgb(0,0,0)"/> |
| 204 |
<path d="M383,266 L 383,274 Q 383,281 393,281 L 404,281" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 205 |
<polygon points="666,281 654,286 654,277" style="fill:rgb(0,0,0)"/> |
| 206 |
<path d="M582,281L660,281" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 207 |
<path d="M666,281 L 673,281 Q 681,281 681,274 L 681,266" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 208 |
<path d="M410,334L561,334L561,304L410,304Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 209 |
<text x="486" y="319" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">create-view-stmt</text> |
| 210 |
<polygon points="410,319 398,324 398,315" style="fill:rgb(0,0,0)"/> |
| 211 |
<path d="M383,304 L 383,312 Q 383,319 393,319 L 404,319" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 212 |
<polygon points="666,319 654,324 654,315" style="fill:rgb(0,0,0)"/> |
| 213 |
<path d="M561,319L660,319" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 214 |
<path d="M666,319 L 673,319 Q 681,319 681,312 L 681,304" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 215 |
<path d="M410,372L626,372L626,342L410,342Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 216 |
<text x="518" y="357" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">create-virtual-table-stmt</text> |
| 217 |
<polygon points="410,357 398,361 398,353" style="fill:rgb(0,0,0)"/> |
| 218 |
<path d="M383,342 L 383,349 Q 383,357 393,357 L 404,357" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 219 |
<polygon points="666,357 654,361 654,353" style="fill:rgb(0,0,0)"/> |
| 220 |
<path d="M626,357L660,357" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 221 |
<path d="M666,357 L 673,357 Q 681,357 681,349 L 681,342" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 222 |
<path d="M410,410L516,410L516,380L410,380Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 223 |
<text x="463" y="395" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">delete-stmt</text> |
| 224 |
<polygon points="410,395 398,399 398,390" style="fill:rgb(0,0,0)"/> |
| 225 |
<path d="M383,380 L 383,387 Q 383,395 393,395 L 404,395" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 226 |
<polygon points="666,395 654,399 654,390" style="fill:rgb(0,0,0)"/> |
| 227 |
<path d="M516,395L660,395" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 228 |
<path d="M666,395 L 673,395 Q 681,395 681,387 L 681,380" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 229 |
<path d="M410,448L581,448L581,417L410,417Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 230 |
<text x="495" y="433" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">delete-stmt-limited</text> |
| 231 |
<polygon points="410,433 398,437 398,428" style="fill:rgb(0,0,0)"/> |
| 232 |
<path d="M383,417 L 383,425 Q 383,433 393,433 L 404,433" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 233 |
<polygon points="666,433 654,437 654,428" style="fill:rgb(0,0,0)"/> |
| 234 |
<path d="M581,433L660,433" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 235 |
<path d="M666,433 L 673,433 Q 681,433 681,425 L 681,418" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 236 |
<path d="M410,486L521,486L521,455L410,455Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 237 |
<text x="465" y="470" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">detach-stmt</text> |
| 238 |
<polygon points="410,470 398,475 398,466" style="fill:rgb(0,0,0)"/> |
| 239 |
<path d="M383,455 L 383,463 Q 383,470 393,470 L 404,470" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 240 |
<polygon points="666,470 654,475 654,466" style="fill:rgb(0,0,0)"/> |
| 241 |
<path d="M521,470L660,470" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 242 |
<path d="M666,470 L 673,470 Q 681,470 681,463 L 681,455" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 243 |
<path d="M410,523L555,523L555,493L410,493Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 244 |
<text x="482" y="508" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">drop-index-stmt</text> |
| 245 |
<polygon points="410,508 398,513 398,504" style="fill:rgb(0,0,0)"/> |
| 246 |
<path d="M383,493 L 383,501 Q 383,508 393,508 L 404,508" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 247 |
<polygon points="666,508 654,513 654,504" style="fill:rgb(0,0,0)"/> |
| 248 |
<path d="M555,508L660,508" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 249 |
<path d="M666,508 L 673,508 Q 681,508 681,501 L 681,493" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 250 |
<path d="M410,561L551,561L551,531L410,531Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 251 |
<text x="480" y="546" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">drop-table-stmt</text> |
| 252 |
<polygon points="410,546 398,550 398,542" style="fill:rgb(0,0,0)"/> |
| 253 |
<path d="M383,531 L 383,538 Q 383,546 393,546 L 404,546" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 254 |
<polygon points="666,546 654,550 654,542" style="fill:rgb(0,0,0)"/> |
| 255 |
<path d="M551,546L660,546" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 256 |
<path d="M666,546 L 673,546 Q 681,546 681,538 L 681,531" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 257 |
<path d="M410,599L568,599L568,569L410,569Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 258 |
<text x="489" y="584" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">drop-trigger-stmt</text> |
| 259 |
<polygon points="410,584 398,588 398,579" style="fill:rgb(0,0,0)"/> |
| 260 |
<path d="M383,569 L 383,576 Q 383,584 393,584 L 404,584" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 261 |
<polygon points="666,584 654,588 654,579" style="fill:rgb(0,0,0)"/> |
| 262 |
<path d="M568,584L660,584" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 263 |
<path d="M666,584 L 673,584 Q 681,584 681,576 L 681,569" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 264 |
<path d="M410,637L547,637L547,606L410,606Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 265 |
<text x="478" y="622" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">drop-view-stmt</text> |
| 266 |
<polygon points="410,622 398,626 398,617" style="fill:rgb(0,0,0)"/> |
| 267 |
<path d="M383,606 L 383,614 Q 383,622 393,622 L 404,622" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 268 |
<polygon points="666,622 654,626 654,617" style="fill:rgb(0,0,0)"/> |
| 269 |
<path d="M547,622L660,622" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 270 |
<path d="M666,622 L 673,622 Q 681,622 681,614 L 681,607" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 271 |
<path d="M410,675L513,675L513,644L410,644Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 272 |
<text x="461" y="659" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">insert-stmt</text> |
| 273 |
<polygon points="410,659 398,664 398,655" style="fill:rgb(0,0,0)"/> |
| 274 |
<path d="M383,644 L 383,652 Q 383,659 393,659 L 404,659" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 275 |
<polygon points="666,659 654,664 654,655" style="fill:rgb(0,0,0)"/> |
| 276 |
<path d="M513,659L660,659" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 277 |
<path d="M666,659 L 673,659 Q 681,659 681,652 L 681,644" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 278 |
<path d="M410,712L529,712L529,682L410,682Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 279 |
<text x="469" y="697" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">pragma-stmt</text> |
| 280 |
<polygon points="410,697 398,702 398,693" style="fill:rgb(0,0,0)"/> |
| 281 |
<path d="M383,682 L 383,690 Q 383,697 393,697 L 404,697" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 282 |
<polygon points="666,697 654,702 654,693" style="fill:rgb(0,0,0)"/> |
| 283 |
<path d="M529,697L660,697" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 284 |
<path d="M666,697 L 673,697 Q 681,697 681,690 L 681,682" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 285 |
<path d="M410,750L528,750L528,720L410,720Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 286 |
<text x="469" y="735" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">reindex-stmt</text> |
| 287 |
<polygon points="410,735 398,739 398,731" style="fill:rgb(0,0,0)"/> |
| 288 |
<path d="M383,720 L 383,727 Q 383,735 393,735 L 404,735" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 289 |
<polygon points="666,735 654,739 654,731" style="fill:rgb(0,0,0)"/> |
| 290 |
<path d="M528,735L660,735" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 291 |
<path d="M666,735 L 673,735 Q 681,735 681,727 L 681,720" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 292 |
<path d="M410,788L526,788L526,758L410,758Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 293 |
<text x="468" y="773" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">release-stmt</text> |
| 294 |
<polygon points="410,773 398,777 398,768" style="fill:rgb(0,0,0)"/> |
| 295 |
<path d="M383,758 L 383,765 Q 383,773 393,773 L 404,773" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 296 |
<polygon points="666,773 654,777 654,768" style="fill:rgb(0,0,0)"/> |
| 297 |
<path d="M526,773L660,773" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 298 |
<path d="M666,773 L 673,773 Q 681,773 681,765 L 681,758" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 299 |
<path d="M410,826L533,826L533,795L410,795Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 300 |
<text x="471" y="811" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">rollback-stmt</text> |
| 301 |
<polygon points="410,811 398,815 398,806" style="fill:rgb(0,0,0)"/> |
| 302 |
<path d="M383,795 L 383,803 Q 383,811 393,811 L 404,811" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 303 |
<polygon points="666,811 654,815 654,806" style="fill:rgb(0,0,0)"/> |
| 304 |
<path d="M533,811L660,811" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 305 |
<path d="M666,811 L 673,811 Q 681,811 681,803 L 681,796" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 306 |
<path d="M410,864L545,864L545,833L410,833Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 307 |
<text x="477" y="848" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">savepoint-stmt</text> |
| 308 |
<polygon points="410,848 398,853 398,844" style="fill:rgb(0,0,0)"/> |
| 309 |
<path d="M383,833 L 383,841 Q 383,848 393,848 L 404,848" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 310 |
<polygon points="666,848 654,853 654,844" style="fill:rgb(0,0,0)"/> |
| 311 |
<path d="M545,848L660,848" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 312 |
<path d="M666,848 L 673,848 Q 681,848 681,841 L 681,833" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 313 |
<path d="M410,901L514,901L514,871L410,871Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 314 |
<text x="462" y="886" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">select-stmt</text> |
| 315 |
<polygon points="410,886 398,891 398,882" style="fill:rgb(0,0,0)"/> |
| 316 |
<path d="M383,871 L 383,879 Q 383,886 393,886 L 404,886" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 317 |
<polygon points="666,886 654,891 654,882" style="fill:rgb(0,0,0)"/> |
| 318 |
<path d="M514,886L660,886" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 319 |
<path d="M666,886 L 673,886 Q 681,886 681,879 L 681,871" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 320 |
<path d="M410,939L522,939L522,909L410,909Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 321 |
<text x="466" y="924" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">update-stmt</text> |
| 322 |
<polygon points="410,924 398,928 398,920" style="fill:rgb(0,0,0)"/> |
| 323 |
<path d="M383,909 L 383,916 Q 383,924 393,924 L 404,924" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 324 |
<polygon points="666,924 654,928 654,920" style="fill:rgb(0,0,0)"/> |
| 325 |
<path d="M522,924L660,924" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 326 |
<path d="M666,924 L 673,924 Q 681,924 681,916 L 681,909" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 327 |
<path d="M410,977L587,977L587,947L410,947Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 328 |
<text x="498" y="962" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">update-stmt-limited</text> |
| 329 |
<polygon points="410,962 398,966 398,957" style="fill:rgb(0,0,0)"/> |
| 330 |
<path d="M383,947 L 383,954 Q 383,962 393,962 L 404,962" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 331 |
<polygon points="666,962 654,966 654,957" style="fill:rgb(0,0,0)"/> |
| 332 |
<path d="M587,962L660,962" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 333 |
<path d="M666,962 L 673,962 Q 681,962 681,954 L 681,947" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 334 |
<path d="M410,1015L529,1015L529,984L410,984Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 335 |
<text x="469" y="1000" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">vacuum-stmt</text> |
| 336 |
<polygon points="410,1000 398,1004 398,995" style="fill:rgb(0,0,0)"/> |
| 337 |
<path d="M368,17 L 376,17 Q 383,17 383,32 L 383,985 Q 383,1000 393,1000 L 404,1000" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 338 |
<polygon points="666,1000 654,1004 654,995" style="fill:rgb(0,0,0)"/> |
| 339 |
<path d="M529,1000L660,1000" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 340 |
<path d="M666,1000 L 673,1000 Q 681,1000 681,985 L 681,32 Q 681,17 688,17 L 696,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" /> |
| 341 |
</svg> |
| 342 |
</div> |
| 343 |
</div> |
| 344 |
|
| 345 |
|
| 346 |
<h1 id="description"><span>2. </span>Description</h1> |
| 347 |
|
| 348 |
<p>An SQL statement can be preceded by the keyword "EXPLAIN" or |
| 349 |
by the phrase "EXPLAIN QUERY PLAN". Either modification causes the |
| 350 |
SQL statement to behave as a query and to return information about |
| 351 |
how the SQL statement would have operated if the EXPLAIN keyword or |
| 352 |
phrase had been omitted.</p> |
| 353 |
|
| 354 |
<p>The output from EXPLAIN and EXPLAIN QUERY PLAN is intended for |
| 355 |
interactive analysis and troubleshooting only. The details of the |
| 356 |
output format are subject to change from one release of SQLite to the next. |
| 357 |
Applications should not use EXPLAIN or EXPLAIN QUERY PLAN since |
| 358 |
their exact behavior is variable and only partially documented.</p> |
| 359 |
|
| 360 |
<p>When the EXPLAIN keyword appears by itself it causes the statement |
| 361 |
to behave as a query that returns the sequence of |
| 362 |
<a href="opcode.html">virtual machine instructions</a> it would have used to execute the command had |
| 363 |
the EXPLAIN keyword not been present. When the EXPLAIN QUERY PLAN phrase |
| 364 |
appears, the statement returns high-level information regarding the query |
| 365 |
plan that would have been used. |
| 366 |
|
| 367 |
</p><p>The EXPLAIN QUERY PLAN command is described in |
| 368 |
<a href="eqp.html">more detail here</a>. |
| 369 |
|
| 370 |
</p><h2 id="explain_operates_at_run_time_not_at_prepare_time"><span>2.1. </span>EXPLAIN operates at run-time, not at prepare-time</h2> |
| 371 |
|
| 372 |
<p>The EXPLAIN and EXPLAIN QUERY PLAN prefixes affect the behavior of |
| 373 |
running a <a href="c3ref/stmt.html">prepared statement</a> using <a href="c3ref/step.html">sqlite3_step()</a>. The process of |
| 374 |
generating a new prepared statement using <a href="c3ref/prepare.html">sqlite3_prepare()</a> or similar |
| 375 |
is (mostly) unaffected by EXPLAIN. (The exception to the previous sentence |
| 376 |
is that some special opcodes used by EXPLAIN QUERY PLAN are omitted when |
| 377 |
building an EXPLAIN QUERY PLAN prepared statement, as a performance |
| 378 |
optimization.) |
| 379 |
|
| 380 |
</p><p>This means that actions that occur during sqlite3_prepare() are |
| 381 |
unaffected by EXPLAIN. |
| 382 |
|
| 383 |
</p><ul> |
| 384 |
<li><p> |
| 385 |
Some <a href="pragma.html#syntax">PRAGMA</a> statements do their work during sqlite3_prepare() rather |
| 386 |
than during sqlite3_step(). Those PRAGMA statements are unaffected |
| 387 |
by EXPLAIN. They operate the same with or without the EXPLAIN prefix. |
| 388 |
The set of PRAGMA statements that are unaffected by EXPLAIN can vary |
| 389 |
from one release to the next. Some PRAGMA statements operate during |
| 390 |
sqlite3_prepare() depending on their arguments. For consistent |
| 391 |
results, avoid using EXPLAIN on PRAGMA statements. |
| 392 |
|
| 393 |
</p></li><li><p> |
| 394 |
The <a href="c3ref/set_authorizer.html">authorizer callback</a> is invoked regardless of the presence of |
| 395 |
EXPLAIN or EXPLAIN QUERY PLAN. |
| 396 |
</p></li></ul> |
| 397 |
<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_explain.in?m=7122ecf5f6">2022-01-08 05:02:57</a> UTC </small></i></p> |
| 398 |
|