[ScanMail-Spam] Slowness in testing any crossing straight lines in a layer
MONTICOLO Julien
Julien.MONTICOLO at strasbourg.eu
Thu Feb 5 05:00:54 PST 2026
Hello,
When doing a cross join (my_fishbones a, my_fishbones b), you multiply a by b, so 100K by 100K.
If your table has 3 records : 1, 2, 3, the cross join outputs : 1|1, 1|2, 1|3, 2|1, 2|2, 2|3, 3|1, 3|2, 3|3.
There are unnecessary crosses.
Add a condition : a.id > b.id to traverse only the half of the matrix.
Kind regards
De : Bo Guo [mailto:bo.guo at gisticinc.com]
Envoyé : jeudi 5 février 2026 13:53
À : PostGIS Users Discussion <postgis-users at lists.osgeo.org>
Objet : [ScanMail-Spam] Slowness in testing any crossing straight lines in a layer
Hi There!
I have 100K straight lines in a layer - my_fishbone - with GIST indexed. However, the following SQL query did not finish within 20 minutes! Could you advise on any improvement ideas?
SELECT a.*, b.id<http://b.id>
FROM my_fishbones a, my_fishbones b
WHERE a.geom && b.geom
AND ST_Crosses(a.geom, b.geom)
Thanks in advance!
Bo Guo
Ce message est établi à usage exclusif de son destinataire.
Toute utilisation ou diffusion, partielle ou totale, doit être préalablement autorisée.
Tout message électronique est susceptible d'altération et son intégrité ne peut être assurée.
L'expéditeur décline toute responsabilité au titre de ce message s'il a été modifié ou falsifié.
Si vous n'êtes pas destinataire de ce message, merci de le détruire et d'avertir l'expéditeur.
Ville et Eurométropole de Strasbourg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20260205/aaf03506/attachment.htm>
More information about the postgis-users
mailing list