Skip to content

Tracking Primary key integer overflow risk for `ci_builds.id`

ci_builds is a large table with a lot of records. It's primary key is an integer-typed sequence with 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.16B - or about 54.42% of the overall available space:

# select current_date, max(id) as current_max, ((max(id) / 2147483647.0) * 100)::integer as percentage_used from ci_builds;
 current_date | current_max | percentage_used
--------------+-------------+-----------------
 2020-04-20   |   518275469 |           24.??
 2020-11-02   |   825419904 |           38.??
 2021-03-19   |  1112969471 |           51.83
 2021-04-10   |  1168669119 |           54.42

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 ci_builds Primary Key value is expected to overflow between September 2021 (at a worst case scenario using an exponential forecast) and May 2022 (following a polynomial model).

image

Edited by Yannis Roussos