Re: Precomputed constants? - Mailing list pgsql-performance

From Volkan YAZICI
Subject Re: Precomputed constants?
Date
Msg-id 20060614110713.GA2277@alamut.tdm.local
Whole thread Raw
In response to Precomputed constants?  (Böszörményi Zoltán <zboszor@dunaweb.hu>)
Responses Re: Precomputed constants?  (Böszörményi Zoltán <zboszor@dunaweb.hu>)
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: Böszörményi Zoltán
Date:
Subject: Precomputed constants?
Next
From: "hubert depesz lubaczewski"
Date:
Subject: Re: how to partition disks