[postgis-users] strange behaviour in PostGIS strictly below operator?

Sandro Santilli strk at kbt.io
Fri Aug 11 07:28:02 PDT 2017


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;


More information about the postgis-users mailing list