Slowness in testing any crossing straight lines in a layer

Bo Guo <[email protected]> Thu, 5 Feb 2026 05:52:41 -0700
Newsgroups gmane.comp.gis.postgis
Message-ID <CADHFRcggpMRkz5DEX=aEtobuLafSo2fjODvf8VhzcLxB=TCBxw@mail.gmail.com>
--00000000000022a202064a132a24
Content-Type: text/plain; charset="UTF-8"

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
FROM my_fishbones a, my_fishbones b
WHERE a.geom && b.geom
  AND ST_Crosses(a.geom, b.geom)

Thanks in advance!

Bo Guo

--00000000000022a202064a132a24
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi There!</div><div><br></div><div>I have 100K straig=
ht lines in a layer - my_fishbone -=C2=A0 with GIST indexed. However,=C2=A0=
the following SQL query did not finish within 20 minutes!=C2=A0 Could you a=
dvise on any=C2=A0improvement ideas?</div><div><br></div><div>SELECT a.*, <=
a href=3D"http://b.id">b.id</a><br>FROM my_fishbones a, my_fishbones b<br>W=
HERE a.geom &amp;&amp; b.geom=C2=A0<br>=C2=A0 AND ST_Crosses(a.geom, b.geom=
)</div><div><br></div><div>Thanks in advance!</div><div><br></div><div>Bo G=
uo</div></div>

--00000000000022a202064a132a24--