> On 11 Aug 2017, at 16:28, Sandro Santilli <s...@kbt.io> wrote: > > On Fri, Aug 11, 2017 at 04:16:44PM +0200, Thijs van den Berg wrote: >> Excellent! >> Thanks for helping me understand, very clear. >> >> That makes me think there is no way around this, considering I want/need to >> use GIST indices to speedup these type of queries? If I did the following >> type of query (which *does* give the intended result) then it looks like >> it’s doing a full table scan instead of using the GIST. >> >> SELECT ST_X(ST_PointFromText('POINT(2288605254 0)')) < >> ST_X(ST_PointFromText('POINT(2288605300 0)')); > > You can use the << operator on geometry to use the index and the < > operator on X to refine as a filter. > > EXPLAIN > SELECT g << ST_PointFromText('POINT(2288605300 0)') > AND ST_X(g) < 2288605300 > FROM test_table; > > —strk;
Thanks Sandro! That’s what I’ll do, I was thinking along those lines. I would need to use &< to include the rounding error, ..and then I think it will work! A great mailing list this is. Thanks both! > _______________________________________________ > postgis-users mailing list > postgis-users@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users