[postgis-tickets] [PostGIS] #2703: KNN gist with recheck for 9.5?

PostGIS trac at osgeo.org
Fri May 22 12:45:03 PDT 2015


#2703: KNN gist with recheck for 9.5?
--------------------------+---------------------------
  Reporter:  robe         |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  high         |  Milestone:  PostGIS 2.2.0
 Component:  postgis      |    Version:  trunk
Resolution:               |   Keywords:
--------------------------+---------------------------

Comment (by robe):

 Your last commit r13542 fixed the crashing and made my simple contrived
 test work even after I put on a spatial index.

 However, my real data query:


 {{{
 SELECT * FROM  airports ORDER BY geog <-> (SELECT geog FROM airports WHERE
 airport_id = 'KBOS')  limit 10;

 SELECT * FROM  airports ORDER BY ST_GeogFromText('POINT(-71.0518888888889
 42.4934722222222)') <-> geog limit 10;

 }}}



 Both give error:


 {{{
 ERROR:  index returned tuples in wrong order
 ********** Error **********

 ERROR: index returned tuples in wrong order
 SQL state: XX000


 }}}

 Explain plan shows index trying to be used:


 {{{
 Limit  (cost=8.58..12.64 rows=10 width=279)
   InitPlan 1 (returns $0)
     ->  Index Scan using pk_airports on airports airports_1
 (cost=0.29..8.30 rows=1 width=32)
           Index Cond: (airport_id = 'KBOS'::bpchar)
   ->  Index Scan using idx_airports_geog on airports  (cost=0.28..5877.41
 rows=14479 width=279)
         Order By: (geog <-> $0)

 }}}

--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2703#comment:13>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list