Last active
January 3, 2019 21:52
-
-
Save pnorman/5f93e4909d694816c040a9fd10479545 to your computer and use it in GitHub Desktop.
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
e (external) | 11291.733 | |
---|---|---|
m (main) | 11256.321 | |
x (extended) | 11321.855 |
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
e (external) | 27983.542 | |
---|---|---|
m (main) | 27274.032 | |
x (extended) | 28402.639 |
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
update pg_type set typstorage='e' where typname='geometry'; | |
-- also test with m and x | |
\timing | |
create table adm2 as select * from planet_osm_polygon where boundary='administrative' and admin_level='2' ORDER BY ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10); | |
create table cities as select * from planet_osm_point where place='city' ORDER BY ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10); | |
CREATE INDEX ON adm2 USING gist (way) WITH (fillfactor=100); | |
CREATE INDEX ON cities USING gist (way) WITH (fillfactor=100); | |
VACUUM ANALYZE adm2; | |
VACUUM ANALYZE cities; | |
-- repeat 4 times, throw away first, take median time | |
EXPLAIN ANALYZE SELECT COUNT(*), c.name FROM adm2 c JOIN cities p ON ST_Intersects(c.way, p.way) GROUP BY c.name; | |
DROP TABLE adm2; DROP TABLE cities; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment