how to make selecting random rows in oracle faster with table with millions of rows

前端 未结 7 1129
后悔当初
后悔当初 2021-02-13 11:25

Is there a way to make selecting random rows faster in oracle with a table that has million of rows. I tried to use sample(x) and dbms_random.value and its taking a long time to

7条回答
  •  后悔当初
    2021-02-13 12:04

    Can you use pseudorandom rows?

    select * from (
      select * from ... where... order by ora_hash(rowid)
    ) where rownum<100
    

提交回复
热议问题