Skip to content

Instantly share code, notes, and snippets.

@jef-n
Created August 25, 2017 10:06
Show Gist options
  • Save jef-n/107224415e0351f7b98a10526882822e to your computer and use it in GitHub Desktop.
Save jef-n/107224415e0351f7b98a10526882822e to your computer and use it in GitHub Desktop.
find_srid makes a difference
Timing is on.
uelzen_alkis=# SELECT gml_id FROM ax_flurstueck WHERE endet IS NULL AND (st_contains(wkb_geometry,st_geomfromtext('POINT(606786.750 5868489.774)'::text,find_srid(current_schema()::text,'ax_flurstueck'::text,'wkb_geometry'::text))));
gml_id
------------------
DENIAL890000fSkW
(1 row)
Time: 35935,446 ms
uelzen_alkis=# select find_srid(current_schema()::text,'ax_flurstueck'::text,'wkb_geometry'::text);
find_srid
-----------
25832
(1 row)
Time: 1,287 ms
uelzen_alkis=# SELECT gml_id FROM ax_flurstueck WHERE endet IS NULL AND (st_contains(wkb_geometry,st_geomfromtext('POINT(606786.750 5868489.774)'::text,25832)));
gml_id
------------------
DENIAL890000fSkW
(1 row)
Time: 1,536 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment