Last active
May 15, 2021 16:00
-
-
Save anandtripathi5/6a5fd31bc093eefd0ac515f44515fcd0 to your computer and use it in GitHub Desktop.
Gist will create towns table and will insert 100k records in towns table using generate_series
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE towns ( | |
id SERIAL UNIQUE NOT NULL, | |
code VARCHAR(10) NOT NULL, -- not unique | |
article TEXT, | |
name TEXT NOT NULL -- not unique | |
); | |
insert into towns ( | |
code, article, name | |
) | |
select | |
left(md5(i::text), 10), | |
md5(random()::text), | |
md5(random()::text) | |
from generate_series(1, 100000) s(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment