Quantcast
Channel: SCN : All Content - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 757

reserve_identity - returned to previous value

$
0
0

Hello!

 

We've got interesting case with reserve_identity. We created a table, which should work as ID's generator for other table, pretty much like described here: ASE Quiz Questions.

 

This is ddl for table:

create table ID_tab (

  id numeric(9,0) identity ,

  value bit DEFAULT 0 not null

)

lock datapages

with exp_row_size = 1, identity_gap = 100 on 'default'

go

 

This table is used only as ID's generator for other table, there are no other oeprations (INSERT, UPDATE) on this table.

 

This is a scenario:

1. Full dump of database - we have here identity_burn_max vaule = 1 for table ID_tab

2. We use reserve_identity [reserve_identity('ID_tab', 1)], and we get 2,3 and so on, identity_burn_max is still = 1.

3. dump tran database...

4. A new database is created and loaded from dumps from steps 1 and 3.

5. After loading database the reserve_identity functions again gives numbers starting from 2.

 

It looks like if there was full dump in step 3 the value of identity_burn_max wolud be updated and reserve_identity would give values correctly. Checkpoint does not help. It helps, when I set identity_gap = 1 for ID_tab table. Maybe insert into this table would help, but this generates additional IO (just like identity_gap = 1).

 

ASE version:

Adaptive Server Enterprise/15.0.3/EBF 16549 ESD#1/P/x86_64/Enterprise Linux/ase1503/2681/64-bit/FBO/Mon Mar  9 04:10:47 2009

 

I'm not sure if this is correct behaviour.

 

In the description for reserve_identity we can find statements: "When the process terminates, any unused values are eliminated." and "If these values are not used by the process, this results in potential gaps of up to the specified block size regardless of the identity_gap setting."

reserve_identity


Viewing all articles
Browse latest Browse all 757

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>