Skip to content

Commit

Permalink
Sequence caching and misc updates to SERIAL and CREATE/ALTER SEQUENCE…
Browse files Browse the repository at this point in the history
… pages
  • Loading branch information
ericharmeling committed Mar 31, 2021
1 parent 8b7875e commit 46d44fc
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 342 deletions.
2 changes: 1 addition & 1 deletion _includes/v21.1/misc/session-vars.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
<td>
<code>serial_normalization</code>
</td>
<td>Specifies the default handling of <code>SERIAL</code> in table definitions. Valid options include <code>'rowid'</code>, <code>'virtual_sequence'</code>, and <code>sql_sequence</code>.<br>If set to <code>'virtual_sequence'</code>, the <code>SERIAL</code> type auto-creates a sequence for <a href="https://forum.cockroachlabs.com/t/hibernate-sequence-generator-returns-negative-number-and-ignore-unique-rowid/">better compatibility with Hibernate sequences</a>.</td>
<td>Specifies the default handling of <code>SERIAL</code> in table definitions. Valid options include <code>'rowid'</code>, <code>'virtual_sequence'</code>, <code>sql_sequence</code>, and <code>sql_sequence_cache</code>.<br>If set to <code>'virtual_sequence'</code>, the <code>SERIAL</code> type auto-creates a sequence for <a href="https://forum.cockroachlabs.com/t/hibernate-sequence-generator-returns-negative-number-and-ignore-unique-rowid/">better compatibility with Hibernate sequences</a>.<br>If set to <code>sql_sequence_cache</code>, the <code>sql.defaults.serial_sequences_cache_size</code> <a href="cluster-settings.html">cluster setting</a> can be used to control the number of values to cache in a user's session, with a default of 256.</td>
<td>
<code>'rowid'</code>
</td>
Expand Down
91 changes: 44 additions & 47 deletions _includes/v21.1/sql/generated/diagrams/alter_sequence_options.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div><svg width="552" height="610">
<div><svg width="555" height="655">
<polygon points="9 17 1 13 1 21"></polygon>
<polygon points="17 17 9 13 9 21"></polygon>
<rect x="31" y="3" width="62" height="32" rx="10"></rect>
Expand All @@ -10,23 +10,22 @@
<rect x="245" y="35" width="34" height="32" rx="10"></rect>
<rect x="243" y="33" width="34" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="253" y="53">IF</text>
<rect x="299" y="35" width="68" height="32" rx="10"></rect>
<rect x="297" y="33" width="68" height="32" class="terminal" rx="10"></rect>
<rect x="299" y="35" width="70" height="32" rx="10"></rect>
<rect x="297" y="33" width="70" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="307" y="53">EXISTS</text>
<rect x="407" y="3" width="124" height="32"></rect>
<rect x="405" y="1" width="124" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="415" y="21">sequence_name</text>
<rect x="165" y="117" width="40" height="32" rx="10"></rect>
<rect x="409" y="3" width="124" height="32"></rect>
<rect x="407" y="1" width="124" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="417" y="21">sequence_name</text><rect x="165" y="117" width="40" height="32" rx="10"></rect>
<rect x="163" y="115" width="40" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="173" y="135">NO</text>
<rect x="245" y="117" width="64" height="32" rx="10"></rect>
<rect x="243" y="115" width="64" height="32" class="terminal" rx="10"></rect>
<rect x="245" y="117" width="62" height="32" rx="10"></rect>
<rect x="243" y="115" width="62" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="253" y="135">CYCLE</text>
<rect x="245" y="161" width="90" height="32" rx="10"></rect>
<rect x="243" y="159" width="90" height="32" class="terminal" rx="10"></rect>
<rect x="245" y="161" width="92" height="32" rx="10"></rect>
<rect x="243" y="159" width="92" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="253" y="179">MINVALUE</text>
<rect x="245" y="205" width="92" height="32" rx="10"></rect>
<rect x="243" y="203" width="92" height="32" class="terminal" rx="10"></rect>
<rect x="245" y="205" width="94" height="32" rx="10"></rect>
<rect x="243" y="203" width="94" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="253" y="223">MAXVALUE</text>
<rect x="165" y="249" width="72" height="32" rx="10"></rect>
<rect x="163" y="247" width="72" height="32" class="terminal" rx="10"></rect>
Expand All @@ -36,37 +35,35 @@
<text class="terminal" x="265" y="267">BY</text>
<rect x="335" y="249" width="58" height="32" rx="10"></rect>
<rect x="333" y="247" width="58" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="343" y="267">NONE</text>
<a xlink:href="sql-grammar.html#column_name" xlink:title="column_name">
<rect x="335" y="293" width="106" height="32"></rect>
<rect x="333" y="291" width="106" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="343" y="311">column_name</text>
</a>
<rect x="185" y="337" width="98" height="32" rx="10"></rect>
<rect x="183" y="335" width="98" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="355">INCREMENT</text>
<rect x="323" y="369" width="38" height="32" rx="10"></rect>
<rect x="321" y="367" width="38" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="331" y="387">BY</text>
<rect x="185" y="413" width="90" height="32" rx="10"></rect>
<rect x="183" y="411" width="90" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="431">MINVALUE</text>
<rect x="185" y="457" width="92" height="32" rx="10"></rect>
<rect x="183" y="455" width="92" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="475">MAXVALUE</text>
<rect x="185" y="501" width="62" height="32" rx="10"></rect>
<rect x="183" y="499" width="62" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="519">START</text>
<rect x="287" y="533" width="58" height="32" rx="10"></rect>
<rect x="285" y="531" width="58" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="295" y="551">WITH</text>
<rect x="421" y="337" width="64" height="32"></rect>
<rect x="419" y="335" width="64" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="429" y="355">integer</text>
<rect x="165" y="577" width="78" height="32" rx="10"></rect>
<rect x="163" y="575" width="78" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="173" y="595">VIRTUAL</text>
<path class="line" d="m17 17 h2 m0 0 h10 m62 0 h10 m0 0 h10 m92 0 h10 m20 0 h10 m0 0 h132 m-162 0 h20 m142 0 h20 m-182 0 q10 0 10 10 m162 0 q0 -10 10 -10 m-172 10 v12 m162 0 v-12 m-162 12 q0 10 10 10 m142 0 q10 0 10 -10 m-152 10 h10 m34 0 h10 m0 0 h10 m68 0 h10 m20 -32 h10 m124 0 h10 m2 0 l2 0 m2 0 l2 0 m2 0 l2 0 m-450 114 l2 0 m2 0 l2 0 m2 0 l2 0 m42 0 h10 m40 0 h10 m20 0 h10 m64 0 h10 m0 0 h28 m-132 0 h20 m112 0 h20 m-152 0 q10 0 10 10 m132 0 q0 -10 10 -10 m-142 10 v24 m132 0 v-24 m-132 24 q0 10 10 10 m112 0 q10 0 10 -10 m-122 10 h10 m90 0 h10 m0 0 h2 m-122 -10 v20 m132 0 v-20 m-132 20 v24 m132 0 v-24 m-132 24 q0 10 10 10 m112 0 q10 0 10 -10 m-122 10 h10 m92 0 h10 m20 -88 h128 m-360 0 h20 m340 0 h20 m-380 0 q10 0 10 10 m360 0 q0 -10 10 -10 m-370 10 v112 m360 0 v-112 m-360 112 q0 10 10 10 m340 0 q10 0 10 -10 m-350 10 h10 m72 0 h10 m0 0 h10 m38 0 h10 m20 0 h10 m58 0 h10 m0 0 h48 m-146 0 h20 m126 0 h20 m-166 0 q10 0 10 10 m146 0 q0 -10 10 -10 m-156 10 v24 m146 0 v-24 m-146 24 q0 10 10 10 m126 0 q10 0 10 -10 m-136 10 h10 m106 0 h10 m20 -44 h24 m-350 -10 v20 m360 0 v-20 m-360 20 v68 m360 0 v-68 m-360 68 q0 10 10 10 m340 0 q10 0 10 -10 m-330 10 h10 m98 0 h10 m20 0 h10 m0 0 h48 m-78 0 h20 m58 0 h20 m-98 0 q10 0 10 10 m78 0 q0 -10 10 -10 m-88 10 v12 m78 0 v-12 m-78 12 q0 10 10 10 m58 0 q10 0 10 -10 m-68 10 h10 m38 0 h10 m-216 -32 h20 m216 0 h20 m-256 0 q10 0 10 10 m236 0 q0 -10 10 -10 m-246 10 v56 m236 0 v-56 m-236 56 q0 10 10 10 m216 0 q10 0 10 -10 m-226 10 h10 m90 0 h10 m0 0 h106 m-226 -10 v20 m236 0 v-20 m-236 20 v24 m236 0 v-24 m-236 24 q0 10 10 10 m216 0 q10 0 10 -10 m-226 10 h10 m92 0 h10 m0 0 h104 m-226 -10 v20 m236 0 v-20 m-236 20 v24 m236 0 v-24 m-236 24 q0 10 10 10 m216 0 q10 0 10 -10 m-226 10 h10 m62 0 h10 m20 0 h10 m0 0 h68 m-98 0 h20 m78 0 h20 m-118 0 q10 0 10 10 m98 0 q0 -10 10 -10 m-108 10 v12 m98 0 v-12 m-98 12 q0 10 10 10 m78 0 q10 0 10 -10 m-88 10 h10 m58 0 h10 m20 -32 h16 m20 -164 h10 m64 0 h10 m-350 -10 v20 m360 0 v-20 m-360 20 v220 m360 0 v-220 m-360 220 q0 10 10 10 m340 0 q10 0 10 -10 m-350 10 h10 m78 0 h10 m0 0 h242 m-380 -460 l20 0 m-1 0 q-9 0 -9 -10 l0 -12 q0 -10 10 -10 m380 32 l20 0 m-20 0 q10 0 10 -10 l0 -12 q0 -10 -10 -10 m-380 0 h10 m0 0 h370 m23 32 h-3"></path>
<polygon points="543 131 551 127 551 135"></polygon>
<polygon points="543 131 535 127 535 135"></polygon>
</svg></div>
<text class="terminal" x="343" y="267">NONE</text><a xlink:href="sql-grammar.html#column_name" xlink:title="column_name">
<rect x="335" y="293" width="108" height="32"></rect>
<rect x="333" y="291" width="108" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="343" y="311">column_name</text></a><rect x="185" y="337" width="66" height="32" rx="10"></rect>
<rect x="183" y="335" width="66" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="355">CACHE</text>
<rect x="185" y="381" width="92" height="32" rx="10"></rect>
<rect x="183" y="379" width="92" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="399">MINVALUE</text>
<rect x="185" y="425" width="94" height="32" rx="10"></rect>
<rect x="183" y="423" width="94" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="443">MAXVALUE</text>
<rect x="185" y="469" width="100" height="32" rx="10"></rect>
<rect x="183" y="467" width="100" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="487">INCREMENT</text>
<rect x="325" y="501" width="38" height="32" rx="10"></rect>
<rect x="323" y="499" width="38" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="333" y="519">BY</text>
<rect x="185" y="545" width="64" height="32" rx="10"></rect>
<rect x="183" y="543" width="64" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="193" y="563">START</text>
<rect x="289" y="577" width="58" height="32" rx="10"></rect>
<rect x="287" y="575" width="58" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="297" y="595">WITH</text>
<rect x="423" y="337" width="64" height="32"></rect>
<rect x="421" y="335" width="64" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="431" y="355">integer</text><rect x="165" y="621" width="80" height="32" rx="10"></rect>
<rect x="163" y="619" width="80" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="173" y="639">VIRTUAL</text>
<path class="line" d="m17 17 h2 m0 0 h10 m62 0 h10 m0 0 h10 m92 0 h10 m20 0 h10 m0 0 h134 m-164 0 h20 m144 0 h20 m-184 0 q10 0 10 10 m164 0 q0 -10 10 -10 m-174 10 v12 m164 0 v-12 m-164 12 q0 10 10 10 m144 0 q10 0 10 -10 m-154 10 h10 m34 0 h10 m0 0 h10 m70 0 h10 m20 -32 h10 m124 0 h10 m2 0 l2 0 m2 0 l2 0 m2 0 l2 0 m-452 114 l2 0 m2 0 l2 0 m2 0 l2 0 m42 0 h10 m40 0 h10 m20 0 h10 m62 0 h10 m0 0 h32 m-134 0 h20 m114 0 h20 m-154 0 q10 0 10 10 m134 0 q0 -10 10 -10 m-144 10 v24 m134 0 v-24 m-134 24 q0 10 10 10 m114 0 q10 0 10 -10 m-124 10 h10 m92 0 h10 m0 0 h2 m-124 -10 v20 m134 0 v-20 m-134 20 v24 m134 0 v-24 m-134 24 q0 10 10 10 m114 0 q10 0 10 -10 m-124 10 h10 m94 0 h10 m20 -88 h128 m-362 0 h20 m342 0 h20 m-382 0 q10 0 10 10 m362 0 q0 -10 10 -10 m-372 10 v112 m362 0 v-112 m-362 112 q0 10 10 10 m342 0 q10 0 10 -10 m-352 10 h10 m72 0 h10 m0 0 h10 m38 0 h10 m20 0 h10 m58 0 h10 m0 0 h50 m-148 0 h20 m128 0 h20 m-168 0 q10 0 10 10 m148 0 q0 -10 10 -10 m-158 10 v24 m148 0 v-24 m-148 24 q0 10 10 10 m128 0 q10 0 10 -10 m-138 10 h10 m108 0 h10 m20 -44 h24 m-352 -10 v20 m362 0 v-20 m-362 20 v68 m362 0 v-68 m-362 68 q0 10 10 10 m342 0 q10 0 10 -10 m-332 10 h10 m66 0 h10 m0 0 h132 m-238 0 h20 m218 0 h20 m-258 0 q10 0 10 10 m238 0 q0 -10 10 -10 m-248 10 v24 m238 0 v-24 m-238 24 q0 10 10 10 m218 0 q10 0 10 -10 m-228 10 h10 m92 0 h10 m0 0 h106 m-228 -10 v20 m238 0 v-20 m-238 20 v24 m238 0 v-24 m-238 24 q0 10 10 10 m218 0 q10 0 10 -10 m-228 10 h10 m94 0 h10 m0 0 h104 m-228 -10 v20 m238 0 v-20 m-238 20 v24 m238 0 v-24 m-238 24 q0 10 10 10 m218 0 q10 0 10 -10 m-228 10 h10 m100 0 h10 m20 0 h10 m0 0 h48 m-78 0 h20 m58 0 h20 m-98 0 q10 0 10 10 m78 0 q0 -10 10 -10 m-88 10 v12 m78 0 v-12 m-78 12 q0 10 10 10 m58 0 q10 0 10 -10 m-68 10 h10 m38 0 h10 m-208 -42 v20 m238 0 v-20 m-238 20 v56 m238 0 v-56 m-238 56 q0 10 10 10 m218 0 q10 0 10 -10 m-228 10 h10 m64 0 h10 m20 0 h10 m0 0 h68 m-98 0 h20 m78 0 h20 m-118 0 q10 0 10 10 m98 0 q0 -10 10 -10 m-108 10 v12 m98 0 v-12 m-98 12 q0 10 10 10 m78 0 q10 0 10 -10 m-88 10 h10 m58 0 h10 m20 -32 h16 m20 -208 h10 m64 0 h10 m-352 -10 v20 m362 0 v-20 m-362 20 v264 m362 0 v-264 m-362 264 q0 10 10 10 m342 0 q10 0 10 -10 m-352 10 h10 m80 0 h10 m0 0 h242 m-382 -504 l20 0 m-1 0 q-9 0 -9 -10 l0 -12 q0 -10 10 -10 m382 32 l20 0 m-20 0 q10 0 10 -10 l0 -12 q0 -10 -10 -10 m-382 0 h10 m0 0 h372 m23 32 h-3"></path>
<polygon points="545 131 553 127 553 135"></polygon>
<polygon points="545 131 537 127 537 135"></polygon></svg></div>
Loading

0 comments on commit 46d44fc

Please sign in to comment.