> On Jul 30, 2021, at 10:44 AM, Martin Davis <mtncl...@gmail.com> wrote:
>
> Good to know! Thanks for fessing up... ;)
>
> On Fri, Jul 30, 2021 at 10:27 AM Bruce Rindahl <bruce.rind...@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
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users