Opened 12 years ago

Closed 12 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


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 12 years ago.
SQL file demonstrating operator regression.

Download all attachments as: .zip

Change History (5)

by jbronn, 12 years ago

Attachment: postgis2_error.sql added

SQL file demonstrating operator regression.

comment:1 by claudep, 12 years ago

Cc: claudep added

comment:2 by pramsey, 12 years ago

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 by pramsey, 12 years ago

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

comment:4 by pramsey, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk at r10677, 2.0 at r10676

Note: See TracTickets for help on using tickets.