Hi, In my case I get dist_geography between gid 1 and gid 3 0 in both queries. This looks like a possible issue around the geos cache, something similar to https://trac.osgeo.org/postgis/ticket/4269. Can you run them with EXPLAIN ANALYZE? -- Raúl Marín Rodríguez carto.com