-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SERIAL type #362
SERIAL type #362
Conversation
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. serial.md, line 10 [r1] (raw file):
The name(s) for this feature across all databases I'm aware of have caused no end of grief between DBA's and developers. The only thing this type of column can guarantee is uniqueness. (and even that can be called into question if you're allowed to insert your own values.) There can be gaps as values are consumed even if the transaction is rolled back (as the example shows). Are the values strictly increasing based on transaction time? In the case of Oracle, sequence values can appear out of transaction order due to multi instances and caching. Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 7 unresolved discussions. serial.md, line 46 [r1] (raw file):
"without column serial.md, line 59 [r1] (raw file):
Not sure we want to call this out in the docs. If you're using a SERIAL column, it's generally because you're not manually specifying the ids. Same for "## Format" above serial.md, line 73 [r1] (raw file):
Did we cut the out of order example? serial.md, line 75 [r1] (raw file):
"Some people" feels accusatory. How about "A common misconception" serial.md, line 75 [r1] (raw file):
There are other reasons this is a bad idea besides the "accurate count of rows" example. Maybe delete the example or make it clear it's one of many ways this assumption can bite you serial.md, line 77 [r1] (raw file):
This reads a lot clearer if you're actually using Postgres. Are we intentionally avoiding that? Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 7 unresolved discussions. serial.md, line 10 [r1] (raw file):
|
|
Review status: 0 of 3 files reviewed at latest revision, 8 unresolved discussions. serial.md, line 73 [r1] (raw file):
|
"Guaranteed to be globally unique" is a stronger claim than I'm comfortable making for a 64-bit integer generated in a decentralized way. IMHO we're providing this type for compatibility with existing systems and the fact that people are really attracted to integers as IDs, but if you want a guarantee of global uniqueness you should be using a UUID in a BYTES field instead. |
Chatted with @bdarnell. He was thinking that
|
Adding docs for the new
SERIAL
type. Fixes #356.HTML version: http://cockroach-draft-docs.s3-website-us-east-1.amazonaws.com/serial.html
@paperstreet, @petermattis, not sure if the last example is clear enough.
This change is