Answer the question
In order to leave comments, you need to log in
How to quickly select random records from the database and which database is best for this?
There is a task that is very reminiscent of a casino or a game, i.e. some records in the database and you need to choose a random one from them. Of the nuances, each entry has a weight, i.e. some percentage of success.
While I think this percentage of success is to be implemented by separate additional. records.
Can already who implemented and selected for such task of a DB?
Answer the question
In order to leave comments, you need to log in
A buy rand order is always a load on any RDB, the most effective method is to transfer part of the logic from the database to the application.
A select is made max id, then in the range 1-max. program random indexes, with an overhead 3-4 times, and a request is made already with ready-made random IDs and an order by rand, the limit is as much as necessary.
Of the nuances, each entry has a weight, i.e. some percentage of success.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question