random() in the core functions still needs a link to that I would think.
And the way I read it this means that you don't ever (for all practical purposes) get a repeating sequence. Makes testing kind of hard unless you use the C api to see it yourself. Could random() be modified to pass in a seed? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems ________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon Davies [simon.james.dav...@gmail.com] Sent: Thursday, March 08, 2012 8:47 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Efficient random sampling in a large table using builtin functions. On 8 March 2012 14:37, Black, Michael (IS) <michael.bla...@ngc.com> wrote: > Glad to know that....could that possibly be mentioned in the random() notes > on the core functions? Thought that is (apparently) a C function and not SQL > accessible? Core SQL random() and randomblob() functions use sqlite3_randomness(), according to the page quoted. > > Michael D. Black > > Senior Scientist > > Advanced Analytics Directorate > > Advanced GEOINT Solutions Operating Unit > > Northrop Grumman Information Systems > > ________________________________ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Simon Davies [simon.james.dav...@gmail.com] > Sent: Thursday, March 08, 2012 8:33 AM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] Efficient random sampling in a large table using > builtin functions. > > On 8 March 2012 14:20, Black, Michael (IS) <michael.bla...@ngc.com> wrote: >> You don't say what language you are working in. IN C++ I would just declare >> a "set" and put random row numbers in it until I had enough. Then use that >> set to build the SQL. >> >> SQLite's random() doesn't have a seed function so you don't really get very >> random numbers from run-to-run and have no good way of controlling it that I >> can find in the docs. You want to use your language's random function if >> you want anything close to real randomness. > > http://www.sqlite.org/c3ref/randomness.html claims high-quality PRNG > >> >> Hopefully your language has a similar data structure you can use. >> >> >> Michael D. Black >> >> Senior Scientist >> >> Advanced Analytics Directorate >> >> Advanced GEOINT Solutions Operating Unit >> >> Northrop Grumman Information Systems >> > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users