Re:How to create a 1M record table with a single query
by jeffbee on Wednesday March 24, 2021 @11:06AM
(#26568150)
If you're running PostgreSQL you can also just
Depending on how you want your random keys formatted.
[ Parent
| on HN ]
Re:How to create a 1M record table with a single query
by em500 on Wednesday March 24, 2021 @11:12AM
(#26568228)
If you're importing from command line tools, you might as well use the specialized `shuf` tool:
shuf -i 1-$bignum
or for random numbers with replacement shuf -i 1-$bignum -r -n $bignum
These give you a sample of random integers. `shuf` is part of GNU coreutils, so present in most Linux installs (but not on macOS).