Re: Precomputed constants?

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: Böszörményi Zoltán <zboszor(at)dunaweb(dot)hu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Precomputed constants?
Date: 2006-06-14 11:07:13
Message-ID: 20060614110713.GA2277@alamut.tdm.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message hubert depesz lubaczewski 2006-06-14 11:21:25 Re: how to partition disks
Previous Message Böszörményi Zoltán 2006-06-14 10:53:54 Precomputed constants?