On Jun 14 12:53, Böszörményi Zoltán wrote: > # explain analyze select * from mxstrpartsbg where szam = > round(800000*random())::integer; AFAIK, you can use sth like that: SELECT * FROM mxstrpartsbg WHERE szam = (SELECT round(800000*random())::integer OFFSET 0); This will prevent calculation of round() for every row. Regards.