SQL Best Practices - Ok to rely on auto increment field to sort rows chronologically?

后端 未结 7 1462
面向向阳花
面向向阳花 2021-01-01 18:52

I\'m working with a client who wants to add timestamps to a bunch of tables so that they may sort the records in those tables chronologically. All of the tables also have a

7条回答
  •  青春惊慌失措
    2021-01-01 19:29

    You didnt mention if you are running on a single db or clustered. If you are clustered, be wary of increment implementations, as you are not always guaranteed things will come out in the order you would naturally think. For example, Oracle sequences can cache groups of next values (depending on your setup) and give you a 1,3,2,4,5 sort of list...

提交回复
热议问题