pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttnet.net.tr>
To: Böszörményi Zoltán <zboszor@dunaweb.hu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Precomputed constants?
Date: Wed, 14 Jun 2006 14:07:13 +0300
Message-ID: <20060614110713.GA2277@alamut.tdm.local> (raw)
In-Reply-To: <3167.213.163.11.81.1150282434.squirrel@www.dunaweb.hu>
References: <3167.213.163.11.81.1150282434.squirrel@www.dunaweb.hu>

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.



view thread (8+ messages)  latest in thread

Message-ID: <20060614110713.GA2277@alamut.tdm.local>
Permalink:  ../20060614110713.GA2277@alamut.tdm.local/
Also on:    postgresql.org/message-id/20060614110713.GA2277@alamut.tdm.local

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: yazicivo@ttnet.net.tr, zboszor@dunaweb.hu
  Subject: Re: Precomputed constants?
  In-Reply-To: <20060614110713.GA2277@alamut.tdm.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox