Re: Precomputed constants?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux