Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE test_table (
- ogc_fid integer primary key,
- mapid character(8),
- kind character(4),
- name character(100),
- pinyin character(250),
- exonym character(250),
- adminname character(50),
- zipcode character(6),
- address character(100),
- telephone character(15),
- admincode character(6),
- isindex character(1),
- isother character(1),
- keyword character(250),
- display_x character(12),
- display_y character(12),
- poiid character(15),
- flname character varying(50)
- );
- INSERT INTO test_table
- SELECT i, /* ogc_fid */
- substr(md5(i::text), 0, 8), /* mapid */
- substr(md5((i+1)::text), 0, 4), /* kind */
- repeat(substr(md5((i+2)::text), 0, 4),25), /* name */
- repeat(substr(md5((i+3)::text), 0, 10),25), /* pinyin */
- repeat(substr(md5((i+4)::text), 0, 10),25), /* exonym */
- repeat(substr(md5((i+5)::text), 0, 10),5), /* adminname */
- substr(md5((i+6)::text), 0, 6), /* zipcode */
- repeat(substr(md5((i+7)::text), 0, 10),10), /* address */
- substr(md5((i+8)::text), 0, 15), /* telephone */
- substr(md5((i+9)::text), 0, 6), /* admincode */
- substr(md5((i+10)::text), 0, 1), /* isindex */
- substr(md5((i+11)::text), 0, 1), /* isother */
- repeat(substr(md5((i+12)::text), 0, 10),25), /* keyword */
- substr(md5((i+13)::text), 0, 12), /* display_x */
- substr(md5((i+14)::text), 0, 12), /* display_y */
- substr(md5((i+15)::text), 0, 15), /* poiid */
- repeat(substr(md5((i+16)::text), 0, 10),5) /* display_x */
- FROM generate_series(1,1000000) s(i);
- ANALYZE test_table;
- SELECT pg_size_pretty(pg_relation_size('test_table'));
- \timing on
- SELECT count(*) from test_table;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement