Sequence Exhaustion Calculator
Says when an auto-increment key runs out, at your insert rate and growth.
Loading the tool…
How to use this tool
- Write the insert rate one setting per line: rows per day, and optionally yearly growth, current value and gap factor.
- Choose the key type the table uses today.
- Select Project the sequence.
- Compare the row for your type against the bigint row — that difference is what the migration buys you.
What sequence exhaustion calculator does
A 32-bit key holds a little over two billion values, which sounds like plenty right up until it is not. Four million rows a day gets there in about eighteen months from empty, and rather sooner if the table already has history in it. Growth makes it worse than the division suggests, because the rate compounds. And the sequence burns numbers faster than the table gains rows: a rolled-back insert keeps its number, a failed batch keeps all of them, and a cached sequence block loses whatever was left in it on restart.
Give this page the rows per day, optionally a yearly growth rate, where the sequence is now, and a gap factor to account for the numbers you burn without keeping. It walks the growth forward year by year rather than dividing, because compounding matters here, and shows how long each of the four common key widths would last along with the approximate date it runs out. If the type you selected has under ten years left it says so plainly — widening a key later means rewriting every row and every index that references it, which is much cheaper to do while the table is small.