Yep, I had the same problem https://trac.osgeo.org/postgis/ticket/2543
The issue is that this bug is hard to reproduce. As a workaround, you can try to drop and recreate the table : DROP TABLE VACUUM FULL ANALYZE CREATE TABLE CREATE INDEX Cheers, Rémi-C 2015-09-25 1:32 GMT+02:00 Paul J. Caritj <car...@gmail.com>: > Hello, > I am having trouble with what I expected to be a simple query. I have two > tables, one of census tracts (with a multipolygon geometry column, srid > 4269), and another of sites (with a point geometry column, srid 4269). I > want to find the number of sites that are within a tract of more than a > given population, so I've tried: > > SELECT count(sites.id) FROM sites, census_tracts WHERE AND > census_tracts.population > 2000 AND ST_Contains(census_tracts.geometry, > sites.location); > > But when I do this I get: psycopg2.InternalError: invalid join > selectivity: 179531936.000000. > > Both of the relevant tables have been analyzed and vacuumed. > > The output of postgis_full_version() is > > POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 > March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" > LIBJSON="UNKNOWN" RASTER > > I'm using Windows 7. > > Does this ring a bell for anyone? > > Thanks very much! > > -Paul > > _______________________________________________ > postgis-users mailing list > postgis-users@lists.osgeo.org > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users