Re: [postgis-users] https://postgis.net/docs/geometry_distance_knn.html and index usage

2022-06-22 Thread Ben Madin
Hi Lars, I'm just a user, but we have handled some pretty big datasets so I can understand your problem. I might be misunderstanding, but to confirm you are asking the system to cross join all of the possible points (something like 63483 * 4 * 542 * 4), use st_distance to convert them to geography

Re: [postgis-users] https://postgis.net/docs/geometry_distance_knn.html and index usage

2022-06-22 Thread James Klassen
I don’t know the details of the implementation enough to speak definitively on the behavior issue of desc vs asc. However, my limited understanding is that the spatial index is primarily used to quickly eliminate rows from further consideration that could not possibly intersect the result set. It

Re: [postgis-users] https://postgis.net/docs/geometry_distance_knn.html and index usage

2022-06-22 Thread Lars Aksel Opsahl
>From: postgis-users on behalf of Jim >Klassen >Sent: Wednesday, June 22, 2022 5:27 PM >To: postgis-users@lists.osgeo.org >Subject: Re: [postgis-users] >https://postgis.net/docs/geometry_distance_knn.html and index usage > >The second note on the documentation page you referenced: "Index only

Re: [postgis-users] https://postgis.net/docs/geometry_distance_knn.html and index usage

2022-06-22 Thread Jim Klassen
The second note on the documentation page you referenced: "Index only kicks in if one of the geometries is a constant (not in a subquery/cte). e.g. 'SRID=3005;POINT(1011102 450541)'::geometry instead of a.geom".  Neither value passed to "<->" in your query is a constant. On 6/22/22 09:22, Lars

[postgis-users] https://postgis.net/docs/geometry_distance_knn.html and index usage

2022-06-22 Thread Lars Aksel Opsahl
Hi I have two simple tables. Table "pg_temp_30.g1temp" Column | Type | Collation | Nullable | Default ++---+--+ geo| geometry(Polygon,4258) | | | id |