3 ms·
This not a random selection. It has the same issues as the 1-dimensional case, and will not sample uniformly. Points inside a cluster of other points will be l
by Okkef 5y ago
This not a random selection. It has the same issues as the 1-dimensional case, and will not sample uniformly.
Points inside a cluster of other points will be less likely to be picked than points that are in a relatively empty region of space.
- XzAeRosho 5y agoIt's not about the randomness of the results, it's about optimizing the speed of the original query.
- alecco 5y agoIt's not that good at that, either.
- contravariant 5y agoNot to mention that points near the edge are 50% less likely to be picked (or 75% less likely if they're near a corner). You can fix this by looping the space around once you reach the edge but good luck expressing that in SQL. You could also fix it by putting them on a sphere I think, though picking a random point on a sphere is exactly the easiest thing to do.
- tpetry 5y agoThat‘s a good idea! I will play with PostGIS and assigning every record a random position on earth.
- alecco 5y agoYes. Better sampling in my other comment https://news.ycombinator.com/item?id=27088101 https://news.ycombinator.com/item?id=27088101