CREATE SEQUENCE was introduced in MariaDB 10.3.
A sequence is an object that generates a sequence of numeric values, as specified by the CREATE SEQUENCE statement. Sequences are an alternative to AUTO_INCREMENT when you want more control over how sequence numbers are generated.
Since a SEQUENCE caches values, it can sometimes be faster. Also, you can access the last value generated by all used sequences; it's not subjected to limitations of LAST_INSERT_ID( ).
This section is about sequence objects. For details about the storage engine, see Sequence Storage Engine.
| Title | Description |
|---|---|
| Sequence Overview | Object that generates a sequence of numeric values. |
| CREATE SEQUENCE | Creates a sequence that generates new values when called with NEXT VALUE FOR. |
| SHOW CREATE SEQUENCE | Shows the CREATE SEQUENCE statement that created the sequence. |
| ALTER SEQUENCE | Change options for a SEQUENCE. |
| DROP SEQUENCE | Deleting a SEQUENCE. |
| SEQUENCE Functions | Functions that can be used on SEQUENCEs. |
| SHOW TABLES | List of non-temporary tables, views or sequences. |
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/sequences/