@leijurv commented on this pull request.


> +    CASE WHEN ST_X(ST_StartPoint(l."{geom_column}")) = n.x
+          AND ST_Y(ST_StartPoint(l."{geom_column}")) = n.y
+         THEN ST_X(ST_EndPoint(l."{geom_column}"))
+         ELSE ST_X(ST_StartPoint(l."{geom_column}")) END,
+    CASE WHEN ST_X(ST_StartPoint(l."{geom_column}")) = n.x
+          AND ST_Y(ST_StartPoint(l."{geom_column}")) = n.y
+         THEN ST_Y(ST_EndPoint(l."{geom_column}"))
+         ELSE ST_Y(ST_StartPoint(l."{geom_column}")) END
+    FROM nodes n
+    JOIN {src} l
+      ON {group_join}
+     AND ( (ST_X(ST_StartPoint(l."{geom_column}")) = n.x
+        AND ST_Y(ST_StartPoint(l."{geom_column}")) = n.y)
+       OR (ST_X(ST_EndPoint(l."{geom_column}")) = n.x
+        AND ST_Y(ST_EndPoint(l."{geom_column}")) = n.y) )
+     AND {where}

I think this is true already, I've looked at it in `EXPLAIN ANALYZE` and 
`WorkTable Scan on nodes n (rows=43 loops=319)` shows each iteration joins only 
~43 frontier rows, not the 13613 accumulated. If it were re-joining the whole 
set, that scan would show thousands of rows. It works because I am doing `WITH 
RECURSIVE ... UNION` rather than `WITH RECURSIVE ... UNION ALL`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2482#discussion_r3365453931
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/2482/review/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to