X
X
x672017-06-15 14:28:53
PostgreSQL
x67, 2017-06-15 14:28:53

What will happen to the counter?

There is one table in which one of the fields uses a sequence of type integer. According to my calculations, after about 2000 or 4000 daily cycles (only 5-10 years), the values ​​​​for the counter will end. What then needs to be done? (Provided that I have infinite server resources and the memory does not run out before)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-06-15
@x67

Use sequence of type bigserial. The maximum value for BigInteger is 9223372036854775807. At 1000 records per second, it will take you about 300 million years to exhaust the capacity of identifiers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question