Hacker News new | ask | show | jobs
by wlll 5412 days ago
Postgres has had auto-incrementing row ids for a while, see this example: https://gist.github.com/1178237
1 comments

I may be wrong, but isn't that just a syntactical shortcut for creating a separate sequence table?
Yes (that's noted in the gist). But the end result's the same, instead of writing AUTOINCREMENT you write SERIAL. That's about it, the only issue may happen if you drop the table (the sequence will not be dropped, not a huge issue in practice)
Did you notice any differences in performance?

Edit: I'm not saying there are, but it feels like there might be some repercussions when you take the underlying implementation into account. It would be interesting to know if someone conducted comparative tests about this.