Opened 8 years ago

Closed 8 years ago

#3611 closed defect (fixed)

Geography distance performance regression

Reported by: dbaston Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.3.0
Component: postgis Version: master
Keywords: Cc:

Description (last modified by dbaston)

The following query takes 240ms on a fresh install of the 2.2 branch, and 2900ms on a fresh install from trunk.

SELECT setseed(0.1); 
WITH pts AS 
    (SELECT ST_MakePoint(-180 + 360*random(), -90 + 180*random())::geography AS geog FROM generate_series(1, 200))
SELECT max(ST_Distance(a.geog, b.geog)) FROM pts a, pts b;

Results are similar if the call is ST_Distance(a.geom, b.geog, false).

Change History (4)

comment:1 by dbaston, 8 years ago

Description: modified (diff)

comment:2 by robe, 8 years ago

Priority: mediumblocker

comment:3 by robe, 8 years ago

Okay I think I figured out the issue. I forgot to take put the search path script which is not needed anymore, but I had included it and it seems to affect ST_Distance geography badly. When I take the search path out it works fine. Will have out in a bit.

comment:4 by robe, 8 years ago

Resolution: fixed
Status: newclosed

In 15043:

Remove search path on functions (slows down some functions) and no longer needed now we schema qualify all calls
closes #3611

Note: See TracTickets for help on using tickets.