oracle idcs,Oracle Spatial函数SDO_CS.Transform(value)结果非常慢
嘗試使用UNION ALL而不是UNION:
SELECT P.g3e_fid,
T2.X * 1000 AS x_coord,
T2.Y * 1000 AS y_coord,
T.Y AS latitude,
T.X AS longitude
FROM PolePoint P,
TABLE (
SDO_UTIL.GETVERTICES (SDO_CS.TRANSFORM (P.G3E_GEOMETRY, 8265))) T,
TABLE (SDO_UTIL.GETVERTICES (P.G3E_GEOMETRY)) T2
WHERE P.ltt_id = 0
UNION ALL
SELECT P.g3e_fid,
T2.X * 1000 AS x_coord,
T2.Y * 1000 AS y_coord,
T.Y AS latitude,
T.X AS longitude
FROM PoleDetailPoint P,
TABLE (
SDO_UTIL.GETVERTICES (SDO_CS.TRANSFORM (P.G3E_GEOMETRY, 8265))) T,
TABLE (SDO_UTIL.GETVERTICES (P.G3E_GEOMETRY)) T2
WHERE P.ltt_id = 0;
性能下降的另一個潛在來源是你直接在P.G3E_GEOMETRY上使用兩個SDO_UTIL.GET_VERTICES調用而另一個在P.G3E_GEOMETRY的變換上你將基本上有兩個頂點列表的叉積的事實,所以例如,如果特定的P.G3E_GEOMETRY包含5個頂點,那么對于該5個頂點P.G3E_GEOMETRY,對于T和T2的25種可能組合中的每一種,最終將得到5 * 5條記錄.我不知道頂點順序是否由SDO_CS.TRANSFORM函數維護,但如果是,則可以通過在查詢的每一半中添加和t1.id = t2.id謂詞來提高性能:
SELECT P.g3e_fid,
T2.X * 1000 AS x_coord,
T2.Y * 1000 AS y_coord,
T.Y AS latitude,
T.X AS longitude
FROM PolePoint P,
TABLE (
SDO_UTIL.GETVERTICES (SDO_CS.TRANSFORM (P.G3E_GEOMETRY, 8265))) T,
TABLE (SDO_UTIL.GETVERTICES (P.G3E_GEOMETRY)) T2
WHERE P.ltt_id = 0
AND T.ID = T2.ID
UNION ALL
SELECT P.g3e_fid,
T2.X * 1000 AS x_coord,
T2.Y * 1000 AS y_coord,
T.Y AS latitude,
T.X AS longitude
FROM PoleDetailPoint P,
TABLE (
SDO_UTIL.GETVERTICES (SDO_CS.TRANSFORM (P.G3E_GEOMETRY, 8265))) T,
TABLE (SDO_UTIL.GETVERTICES (P.G3E_GEOMETRY)) T2
WHERE P.ltt_id = 0
AND T.ID = T2.ID;
總結
以上是生活随笔為你收集整理的oracle idcs,Oracle Spatial函数SDO_CS.Transform(value)结果非常慢的全部內容,希望文章能夠幫你解決所遇到的問題。