# SDE ST_Geometry SQL st_intersects查询很慢的解决方法

```select LNO
from HSLINE t
where sde.st_intersects(t.shape,
sde.st_geometry(‘polygon ((536001.227128728 3646345.3998618745,535967.7465966925 3646245.5819230564,536081.5112751485 3646231.6260272274,536096.174854475 3646337.021285943,536096.174854475 3646337.021285943,536001.227128728 3646345.3998618745))‘,
t.shape.srid)) = 1```

```select LNO
from HSLINE t
where sde.st_intersects(t.shape,
(select sde.st_geometry(‘polygon ((536001.227128728 3646345.3998618745,535967.7465966925 3646245.5819230564,536081.5112751485 3646231.6260272274,536096.174854475 3646337.021285943,536096.174854475 3646337.021285943,536001.227128728 3646345.3998618745))‘,
t.shape.srid)
from HSLINE where rownum=1)) = 1```

```select LNO
from HSLINE t
where sde.st_intersects(t.shape,
(select sde.st_geometry(‘polygon ((536001.227128728 3646345.3998618745,535967.7465966925 3646245.5819230564,536081.5112751485 3646231.6260272274,536096.174854475 3646337.021285943,536096.174854475 3646337.021285943,536001.227128728 3646345.3998618745))‘,
t.shape.srid)
from dual)) = 1```

dual的解释http://www.cnblogs.com/qiangqiang/archive/2010/10/15/1852229.html