Re: [PERFORM] Strange performance boost with random()

2014-02-11 Thread Tom Lane
=?UTF-8?Q?S=C3=A9bastien_Lorion?= writes: > That's interesting .. Does PostgreSQL always use the NUMERIC data type for > constants in absence of cast ? If they're not integers, yes, that's the initial assumption. regards, tom lane -- Sent via pgsql-performance mailing

Re: [PERFORM] Strange performance boost with random()

2014-02-11 Thread Sébastien Lorion
On Mon, Feb 10, 2014 at 3:03 PM, Heikki Linnakangas wrote: > On 02/10/2014 09:52 PM, M Putz wrote: > >> >> Hello, >> >> While analyzing performance, we encountered the following phenomenon, >> >> SELECT sum(pow(.5*generate_series,.5)) >> FROM generate_series(1,100); >> >> is much much

Re: [PERFORM] Strange performance boost with random()

2014-02-10 Thread Heikki Linnakangas
On 02/10/2014 09:52 PM, M Putz wrote: Hello, While analyzing performance, we encountered the following phenomenon, SELECT sum(pow(.5*generate_series,.5)) FROM generate_series(1,100); is much much (a hundred times) slower than SELECT sum(pow(random()*generate_series,.5)) F