[postgis-users] Finding all 'adjacent' points in a point set

Paul Ramsey pramsey at cleverelephant.ca
Fri Jul 30 10:51:04 PDT 2021



> On Jul 30, 2021, at 10:44 AM, Martin Davis <mtnclimb at gmail.com> wrote:
> 
> Good to know!  Thanks for fessing up...  ;)
> 
> On Fri, Jul 30, 2021 at 10:27 AM Bruce Rindahl <bruce.rindahl at gmail.com> wrote:
> My mistake.  The CTE and inner join methods show no measurable difference in performance.  I added a spatial index to get the big performance difference (Doh!)

This is actually PgSQL-version specific... if you have an older PgSQL (pre 12, I think?) the planner/executor will materialize those CTEs and you'll get burned even if you have an index in place. In later PgSQL, the planner will inline them as subqueries (if that makes sense) and keep you from harming yourself.

P


More information about the postgis-users mailing list