You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon this about two months ago, and I think the bug is on the rand function rather the uuid one. As the function doesn't have arguments, it has atomic cardinality and from my point of view it makes sense to be only computed once. At the same time, we don't have any hint in the compiler to determine if a function without arguments will be deterministic for every row, eg. pi() is deterministic so it should be computed only once.
I think the solution would be to provide a version with a single argument where we can extract the input's number of rows, then compute it differently for every row.
Date: 2020-11-15 20:42:24 +0100
From: @swingbit
To: SQL devs <>
Version: 11.39.5 (Oct2020)
CC: @PedroTadim
Last updated: 2020-11-24 11:37:23 +0100
Comment 28270
Date: 2020-11-15 20:42:24 +0100
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
Build Identifier:
While rand() is called for every tuple, uuid() is called only once and then projected.
sql>select sys.rand() from sys.generate_series(1,5);
+------------+
| %4 |
+============+
| 1369990470 |
| 1138053833 |
| 761390791 |
| 532576399 |
+------------+
4 tuples
sql>select sys.uuid() from sys.generate_series(1,5);
+--------------------------------------+
| %4 |
+======================================+
| f4c13fde-f49c-40d3-862b-c9006b21c6d1 |
| f4c13fde-f49c-40d3-862b-c9006b21c6d1 |
| f4c13fde-f49c-40d3-862b-c9006b21c6d1 |
| f4c13fde-f49c-40d3-862b-c9006b21c6d1 |
+--------------------------------------+
4 tuples
Reproducible: Always
Comment 28273
Date: 2020-11-16 09:08:53 +0100
From: @PedroTadim
I stumbled upon this about two months ago, and I think the bug is on the rand function rather the uuid one. As the function doesn't have arguments, it has atomic cardinality and from my point of view it makes sense to be only computed once. At the same time, we don't have any hint in the compiler to determine if a function without arguments will be deterministic for every row, eg. pi() is deterministic so it should be computed only once.
I think the solution would be to provide a version with a single argument where we can extract the input's number of rows, then compute it differently for every row.
Comment 28274
Date: 2020-11-16 18:34:16 +0100
From: MonetDB Mercurial Repository <>
Changeset 60d3da464f74 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.
For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=60d3da464f74
Changeset description:
The text was updated successfully, but these errors were encountered: