DECLARE @Shape GEOMETRY
SET @Shape = GEOMETRY::STGeomFromText('GEOMETRYCOLLECTION EMPTY', 25832)
DECLARE @pkid uniqueidentifier set @pkid = (select top 1 forurening_id from e_forurening_version where pkid = 'e7f2139f-d49a-4768-8cf8-4d28aae5d940')
SELECT @Shape = @Shape.STUnion(geom)
FROM v_gisflader
where forurening_id = @pkid and aktiv = 1 AND seneste = 1 AND fladestatus in ('0001.001', '0001.002', '0001.003', '0001.004', '0001.005', '0001.006', '0001.007', '0001.008')
select @Shape.Reduce(.5).STAsText() as geom;
DECLARE @Shape GEOMETRY SET @Shape = GEOMETRY::STGeomFromText('GEOMETRYCOLLECTION EMPTY', 25832)
DECLARE @pkid uniqueidentifier set @pkid = (select top 1 forurening_id from e_forurening_version where pkid = 'ea9aeb4d-f47d-4253-bfd1-6980025f8057')
SELECT @Shape = @Shape.STUnion(geom)
FROM v_gisflader
where forurening_id = @pkid and aktiv = 1 AND seneste = 1 AND fladestatus in ('0001.001', '0001.002', '0001.003', '0001.004', '0001.005', '0001.006', '0001.007', '0001.008')
Plan Cachen kan ses med:
WITH t AS
(
SELECT plan_handle, cacheobjtype, objtype, usecounts, [text]
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
)
SELECT DISTINCT t.cacheobjtype, t.objtype, t.usecounts, t.[text] AS "sql", qs.creation_time
FROM t INNER JOIN sys.dm_exec_query_stats qs
ON t.plan_handle = qs.plan_handle
--WHERE t.[text] LIKE '%GeoS_Lok_V0_eksterne%' / Eksterne GeoServer kald /
OR t.[text] LIKE '%Overfladevandslinjer_JAR_buffer_250%'
OR t.[text] LIKE '%Overfladevandslinjer_JAR%'
ORDER BY creation_time DESC
GO
Som i https://jar-cowi.atlassian.net/browse/JAR-1630 så ser det ud som om at DMP GIS validering komponent ligeledes generere mange unikke planer i Cachen.
Kaldene er i stil med:
DECLARE @Shape GEOMETRY SET @Shape = GEOMETRY::STGeomFromText('GEOMETRYCOLLECTION EMPTY', 25832) DECLARE @pkid uniqueidentifier set @pkid = (select top 1 forurening_id from e_forurening_version where pkid = 'e7f2139f-d49a-4768-8cf8-4d28aae5d940') SELECT @Shape = @Shape.STUnion(geom) FROM v_gisflader where forurening_id = @pkid and aktiv = 1 AND seneste = 1 AND fladestatus in ('0001.001', '0001.002', '0001.003', '0001.004', '0001.005', '0001.006', '0001.007', '0001.008') select @Shape.Reduce(.5).STAsText() as geom;
DECLARE @Shape GEOMETRY SET @Shape = GEOMETRY::STGeomFromText('GEOMETRYCOLLECTION EMPTY', 25832)
DECLARE @pkid uniqueidentifier set @pkid = (select top 1 forurening_id from e_forurening_version where pkid = 'ea9aeb4d-f47d-4253-bfd1-6980025f8057') SELECT @Shape = @Shape.STUnion(geom) FROM v_gisflader where forurening_id = @pkid and aktiv = 1 AND seneste = 1 AND fladestatus in ('0001.001', '0001.002', '0001.003', '0001.004', '0001.005', '0001.006', '0001.007', '0001.008')
Plan Cachen kan ses med:
WITH t AS ( SELECT plan_handle, cacheobjtype, objtype, usecounts, [text] FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle) ) SELECT DISTINCT t.cacheobjtype, t.objtype, t.usecounts, t.[text] AS "sql", qs.creation_time FROM t INNER JOIN sys.dm_exec_query_stats qs ON t.plan_handle = qs.plan_handle --WHERE t.[text] LIKE '%GeoS_Lok_V0_eksterne%' / Eksterne GeoServer kald /