We are attempting to pull a semi-random row from Oracle.
We are using this approach:
SELECT PERSON_ID FROM ENCOUNTER SAMPLE(0.0001) WHERE EXTRACT(YEAR FROM REG_DT_TM) = 2020 AND ROWNUM = 1
This approach appears to be giving us just one random result each time we run it.
However, according to answers to this question, this approach gives results from the beginning of the table far more commonly.
If that statement is true then how much more commonly are values taken from the top of the table? Our table has tens of millions of rows. Is there a simple heuristic or a rough estimate for the distribution we can expect?
Aucun commentaire:
Enregistrer un commentaire