How safe would it be to use the SUBMITTEDAT field as a primary key?

The chance that two form submissions will happen in the same millisecond is very low, but when I do the math for a thousand submissions per day for a year, the chance of at least one duplicate timestamp in that timeframe looks to be nearly certain if I’m calculating the statistics correctly.

Does the system queue submissions in any fashion? Are they serialized enough for me to assume that two won’t have the same timestamp?

@tjoyce , do you have thoughts on this one?

40012i5021B8C2D573BAB6.gif

Seems scary… not sure about the queues :rofl:

It’s been a while since I took statistics, but I worked out an exponential distribution to find the odds that two form submissions would be separated by less than one millisecond, then plugged that result into a binomial distribution to get the chance of 0 failures in 365000 trials. From those numbers alone, it’s a near certainty that this is a bad approach.
I was hoping the system wasn’t perfectly multithreaded or that there was some other reason I should believe they won’t match up. It sounds like you’ve done too good of a job optimizing performance. :grinning_face_with_smiling_eyes:

For this application, I wound up using the SUBMITTEDAT and the EMAIL to drive a sufficiently differentiated key.

Thanks for the help.