Hello all
Is there a way to make this view more efficient?
Is there a way to make this view more efficient?
Code:
create view [GISADMIN].[Pipes_Test_View] as
SELECT
pipe.[OBJECTID]
,[DIAMETER]
,pipe.SHAPE
,[UpStreamNode]
,[DownStreamNode]
,start_point.OBJECTID as St_Pnt
,end_point.OBJECTID as End_Pnt
FROM [Euclid_GIS].[GISADMIN].[MAIN_EVW] pipe
left outer JOIN [Euclid_GIS].[GISADMIN].[NODE_EVW] start_point
ON pipe.SHAPE.STStartPoint().STEquals(start_point.SHAPE) = 1
left outer JOIN [Euclid_GIS].[GISADMIN].[NODE_EVW] end_point
ON pipe.SHAPE.STEndPoint().STEquals(end_point.SHAPE) = 1