Opened 7 years ago

Closed 7 years ago

#2035 closed defect (fixed)

Strange behavior when using left (<<) and right (>>) operators.

Reported by: jbronn Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.2
Component: postgis Version: 2.0.x
Keywords: left right operator Cc: claudep

Description

During the process of adding PostGIS support for GeoDjango, I came across a regression in my test suite when using the left and right operators.

Specifically, when querying a spatial table (or using COUNT(*)) using the left (<<) or right (>>) operators, no results are returned. However, when a LIMIT is added to the query it works.

Attached to this ticket is SQL that demonstrates this issue; I've confirmed on Ubuntu 12.04 (Postgres 9.1.5, GEOS 3.2.2, PostGIS 2.0.1) and on my Mac (Postgres 9.2.1, GEOS 3.3.5, PostGIS 2.0.1).

Attachments (1)

postgis2_error.sql (1.7 KB) - added by jbronn 7 years ago.
SQL file demonstrating operator regression.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by jbronn

Attachment: postgis2_error.sql added

SQL file demonstrating operator regression.

comment:1 Changed 7 years ago by claudep

Cc: claudep added

comment:2 Changed 7 years ago by pramsey

No particular surprise, the difference is that the LIMIT forces the query plan into a sequence scan rather than an index scan, so the difference is due to different behaviour between those modes. So, new mystery: why the difference?

comment:3 Changed 7 years ago by pramsey

And the answer is that the gist_consistent function in 2.0 just doesn't implement those strategies. Hum hum.

comment:4 Changed 7 years ago by pramsey

Resolution: fixed
Status: newclosed

Fixed in trunk at r10677, 2.0 at r10676

Note: See TracTickets for help on using tickets.