Home > Database > Mysql Tutorial > body text

Oracle DB 序列

WBOY
Release: 2016-06-07 17:32:36
Original
1120 people have browsed it

可以将序列高速缓存在内存中,以便于更快地对这些值进行访问。当首次引用序列时,序列值会被填充到高速缓存中。因此会从高速缓存

CYCLE | NOCYCLE :指定在达到最大值或最小值之后,序列是否继续生成值(NOCYCLE是默认选项)

CACHE n | NOCACHE :指定Oracle Server 预先分配并保留在内存中的值的数量(默认情况下,Oracle Server 会高速缓存20 个值)

示例中创建了一个名为DEPT_DEPTID_SEQ的序列,用作DEPARTMENTS 表的DEPARTMENT_ID 列。该序列从120 开始,,不允许高速缓存,也不进行循环。

请勿在序列用于生成主键值时使用CYCLE选项,除非有一个可靠的机制与序列循环相比可以更快地清除旧行。

注:序列与表没有关系。通常,应按序列的预期用途来命名序列。但是,序列可以在任何地方使用,而与其名称无关。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!