Skip to content

Instantly share code, notes, and snippets.

@ctwhome
Created April 11, 2021 18:55
Show Gist options
  • Save ctwhome/8125bfa8e88c672a889704061a83a17b to your computer and use it in GitHub Desktop.
Save ctwhome/8125bfa8e88c672a889704061a83a17b to your computer and use it in GitHub Desktop.
Create 1M random numbers
-- create a million random numbers and strings
CREATE TABLE items AS
SELECT
(random()*1000000)::integer AS n,
md5(random()::text) AS s
FROM
generate_series(1,1000000);
-- inform planner of big table size change
VACUUM ANALYZE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment