[postgis-devel] Major bug with postgis && operator, affecting topology

Rémi Cura remi.cura at gmail.com
Mon Jun 1 07:18:38 PDT 2015


Data in the ticket.
I dropped the topology and recreated it, no more issues.
Note that I was able to do it because it was a toy database,
I would have been stuck if seriously using it.

Maybe it has something to do with lot of transaction cancelling (when I
debug, I raise a lot of exceptions ).

As for the safeguard,
it is necessary not safe.

I'm not an expert, so it's just a guess.
Maybe you have to consider

    `Nan > 1` ==> always false , so not safe (your safeguard wouldn't be
executed)

It could be because `ntuples_max` is 0 or NaN.
Then you have `selectivity = val / ntuples_max;`
In my case there is no row to return anyway.

Maybe you should put selectivity to `0.5` if NaN or Infinity?


Cheers,
Rémi-C

2015-06-01 15:52 GMT+02:00 Paul Ramsey <pramsey at cleverelephant.ca>:

> Because by inspection, I don't see how anything gets past this:
>
>
> https://github.com/postgis/postgis/blob/svn-trunk/postgis/gserialized_estimate.c#L1094-L1096
>
> On Mon, Jun 1, 2015 at 6:49 AM, Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
> > Reproduction data?
> > P
> >
> >
> > --
> > http://postgis.net
> > http://cleverelephant.ca
> >
> >
> > On June 1, 2015 at 6:47:27 AM, Rémi Cura (remi.cura at gmail.com) wrote:
> >> Hey,
> >> I re-opened the ticket [here](
> >> http://trac.osgeo.org/postgis/ticket/2543#comment:21).
> >>
> >> This is a major bug (in my opinion).
> >>
> >>
> >> Simply doing something like
> >> ------
> >> SELECT *
> >> FROM node, face
> >> WHERE geom && mbr
> >> --------
> >>
> >> raises an error
> >> "ERROR: invalid join selectivity:"
> >> (answer should be None, tables have one line each! )
> >>
> >> This is pretty terrible, because spatial intersect is at the basis of
> >> PostGIS, and it affects classical PostGIS topology tables, so it is not
> >> possible to change the tables easily.
> >>
> >> Worse, it affects a pretty recent PostGIS version (POSTGIS="2.2.0dev
> >> r12846" GEOS="3.5.0dev-CAPI-1.9.0 r0" PROJ="Rel. 4.8.0, 6 March 2012"
> >> GDAL="GDAL 2.0.0dev, released 2014/04/16" LIBXML="2.8.0" TOPOLOGY
> RASTER),
> >> with Postgres 9.3 and Ubuntu 12.04.
> >>
> >> Cheers,
> >> Remi-C
> >> _______________________________________________
> >> postgis-devel mailing list
> >> postgis-devel at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150601/546da804/attachment.html>


More information about the postgis-devel mailing list