Tracking Primary key integer overflow risk for `events.id`
events
is a large table with a lot of records. It's primary key is an integer-typed sequence which results in a maximum number of 2,147,483,647 records with a positive primary key in this table.
The current maximum id is 1.2B - or about 56.07% of the overall available space:
# select current_date, max(id) as current_max, ((max(id) / 2147483647.0) * 100)::integer as percentage_used from events;
current_date | current_max | percentage_used
--------------+-------------+-----------------
2020-06-02 | 776354599 | 36.??
2020-08-18 | 869560376 | 40.??
2020-09-16 | 907979515 | 42.??
2020-11-02 | 972089327 | 45.??
2020-11-11 | 985382131 | 46.??
2020-11-24 | 1003520786 | 47.??
2021-03-19 | 1167273732 | 54.36
2021-04-10 | 1204055209 | 56.07
This issue is to track the state of this, provide estimates when the overflow is expected to happen and to discuss possible solutions to it.
According to our forecast on 2021-02-22 the events
Primary Key value is to overflow between December 2021 (at a worst case scenario using an exponential forecast) and July 2022 (following a polynomial model).
Edited by Yannis Roussos