1

I need to insert a lot of events into DB in ordered way by event time (each event has a time in millisec) to prevent sorting when retrieving data. Events comes in unordered order. i mean event with time 10000 can come before event with time 900 and there could be several events with the same time.

My idea was to create event ID as concatination of eventTime(length 13) + generated id from sequance(length 5). but in that way there can be duplication of id in the case when sequence will turn around for event with time which already come before.

Could you please advice how it can be solved?

Michal K
  • 226
  • 1
  • 3

0 Answers0