Advanced Int - Bigint Conversions
summary
Claims an actual near-miss outage at a unicorn and gives concrete fixes: a cheap pg_stats histogram query to find columns approaching 2,147,483,647, an emergency flip sequence to negative to buy billions of IDs, and migration patterns that use views+triggers with transactional DDL or a separate future table/backfill. Notes pitfalls — unsigned ints in apps, stale ANALYZE, indexing gaps — and offers a default-function trick to sample bigints for safe rollout.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:09Ground Rules
- 3:36Goldilocks and the Three Data Types
- 10:22Artificial Escalation
- 18:36Integer Arrays
- 18:53Json Columns
- 24:07Examples
- 33:31Data Types
related talks
25mAdvanced INT to BIGINT Conversions
19mNO ARRAY OF SUNSHINE: an introduction to data types from a data quality perspective
46mDon't do that!
19mLet me show you why data types still matter
28mMySQL Schema Review
24mFun With UUIDs
31mBiggish Data With Rails and Postgresql
53mSQL Server Internals: The Practical Angle
