Hi list,

I should have omitted the word "random" from the original post :) What was 
answered (but not specifically asked) is

- sqlite has a pretty good PRNG.

- yes, there is the birthday paradoxon. BTW, the calculation I wrote down in 
the other post regarding the birthday paradox was wrong. The probability of a 
conflict between two unique sets of 1000 numbers from a 64-bit-space is not 
1000 * 2**-32, but about 1000 * 1000 * 2**-64, i.e. roughly 2e-14. (As a 
comparison: the probability to have all numbers right in a 6 of 49 lottery is 
~100000 times that). To reach a probability for a conflict each set would need 
to have 2**32 numbers.  

But these were not the original questions:

> Does anyone have an idea, whether or not it is possible either
> 
> a) to adjust the id in a trigger and have the last_insert_row_id return the 
> adjusted value, or 
> b) to adjust the strategy how sqlite generates row ids for newly generated 
> records.
> 
> Any hint is greatly appreciated.

So can we please come back to that?

I will give this approach a try: I preset the sqlite_sequence entries for each 
autoincrement table on each database instance to some very large number. This 
should give each database a distinct "namespace". I see how far I can go with 
that.

thanks,
/eno

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to