Hilo in c # console application with nhibernate

Having a console application that many will start over and over again using hilo. Every time the application is started and the sessionfactory is rebuilt, the hilo (next_hi) columns will grow and the id space reserved will be lost.

Does anyone have any experience with this?

Can't be a nice feature for a hilo generator of choice remember high and low values ​​for applications that are often closed by many users? I mean, he already reserved the identity space, which is often not fully utilized in this environment.

Thanks for sharing your experience in advance!

+2


source to share


1 answer


The maximum Int64 value is 9223372036854775807. Suppose each application starts inserting one record and losing 99 identifiers. that means you have 9223372036854775807/100 = 92233720368547758 effective IDs.

Let's say your applications are inserting 50,000 records per second into the database.



92233720368547758/50000 = 184467440737095.51614 seconds = 2135039823.346012918287037037037 days = 5930666 years.

Are you still worried?

+8


source







All Articles