Skip to content

Tracking Primary key integer overflow risk for `ci_builds_metadata`

ci_builds_metadata 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.07B - or about 49.67% 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_metadata;
 current_date | current_max | percentage_used
--------------+-------------+-----------------
 2020-11-02   |   733825140 |           34.??
 2021-03-19   |  1012671449 |           47.16
 2021-04-10   |  1066746248 |           49.67
 2021-07-05   |  1290001392 |              60

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.

Edited by Andreas Brandl