Analyzing the phenomenon of sequence sequence of Oracle ____oracle

Source: Internet
Author: User

Since doing Jforum project, there is a very obvious phenomenon, that is, the primary key of each table appears the phenomenon of jumping number. The specific performance: when a number of pieces of data, the automatic growth of the sequence sequence is always increased from a multiple of 200, after this operation, no matter what the currentval is, the interval, always from the next 200 multiples start. For example: The current value of a table is 800, adding 3 records, when Currentval should be 803. But after a period of time, when you insert the data again, it starts at 1000.

This phenomenon is certainly not in the eyes of most people, but I am here is a new thing, never met. Asked two of the veteran, they are not familiar with, but a little bit of impression, as if encountered a similar situation. Although there is no solution, but I know where to start, it must be a property of sequence caused. Sure enough, when I open jforum_topics_seq with pl/sql developer, I see:

The cache value is in line with 200, which is understood by name: caching is the mechanism that is set up to improve the speed and efficiency of the system. Then it is not possible to guess, if the cache is not finished, then it will be discarded, this is probably a cache of some side effects.

Find information from the Internet, found that a lot of instructions are in the article, here only to do a simple description of the good.

1, the cache can be predefined or default, and the default cache size is 20.

2, the cache should be based on the size of the system data, such as the Jforum forum system after the transformation, the same period of increase in the amount of data is not much, then set to 200 it seems to be more wasteful.

3, do not set the cache will bring great inconvenience to the system, so when the amount of small data, it may be possible to use the default cache value of 20.

4, although the use of the cache will be a primary key discontinuity, jump number phenomenon, but the sequence can still guarantee the uniqueness of the value.

About cache performance test, can refer to Netizen's post: Oracle Sequence cache parameter Description

This article is referenced from: http://blog.csdn.net/xinfei0803

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.