Search Postgresql Archives

Re: select random order by random

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

 



On Thursday 01 November 2007 17:16, Scott Marlowe wrote:

> > > I was very surprised when I executed such SQL query (under PostgreSQL
> > > 8.2):
> > > select random() from generate_series(1, 10) order by random();
> > >
> (...)
> My guess is that it was recognized by the planner as the same function
> and evaluated once per row only.

I also had such hypothesis, but I think that query:
select random(), random() from generate_series(1, 10) order by random();
contradicts it.

-- 
Piotr Sobolewski
http://www.piotrsobolewski.w.pl

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux