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