Re: random generated string matching index in inexplicable ways [EXT] - Mailing list pgsql-general

From Myles Miller
Subject Re: random generated string matching index in inexplicable ways [EXT]
Date
Msg-id 20190507131512.GB62383@50pop.com
Whole thread Raw
In response to random generated string matching index in inexplicable ways  (Myles Miller <pg@q7r7.com>)
List pgsql-general
On Tue, May 07, 2019 at 12:17:12PM +0000, Daniel Perrett wrote:
> The WHERE expression (and therefore the random function) is being evaluated once per row, not once per query.
> If you run this query a few times, you will see the problem:
> SELECT y, chr(round(random())::int + 65) FROM (SELECT 'A' UNION SELECT 'B') x(y);

Ah! Thank you! I understand now.




pgsql-general by date:

Previous
From: Myles Miller
Date:
Subject: Re: random generated string matching index in inexplicable ways
Next
From: Steven Lembark
Date:
Subject: Re: Postgres for SQL Server users