Opened 11 years ago

Closed 11 years ago

#2075 closed defect (duplicate)

Incorrect row count estimation for 3D index

Reported by: olegmyrk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.2
Component: postgis Version: 2.0.x
Keywords: Cc:


I have a problem that Postgis 3D spatial indexes (built using gist_geometry_ops_nd) do not estimate index lookup row count properly,unlike 2D spatial indexes which are working OK.

The 2D query is something like:

position && ST_GeomFromText('LINESTRING(-180 -90, 180 90)', 4326)

And 3D query is something like:

position &&& ST_GeomFromText('LINESTRING(-180 -90 0, 180 90 10000000000)', 4326)

In case of 2D query, query planner gives realistic row count estimates. In case of 3D, the result set is always estimated to be 0.1% of rows.

As a result of incorrect 3D query row estimation, query planner always thinks that spatial query is highly selective and ignores other indexes it might have used otherwise.

Is this a bug or am I missing something? I am using Postgis 2.0.1 on Postgresql 9.1

Attachments (1)

postgis_log.txt (1.0 KB ) - added by olegmyrk 11 years ago.
Example sql transcript

Download all attachments as: .zip

Change History (2)

by olegmyrk, 11 years ago

Attachment: postgis_log.txt added

Example sql transcript

comment:1 by pramsey, 11 years ago

Resolution: duplicate
Status: newclosed

It's a bug or a missing feature depending on your mood and the time of day. Described in #945.

Note: See TracTickets for help on using tickets.