Skip to content

Comment on Twitter's UID associated to each tweet will very soon exceed 2,147,483,647

Comments

ALTER TABLE twits MODIFY COLUMN twitid BIGINT UNSIGNED NOT NULL

There, fixed, send check for $20 to donations@redcross.org

Call me back when they reach 18446744073709551615

Assuming that Rails is still interacting with the DB, and the ID in question is the primary key (ie, the 'id' on the 'twits' table) isn't quite that easy.

I had to do this a couple of years back when I realized I had a table that'd grow quickly:

http://snippets.dzone.com/posts/show/4422

Feel free to send the donation to the same place.

Is there no easier way then this? Can't believe that wasn't integrated into rails...

"Can't believe that wasn't integrated into rails..."

You just made my day. I haven't laughed so hard in ages ;)

Hmm, didn't fix my iPhone client. Try again!

That command will take several hours to complete and write lock the table.

Unless you use PostgreSQL.

But then you would have had 64 bit ID by default anyway.

Why can't you just redirect the writes to a new temporary table and join the original and temporary on reads? (I'm not a database admin)

I'm actually interested in this answer as well. I know of a company using a proprietary db and now that their growth has literally exploded, they're stuck with it.

I wonder what literally exploding growth looks like...

Nothing the fail whale can't fix ;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.