Hello,
i'm running 7 same HW&SW configured servers with the same load with SQL Ex 2005 SP1 installed. I'm executing SP over 200.000 times a day. And here comes the problem, every server got different average response time, the quickest executes the SP in 1 ms, the slowlest in 50 ms, that's 50x slower!
Have you any performance hint, please? Thank you.
Are they containing the same data?
You can check the execution plan and compare where the extra time is spent.
|||Thank you Andreas for your kind help. This is great idea! However i don't know how to reach SP execution plan in application runtime or some log option (not in Management Studio). Have you any suggestion, please?|||To monitor activities on the server you can use the SQL Profiler.
|||if by chance the dbs are fragmented differently, this will affect performance from machine to machine.|||There is not SQL Profiler present in Express edition, right?
Can i do some kind of analysis in Express edition, except manual query execution plan, please?
Thank you.
|||In all version of SQL 2005 (including express) you can get the execution plan for any query that has run, providing it's still in cache.
This query will return the statement text, average reads, avg cpu, avg duration and query plan in xml format.
select SUBSTRING(text, statement_start_offset/2, (CASE WHEN statement_end_offset = -1 THEN LEN(CONVERT(nvarchar(max), text)) * 2 ELSE statement_end_offset END - statement_start_offset)/2),total_physical_reads/execution_count as avg_physical_reads, total_logical_reads/execution_count as avg_logical_reads, total_worker_time/execution_count as avg_cpu_time, total_elapsed_time/execution_count as avg_duration, query_plan from sys.dm_exec_query_stats qs cross apply sys.dm_exec_sql_text(sql_handle) st cross apply sys.dm_exec_query_plan(plan_handle) qp
To get the graphical display of the plan just save the xml out with the extension .sqlplan. Management studio will then open and display the graphical plan.
Run this on all your machines, and then compare the results for the query you are interested in.
|||YES! This is it. Thank you Jerome for your perfect help.
It's interesting that execution plan in xml differs only in ParameterCompiledValue on fast system there's (0) on slow one there's (1). Do you have any idea what it is, please?
Even more interesting is difference in average reads, cpu and duration. My stored procedure consists of 3 commands: (fast system/slow system)
select reads: 2/2
select cpu: 45/59
select duration: 46/59
insert reads: 4/4
insert cpu: 240/78
insert duration: 257/122
update reads: 2/2
update cpu: 49/52
update duration: 55/118
update reads: 2/2
update cpu: 39/49
update duration: 40/150
I see that there's no difference between reads, BUT! on fast system is duration only slightly longer (eg cpu:45 dur: 46)than CPU, on slow system there're big differences (eg cpu: 78 dur: 122) am i right?
What does this mean, please?
|||can you post the plans and machine specs?|||Sure, here we go...
Both systems are: MS Windows Server 2003, 1 GB RAM, dual XEONs 3 GHz, HDD Raid 5
Fast system:
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.0" Build="9.00.2047.00">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementText="
CREATE PROCEDURE Ulo?_Snímek
	-- definice vstupních parametr?
	@.ID int,
	@.TIMESTAMPMARK datetime,
	@.DBTIME datetime,
	@.EXCHANGEID int,
	@.RECPCM smallint,
	@.DURATION bit,
	@.OBJECT bit,
	@.O_NUMBER bit,
	@.O_IMSI bit,
	@.O_IMEI bit,
	@.O_CELL bit,
	@.PROTOCOLID smallint,
	@.SMS bit,
	@.NELZE_ZJISTIT bit,
	@.PRODLEVA int,
	@.VS bit	

AS
DECLARE
	-- definice proměnnych
	@.úst?edna int,
	@.Trasa int,
	@.OLD_P_Prodleva int,
	@.OLD_P_Celkem smallint,
	@.OLD_P_nelze_zjistit smallint,
	@.OLD_P_DURATION smallint,
	@.OLD_P_OBJECT smallint,
	@.OLD_P_SMS smallint,
	@.OLD_P_O_NUMBER smallint,
	@.OLD_P_O_IMSI smallint,
	@.OLD_P_O_IMEI smallint,
	@.OLD_P_O_CELL smallint,
	@.OLD_P_HI1 smallint,
	@.OLD_P_HI2 smallint,
	@.OLD_P_HI3 smallint,
	@.OLD_P_VS smallint,
	@.HI1 bit,
	@.HI2 bit,
	@.HI3 bit,
	@.OLD_Trasa_P_Celkem smallint
	
BEGIN
 -- volba nevrací po?et zahrnutych ?ádk? jako sou?ást vysledkov mno?iny
	SET NOCOUNT ON;

	-- naplnění HI, dle PROTOCOLID
	" StatementId="1" StatementCompId="2" StatementType="SET ON/OFF" />
<StmtSimple StatementText="	SELECT @.HI1 = 0;
	" StatementId="2" StatementCompId="3" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.HI2 = 0;
	" StatementId="3" StatementCompId="4" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.HI3 = 0;

	" StatementId="4" StatementCompId="5" StatementType="ASSIGN" />
<StmtCond StatementText="	IF (@.PROTOCOLID = 1)
		" StatementId="5" StatementCompId="6" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI1 = 1;

	" StatementId="6" StatementCompId="7" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtCond StatementText="	IF (@.PROTOCOLID = 2)
		" StatementId="7" StatementCompId="9" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI2 = 1;

	" StatementId="8" StatementCompId="10" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtCond StatementText="	IF (@.PROTOCOLID = 3)
		" StatementId="9" StatementCompId="12" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI3 = 1;

	-- projekce úst?edny
" StatementId="10" StatementCompId="13" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtSimple StatementText="	SELECT @.úst?edna = CASE
		-- ET 01OS CCI&IRI
		WHEN (@.EXCHANGEID = 330022) THEN 1
		-- ET 02OS CCI&IRI
		WHEN (@.EXCHANGEID = 330023) THEN 2
		-- TM 03OS CCI
		WHEN (@.EXCHANGEID = 7199) THEN 3
		-- ?T 30OS CCI
		WHEN (@.EXCHANGEID = 203) and (@.PROTOCOLID = 3) THEN 4
		-- ?T 30OS IRI
		WHEN (@.EXCHANGEID = 203) and (@.PROTOCOLID < 3) THEN 5
		-- neur?eno
		ELSE 0
	END

	-- projekce trasy
" StatementId="11" StatementCompId="15" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.Trasa = 0

	-- na?tení starych hodnot, pokud ?ádek existuje
" StatementId="12" StatementCompId="16" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT
		@.OLD_P_Prodleva = P_Prodleva,
		@.OLD_P_Celkem = P_Celkem + 1,
		@.OLD_P_nelze_zjistit = P_nelze_zjistit,
		@.OLD_P_DURATION = P_DURATION,
		@.OLD_P_OBJECT = P_OBJECT,
		@.OLD_P_SMS = P_SMS,
		@.OLD_P_O_NUMBER = P_O_NUMBER,
		@.OLD_P_O_IMSI = P_O_IMSI,
		@.OLD_P_O_IMEI = P_O_IMEI,
		@.OLD_P_O_CELL = P_O_CELL,
		@.OLD_P_HI1 = P_HI1,
		@.OLD_P_HI2 = P_HI2,
		@.OLD_P_HI3 = P_HI3,
		@.OLD_P_VS = P_VS
	FROM
		Snímky
	WHERE
		(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna)

	-- zji?tění zda ?ádek neexistuje (pak INSERT), ?i nikoliv (pak UPDATE)
" StatementId="13" StatementCompId="17" StatementType="SELECT" StatementSubTreeCost="0.0032832" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="19">
<RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ColumnReference Column="Expr1003" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,CONVERT_IMPLICIT(int,[IRIX].[dbo].[Snímky].[P_Celkem],0)+(1),0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Arithmetic Operation="ADD">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="1" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
</OutputList>
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</ComputeScalar>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	IF (@.OLD_P_Celkem is null)
" StatementId="14" StatementCompId="18" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
		-- ?ádek neexistuje, provádím INSERT na základě vstupních parametr?
		INSERT INTO
			Snímky
			(
			Datum?as,
			úst?edna,
			P_Prodleva,
			P_Celkem,
			P_nelze_zjistit,
			P_DURATION,
			P_OBJECT,
			P_SMS,
			P_O_NUMBER,
			P_O_IMSI,
			P_O_IMEI,
			P_O_CELL,
			P_HI1,
			P_HI2,
			P_HI3,
			P_VS
			)
		VALUES
			(
			@.TIMESTAMPMARK,
			@.úst?edna,
			@.PRODLEVA,
			1,
			@.NELZE_ZJISTIT,
			@.DURATION,
			@.OBJECT,
			@.SMS,
			@.O_NUMBER,
			@.O_IMSI,
			@.O_IMEI,
			@.O_CELL,
			@.HI1,
			@.HI2,
			@.HI3,
			@.VS
			)
" StatementId="15" StatementCompId="19" StatementType="INSERT" StatementSubTreeCost="0.0132896" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="35">
<RelOp NodeId="1" PhysicalOp="Assert" LogicalOp="Assert" EstimateRows="1" EstimateIO="0" EstimateCPU="1.8e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132896" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<Assert StartupExpression="0">
<RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132894" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1021" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1021" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1021" />
</ProbeColumn>
<RelOp NodeId="3" PhysicalOp="Clustered Index Insert" LogicalOp="Insert" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0100022" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</OutputList>
<ScalarInsert>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smalldatetime,[@.TIMESTAMPMARK],0)">
<Convert DataType="smalldatetime" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="(1)">
<Const ConstValue="(1)" />
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.NELZE_ZJISTIT],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.NELZE_ZJISTIT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1006" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.DURATION],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DURATION" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1007" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.OBJECT],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OBJECT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.SMS],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.SMS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1009" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_NUMBER],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_NUMBER" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1010" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_IMSI],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMSI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1011" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_IMEI],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMEI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_CELL],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_CELL" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1013" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI1],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI1" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1014" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI2],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI2" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1015" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI3],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI3" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1016" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.VS],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.VS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1017" />
<ScalarOperator ScalarString="(0)">
<Const ConstValue="(0)" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[Datum?as] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky].[úst?edna] = RaiseIfNull([@.úst?edna]),[IRIX].[dbo].[Snímky].[P_Prodleva] = RaiseIfNull([@.PRODLEVA]),[IRIX].[dbo].[Snímky].[P_Celkem] = [Expr1004],[IRIX].[dbo].[Snímky].[P_nelze_zjistit] = RaiseIfNull([Expr1005]),[IRIX].[dbo].[Snímky].[P_DURATION] = RaiseIfNull([Expr1006]),[IRIX].[dbo].[Snímky].[P_OBJECT] = RaiseIfNull([Expr1007]),[IRIX].[dbo].[Snímky].[P_SMS] = RaiseIfNull([Expr1008]),[IRIX].[dbo].[Snímky].[P_O_NUMBER] = RaiseIfNull([Expr1009]),[IRIX].[dbo].[Snímky].[P_O_IMSI] = RaiseIfNull([Expr1010]),[IRIX].[dbo].[Snímky].[P_O_IMEI] = RaiseIfNull([Expr1011]),[IRIX].[dbo].[Snímky].[P_O_CELL] = RaiseIfNull([Expr1012]),[IRIX].[dbo].[Snímky].[P_HI1] = RaiseIfNull([Expr1013]),[IRIX].[dbo].[Snímky].[P_HI2] = RaiseIfNull([Expr1014]),[IRIX].[dbo].[Snímky].[P_HI3] = RaiseIfNull([Expr1015]),[IRIX].[dbo].[Snímky].[P_VS] = RaiseIfNull([Expr1016]),[IRIX].[dbo].[Snímky].[P_RDIS] = [Expr1017]">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.PRODLEVA" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1006" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1007" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1008" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1009" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1010" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1014" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1015" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1016" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_RDIS" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1017" />
</Identifier>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</ScalarInsert>
</RelOp>
<RelOp NodeId="4" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[úst?edny]" Index="[PK__úst?edny__7F60ED59]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[úst?edny]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[úst?edna]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="CASE WHEN [Expr1021] IS NULL THEN (0) ELSE NULL END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1021" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Predicate>
</Assert>
</RelOp>
<ParameterList>
<ColumnReference Column="@.VS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_CELL" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_IMEI" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_IMSI" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_NUMBER" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.SMS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.OBJECT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.DURATION" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.NELZE_ZJISTIT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.PRODLEVA" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
<Else>
<Statements />
</Else>
</StmtCond>
<StmtSimple StatementText="	END
	ELSE
	BEGIN
		-- ?ádek existuje, provádím UPDATE na základě starych dat a vstupních parametr?
		UPDATE
			Snímky
		SET
			P_Prodleva = @.OLD_P_Prodleva + @.PRODLEVA,
			P_Celkem = @.OLD_P_Celkem,
			P_nelze_zjistit = @.OLD_P_nelze_zjistit + @.NELZE_ZJISTIT,
			P_DURATION = @.OLD_P_DURATION + @.DURATION,
			P_OBJECT = @.OLD_P_OBJECT + @.OBJECT,
			P_SMS = @.OLD_P_SMS + @.SMS,
			P_O_NUMBER = @.OLD_P_O_NUMBER + @.O_NUMBER,
			P_O_IMSI = @.OLD_P_O_IMSI + @.O_IMSI,
			P_O_IMEI = @.OLD_P_O_IMEI + @.O_IMEI,
			P_O_CELL = @.OLD_P_O_CELL + @.O_CELL,
			P_HI1 = @.OLD_P_HI1 + @.HI1,
			P_HI2 = @.OLD_P_HI2 + @.HI2,
			P_HI3 = @.OLD_P_HI3 + @.HI3,
			P_VS = @.OLD_P_VS + @.VS
		WHERE
			(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna)		
" StatementId="16" StatementCompId="22" StatementType="UPDATE" StatementSubTreeCost="0.0132842" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="40">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132842" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="[@.OLD_P_Prodleva]+[@.PRODLEVA]">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_Prodleva" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.PRODLEVA" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="[@.OLD_P_nelze_zjistit]+CONVERT_IMPLICIT(smallint,[@.NELZE_ZJISTIT],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_nelze_zjistit" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.NELZE_ZJISTIT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="[@.OLD_P_DURATION]+CONVERT_IMPLICIT(smallint,[@.DURATION],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_DURATION" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DURATION" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1006" />
<ScalarOperator ScalarString="[@.OLD_P_OBJECT]+CONVERT_IMPLICIT(smallint,[@.OBJECT],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_OBJECT" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OBJECT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1007" />
<ScalarOperator ScalarString="[@.OLD_P_SMS]+CONVERT_IMPLICIT(smallint,[@.SMS],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_SMS" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.SMS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="[@.OLD_P_O_NUMBER]+CONVERT_IMPLICIT(smallint,[@.O_NUMBER],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_NUMBER" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_NUMBER" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1009" />
<ScalarOperator ScalarString="[@.OLD_P_O_IMSI]+CONVERT_IMPLICIT(smallint,[@.O_IMSI],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_IMSI" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMSI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1010" />
<ScalarOperator ScalarString="[@.OLD_P_O_IMEI]+CONVERT_IMPLICIT(smallint,[@.O_IMEI],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_IMEI" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMEI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1011" />
<ScalarOperator ScalarString="[@.OLD_P_O_CELL]+CONVERT_IMPLICIT(smallint,[@.O_CELL],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_CELL" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_CELL" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="[@.OLD_P_HI1]+CONVERT_IMPLICIT(smallint,[@.HI1],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI1" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI1" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1013" />
<ScalarOperator ScalarString="[@.OLD_P_HI2]+CONVERT_IMPLICIT(smallint,[@.HI2],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI2" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI2" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1014" />
<ScalarOperator ScalarString="[@.OLD_P_HI3]+CONVERT_IMPLICIT(smallint,[@.HI3],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI3" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI3" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1015" />
<ScalarOperator ScalarString="[@.OLD_P_VS]+CONVERT_IMPLICIT(smallint,[@.VS],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_VS" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.VS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[P_Prodleva] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky].[P_Celkem] = RaiseIfNull([@.OLD_P_Celkem]),[IRIX].[dbo].[Snímky].[P_nelze_zjistit] = RaiseIfNull([Expr1004]),[IRIX].[dbo].[Snímky].[P_DURATION] = RaiseIfNull([Expr1005]),[IRIX].[dbo].[Snímky].[P_OBJECT] = RaiseIfNull([Expr1006]),[IRIX].[dbo].[Snímky].[P_SMS] = RaiseIfNull([Expr1007]),[IRIX].[dbo].[Snímky].[P_O_NUMBER] = RaiseIfNull([Expr1008]),[IRIX].[dbo].[Snímky].[P_O_IMSI] = RaiseIfNull([Expr1009]),[IRIX].[dbo].[Snímky].[P_O_IMEI] = RaiseIfNull([Expr1010]),[IRIX].[dbo].[Snímky].[P_O_CELL] = RaiseIfNull([Expr1011]),[IRIX].[dbo].[Snímky].[P_HI1] = RaiseIfNull([Expr1012]),[IRIX].[dbo].[Snímky].[P_HI2] = RaiseIfNull([Expr1013]),[IRIX].[dbo].[Snímky].[P_HI3] = RaiseIfNull([Expr1014]),[IRIX].[dbo].[Snímky].[P_VS] = RaiseIfNull([Expr1015])">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_Celkem" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1006" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1007" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1008" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1009" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1010" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1014" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1015" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.VS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_CELL" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_IMEI" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_IMSI" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_NUMBER" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.SMS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.OBJECT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.DURATION" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.NELZE_ZJISTIT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.PRODLEVA" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	END

	-- pokud byla ztoto?něna trasa
	IF (@.Trasa <> 0)
" StatementId="17" StatementCompId="24" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
		-- na?tení starych hodnot, pokud ?ádek existuje
		SELECT
			@.OLD_Trasa_P_Celkem = P_Celkem + 1
		FROM
			Snímky_Tras
		WHERE
			(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna) and (Trasa = @.Trasa)
 
		-- zji?tění zda ?ádek neexistuje (pak INSERT), ?i nikoliv (pak UPDATE)
	" StatementId="18" StatementCompId="25" StatementType="SELECT" StatementSubTreeCost="0.0032832" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1003" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,CONVERT_IMPLICIT(int,[IRIX].[dbo].[Snímky_Tras].[P_Celkem],0)+(1),0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Arithmetic Operation="ADD">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="1" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</OutputList>
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.Trasa]">
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</ComputeScalar>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	IF (@.OLD_Trasa_P_Celkem is null)
	" StatementId="19" StatementCompId="26" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
			-- ?ádek neexistuje, provádím INSERT na základě vstupních parametr?
			INSERT INTO
				Snímky_Tras
				(
				Datum?as,
				úst?edna,
				Trasa,
				P_Celkem
				)
			VALUES
				(
				@.TIMESTAMPMARK,
				@.úst?edna,
				@.Trasa,
				1
				)
	" StatementId="20" StatementCompId="27" StatementType="INSERT" StatementSubTreeCost="0.0165769" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="19">
<RelOp NodeId="1" PhysicalOp="Assert" LogicalOp="Assert" EstimateRows="1" EstimateIO="0" EstimateCPU="1.8e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0165769" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<Assert StartupExpression="0">
<RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0165767" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1011" />
<ColumnReference Column="Expr1012" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1012" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1012" />
</ProbeColumn>
<RelOp NodeId="3" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="12" EstimatedTotalSubtreeCost="0.0132894" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
<ColumnReference Column="Expr1011" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1011" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1011" />
</ProbeColumn>
<RelOp NodeId="4" PhysicalOp="Clustered Index Insert" LogicalOp="Insert" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="19" EstimatedTotalSubtreeCost="0.0100022" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</OutputList>
<ScalarInsert>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smalldatetime,[@.TIMESTAMPMARK],0)">
<Convert DataType="smalldatetime" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="(1)">
<Const ConstValue="(1)" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Datum?as] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky_Tras].[úst?edna] = RaiseIfNull([@.úst?edna]),[IRIX].[dbo].[Snímky_Tras].[Trasa] = RaiseIfNull([@.Trasa]),[IRIX].[dbo].[Snímky_Tras].[P_Celkem] = [Expr1004]">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</ScalarInsert>
</RelOp>
<RelOp NodeId="5" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Datum?as]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[úst?edna]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<RelOp NodeId="6" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[Trasy]" Index="[PK__Trasy__15502E78]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Trasy]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Trasa]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="CASE WHEN [Expr1011] IS NULL THEN (0) ELSE CASE WHEN [Expr1012] IS NULL THEN (1) ELSE NULL END END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Predicate>
</Assert>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
<Else>
<Statements />
</Else>
</StmtCond>
<StmtSimple StatementText="	END
		ELSE
		BEGIN
			-- ?ádek existuje, provádím UPDATE
			UPDATE
				Snímky_Tras
			SET
				P_Celkem = @.OLD_Trasa_P_Celkem
			WHERE
				(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna) and (Trasa = @.Trasa)
	" StatementId="21" StatementCompId="30" StatementType="UPDATE" StatementSubTreeCost="0.0132841" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132841" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.Trasa]">
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[P_Celkem] = RaiseIfNull([@.OLD_Trasa_P_Celkem])">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_Trasa_P_Celkem" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-17 04:23:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
</StmtCond>
<StmtSimple StatementText="	END
	END

	-- aktualizace IRI(ID)
	UPDATE
		Sherman
	SET
		Sh_ID = @.ID,
		DBTIME = @.DBTIME,
		Aktualizováno = GETDATE()
	WHERE
		ID = 0;
" StatementId="22" StatementCompId="33" StatementType="UPDATE" StatementSubTreeCost="0.0132842" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132842" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator ScalarString="getdate()">
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
<ScalarOperator ScalarString="getdate()">
<Identifier>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Index="[PK__Sherman__182C9B23]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="ID" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="(0)">
<Const ConstValue="(0)" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Sherman].[Sh_ID] = RaiseIfNull([@.ID]),[IRIX].[dbo].[Sherman].[DBTIME] = RaiseIfNull([@.DBTIME]),[IRIX].[dbo].[Sherman].[Aktualizováno] = RaiseIfNull(getdate())">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="Sh_ID" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.ID" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="DBTIME" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DBTIME" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="Aktualizováno" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.DBTIME" ParameterCompiledValue="'2006-06-17 04:23:08.000'" />
<ColumnReference Column="@.ID" ParameterCompiledValue="(38869807)" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Slow system:
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.0" Build="9.00.2047.00">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementText="
CREATE PROCEDURE Ulo?_Snímek
	-- definice vstupních parametr?
	@.ID int,
	@.TIMESTAMPMARK datetime,
	@.DBTIME datetime,
	@.EXCHANGEID int,
	@.RECPCM smallint,
	@.DURATION bit,
	@.OBJECT bit,
	@.O_NUMBER bit,
	@.O_IMSI bit,
	@.O_IMEI bit,
	@.O_CELL bit,
	@.PROTOCOLID smallint,
	@.SMS bit,
	@.NELZE_ZJISTIT bit,
	@.PRODLEVA int,
	@.VS bit	

AS
DECLARE
	-- definice proměnnych
	@.úst?edna int,
	@.Trasa int,
	@.OLD_P_Prodleva int,
	@.OLD_P_Celkem smallint,
	@.OLD_P_nelze_zjistit smallint,
	@.OLD_P_DURATION smallint,
	@.OLD_P_OBJECT smallint,
	@.OLD_P_SMS smallint,
	@.OLD_P_O_NUMBER smallint,
	@.OLD_P_O_IMSI smallint,
	@.OLD_P_O_IMEI smallint,
	@.OLD_P_O_CELL smallint,
	@.OLD_P_HI1 smallint,
	@.OLD_P_HI2 smallint,
	@.OLD_P_HI3 smallint,
	@.OLD_P_VS smallint,
	@.HI1 bit,
	@.HI2 bit,
	@.HI3 bit,
	@.OLD_Trasa_P_Celkem smallint
	
BEGIN
 -- volba nevrací po?et zahrnutych ?ádk? jako sou?ást vysledkov mno?iny
	SET NOCOUNT ON;

	-- naplnění HI, dle PROTOCOLID
	" StatementId="1" StatementCompId="2" StatementType="SET ON/OFF" />
<StmtSimple StatementText="	SELECT @.HI1 = 0;
	" StatementId="2" StatementCompId="3" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.HI2 = 0;
	" StatementId="3" StatementCompId="4" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.HI3 = 0;

	" StatementId="4" StatementCompId="5" StatementType="ASSIGN" />
<StmtCond StatementText="	IF (@.PROTOCOLID = 1)
		" StatementId="5" StatementCompId="6" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI1 = 1;

	" StatementId="6" StatementCompId="7" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtCond StatementText="	IF (@.PROTOCOLID = 2)
		" StatementId="7" StatementCompId="9" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI2 = 1;

	" StatementId="8" StatementCompId="10" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtCond StatementText="	IF (@.PROTOCOLID = 3)
		" StatementId="9" StatementCompId="12" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	SELECT @.HI3 = 1;

	-- projekce úst?edny
" StatementId="10" StatementCompId="13" StatementType="ASSIGN" />
</Statements>
</Then>
</StmtCond>
<StmtSimple StatementText="	SELECT @.úst?edna = CASE
		-- ET 01UL CCI&IRI
		WHEN (@.EXCHANGEID = 330003) THEN 39
		-- ET 02UL CCI&IRI
		WHEN (@.EXCHANGEID = 330013) THEN 40
		-- TM 10UL CCI
		WHEN (@.EXCHANGEID = 3899) THEN 41
		-- neur?eno
		ELSE 0
	END

	-- projekce trasy
" StatementId="11" StatementCompId="15" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT @.Trasa = 0

	-- na?tení starych hodnot, pokud ?ádek existuje
" StatementId="12" StatementCompId="16" StatementType="ASSIGN" />
<StmtSimple StatementText="	SELECT
		@.OLD_P_Prodleva = P_Prodleva,
		@.OLD_P_Celkem = P_Celkem + 1,
		@.OLD_P_nelze_zjistit = P_nelze_zjistit,
		@.OLD_P_DURATION = P_DURATION,
		@.OLD_P_OBJECT = P_OBJECT,
		@.OLD_P_SMS = P_SMS,
		@.OLD_P_O_NUMBER = P_O_NUMBER,
		@.OLD_P_O_IMSI = P_O_IMSI,
		@.OLD_P_O_IMEI = P_O_IMEI,
		@.OLD_P_O_CELL = P_O_CELL,
		@.OLD_P_HI1 = P_HI1,
		@.OLD_P_HI2 = P_HI2,
		@.OLD_P_HI3 = P_HI3,
		@.OLD_P_VS = P_VS
	FROM
		Snímky
	WHERE
		(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna)

	-- zji?tění zda ?ádek neexistuje (pak INSERT), ?i nikoliv (pak UPDATE)
" StatementId="13" StatementCompId="17" StatementType="SELECT" StatementSubTreeCost="0.0032832" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="19">
<RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ColumnReference Column="Expr1003" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,CONVERT_IMPLICIT(int,[IRIX].[dbo].[Snímky].[P_Celkem],0)+(1),0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Arithmetic Operation="ADD">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="1" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
</OutputList>
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</ComputeScalar>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	IF (@.OLD_P_Celkem is null)
" StatementId="14" StatementCompId="18" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
		-- ?ádek neexistuje, provádím INSERT na základě vstupních parametr?
		INSERT INTO
			Snímky
			(
			Datum?as,
			úst?edna,
			P_Prodleva,
			P_Celkem,
			P_nelze_zjistit,
			P_DURATION,
			P_OBJECT,
			P_SMS,
			P_O_NUMBER,
			P_O_IMSI,
			P_O_IMEI,
			P_O_CELL,
			P_HI1,
			P_HI2,
			P_HI3,
			P_VS
			)
		VALUES
			(
			@.TIMESTAMPMARK,
			@.úst?edna,
			@.PRODLEVA,
			1,
			@.NELZE_ZJISTIT,
			@.DURATION,
			@.OBJECT,
			@.SMS,
			@.O_NUMBER,
			@.O_IMSI,
			@.O_IMEI,
			@.O_CELL,
			@.HI1,
			@.HI2,
			@.HI3,
			@.VS
			)
" StatementId="15" StatementCompId="19" StatementType="INSERT" StatementSubTreeCost="0.0132896" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="35">
<RelOp NodeId="1" PhysicalOp="Assert" LogicalOp="Assert" EstimateRows="1" EstimateIO="0" EstimateCPU="1.8e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132896" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<Assert StartupExpression="0">
<RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132894" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1021" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1021" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1021" />
</ProbeColumn>
<RelOp NodeId="3" PhysicalOp="Clustered Index Insert" LogicalOp="Insert" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0100022" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</OutputList>
<ScalarInsert>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smalldatetime,[@.TIMESTAMPMARK],0)">
<Convert DataType="smalldatetime" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="(1)">
<Const ConstValue="(1)" />
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.NELZE_ZJISTIT],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.NELZE_ZJISTIT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1006" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.DURATION],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DURATION" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1007" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.OBJECT],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OBJECT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.SMS],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.SMS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1009" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_NUMBER],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_NUMBER" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1010" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_IMSI],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMSI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1011" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_IMEI],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMEI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.O_CELL],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_CELL" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1013" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI1],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI1" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1014" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI2],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI2" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1015" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.HI3],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI3" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1016" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,[@.VS],0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.VS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1017" />
<ScalarOperator ScalarString="(0)">
<Const ConstValue="(0)" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[Datum?as] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky].[úst?edna] = RaiseIfNull([@.úst?edna]),[IRIX].[dbo].[Snímky].[P_Prodleva] = RaiseIfNull([@.PRODLEVA]),[IRIX].[dbo].[Snímky].[P_Celkem] = [Expr1004],[IRIX].[dbo].[Snímky].[P_nelze_zjistit] = RaiseIfNull([Expr1005]),[IRIX].[dbo].[Snímky].[P_DURATION] = RaiseIfNull([Expr1006]),[IRIX].[dbo].[Snímky].[P_OBJECT] = RaiseIfNull([Expr1007]),[IRIX].[dbo].[Snímky].[P_SMS] = RaiseIfNull([Expr1008]),[IRIX].[dbo].[Snímky].[P_O_NUMBER] = RaiseIfNull([Expr1009]),[IRIX].[dbo].[Snímky].[P_O_IMSI] = RaiseIfNull([Expr1010]),[IRIX].[dbo].[Snímky].[P_O_IMEI] = RaiseIfNull([Expr1011]),[IRIX].[dbo].[Snímky].[P_O_CELL] = RaiseIfNull([Expr1012]),[IRIX].[dbo].[Snímky].[P_HI1] = RaiseIfNull([Expr1013]),[IRIX].[dbo].[Snímky].[P_HI2] = RaiseIfNull([Expr1014]),[IRIX].[dbo].[Snímky].[P_HI3] = RaiseIfNull([Expr1015]),[IRIX].[dbo].[Snímky].[P_VS] = RaiseIfNull([Expr1016]),[IRIX].[dbo].[Snímky].[P_RDIS] = [Expr1017]">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.PRODLEVA" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1006" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1007" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1008" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1009" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1010" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1014" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1015" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1016" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_RDIS" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1017" />
</Identifier>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</ScalarInsert>
</RelOp>
<RelOp NodeId="4" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[úst?edny]" Index="[PK__úst?edny__7F60ED59]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[úst?edny]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[úst?edna]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="CASE WHEN [Expr1021] IS NULL THEN (0) ELSE NULL END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1021" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Predicate>
</Assert>
</RelOp>
<ParameterList>
<ColumnReference Column="@.VS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_CELL" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_IMEI" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_IMSI" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_NUMBER" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.SMS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.OBJECT" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.DURATION" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.NELZE_ZJISTIT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.PRODLEVA" ParameterCompiledValue="(120)" />
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
<Else>
<Statements />
</Else>
</StmtCond>
<StmtSimple StatementText="	END
	ELSE
	BEGIN
		-- ?ádek existuje, provádím UPDATE na základě starych dat a vstupních parametr?
		UPDATE
			Snímky
		SET
			P_Prodleva = @.OLD_P_Prodleva + @.PRODLEVA,
			P_Celkem = @.OLD_P_Celkem,
			P_nelze_zjistit = @.OLD_P_nelze_zjistit + @.NELZE_ZJISTIT,
			P_DURATION = @.OLD_P_DURATION + @.DURATION,
			P_OBJECT = @.OLD_P_OBJECT + @.OBJECT,
			P_SMS = @.OLD_P_SMS + @.SMS,
			P_O_NUMBER = @.OLD_P_O_NUMBER + @.O_NUMBER,
			P_O_IMSI = @.OLD_P_O_IMSI + @.O_IMSI,
			P_O_IMEI = @.OLD_P_O_IMEI + @.O_IMEI,
			P_O_CELL = @.OLD_P_O_CELL + @.O_CELL,
			P_HI1 = @.OLD_P_HI1 + @.HI1,
			P_HI2 = @.OLD_P_HI2 + @.HI2,
			P_HI3 = @.OLD_P_HI3 + @.HI3,
			P_VS = @.OLD_P_VS + @.VS
		WHERE
			(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna)		
" StatementId="16" StatementCompId="22" StatementType="UPDATE" StatementSubTreeCost="0.0132842" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="40">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132842" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="[@.OLD_P_Prodleva]+[@.PRODLEVA]">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_Prodleva" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.PRODLEVA" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="[@.OLD_P_nelze_zjistit]+CONVERT_IMPLICIT(smallint,[@.NELZE_ZJISTIT],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_nelze_zjistit" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.NELZE_ZJISTIT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1005" />
<ScalarOperator ScalarString="[@.OLD_P_DURATION]+CONVERT_IMPLICIT(smallint,[@.DURATION],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_DURATION" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DURATION" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1006" />
<ScalarOperator ScalarString="[@.OLD_P_OBJECT]+CONVERT_IMPLICIT(smallint,[@.OBJECT],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_OBJECT" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OBJECT" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1007" />
<ScalarOperator ScalarString="[@.OLD_P_SMS]+CONVERT_IMPLICIT(smallint,[@.SMS],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_SMS" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.SMS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1008" />
<ScalarOperator ScalarString="[@.OLD_P_O_NUMBER]+CONVERT_IMPLICIT(smallint,[@.O_NUMBER],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_NUMBER" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_NUMBER" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1009" />
<ScalarOperator ScalarString="[@.OLD_P_O_IMSI]+CONVERT_IMPLICIT(smallint,[@.O_IMSI],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_IMSI" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMSI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1010" />
<ScalarOperator ScalarString="[@.OLD_P_O_IMEI]+CONVERT_IMPLICIT(smallint,[@.O_IMEI],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_IMEI" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_IMEI" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1011" />
<ScalarOperator ScalarString="[@.OLD_P_O_CELL]+CONVERT_IMPLICIT(smallint,[@.O_CELL],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_O_CELL" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.O_CELL" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="[@.OLD_P_HI1]+CONVERT_IMPLICIT(smallint,[@.HI1],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI1" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI1" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1013" />
<ScalarOperator ScalarString="[@.OLD_P_HI2]+CONVERT_IMPLICIT(smallint,[@.HI2],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI2" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI2" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1014" />
<ScalarOperator ScalarString="[@.OLD_P_HI3]+CONVERT_IMPLICIT(smallint,[@.HI3],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_HI3" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.HI3" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1015" />
<ScalarOperator ScalarString="[@.OLD_P_VS]+CONVERT_IMPLICIT(smallint,[@.VS],0)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_VS" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.VS" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky].[P_Prodleva] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky].[P_Celkem] = RaiseIfNull([@.OLD_P_Celkem]),[IRIX].[dbo].[Snímky].[P_nelze_zjistit] = RaiseIfNull([Expr1004]),[IRIX].[dbo].[Snímky].[P_DURATION] = RaiseIfNull([Expr1005]),[IRIX].[dbo].[Snímky].[P_OBJECT] = RaiseIfNull([Expr1006]),[IRIX].[dbo].[Snímky].[P_SMS] = RaiseIfNull([Expr1007]),[IRIX].[dbo].[Snímky].[P_O_NUMBER] = RaiseIfNull([Expr1008]),[IRIX].[dbo].[Snímky].[P_O_IMSI] = RaiseIfNull([Expr1009]),[IRIX].[dbo].[Snímky].[P_O_IMEI] = RaiseIfNull([Expr1010]),[IRIX].[dbo].[Snímky].[P_O_CELL] = RaiseIfNull([Expr1011]),[IRIX].[dbo].[Snímky].[P_HI1] = RaiseIfNull([Expr1012]),[IRIX].[dbo].[Snímky].[P_HI2] = RaiseIfNull([Expr1013]),[IRIX].[dbo].[Snímky].[P_HI3] = RaiseIfNull([Expr1014]),[IRIX].[dbo].[Snímky].[P_VS] = RaiseIfNull([Expr1015])">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Prodleva" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_Celkem" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_P_Celkem" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_nelze_zjistit" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_DURATION" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1005" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_OBJECT" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1006" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_SMS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1007" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_NUMBER" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1008" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMSI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1009" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_IMEI" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1010" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_O_CELL" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI1" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI2" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1013" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_HI3" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1014" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="P_VS" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1015" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.VS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.O_CELL" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_IMEI" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_IMSI" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.O_NUMBER" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.SMS" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.OBJECT" ParameterCompiledValue="(1)" />
<ColumnReference Column="@.DURATION" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.NELZE_ZJISTIT" ParameterCompiledValue="(0)" />
<ColumnReference Column="@.PRODLEVA" ParameterCompiledValue="(120)" />
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	END

	-- pokud byla ztoto?něna trasa
	IF (@.Trasa <> 0)
" StatementId="17" StatementCompId="24" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
		-- na?tení starych hodnot, pokud ?ádek existuje
		SELECT
			@.OLD_Trasa_P_Celkem = P_Celkem + 1
		FROM
			Snímky_Tras
		WHERE
			(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna) and (Trasa = @.Trasa)
 
		-- zji?tění zda ?ádek neexistuje (pak INSERT), ?i nikoliv (pak UPDATE)
	" StatementId="18" StatementCompId="25" StatementType="SELECT" StatementSubTreeCost="0.0032832" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1003" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smallint,CONVERT_IMPLICIT(int,[IRIX].[dbo].[Snímky_Tras].[P_Celkem],0)+(1),0)">
<Convert DataType="smallint" Style="0" Implicit="1">
<ScalarOperator>
<Arithmetic Operation="ADD">
<ScalarOperator>
<Convert DataType="int" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="1" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</OutputList>
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.Trasa]">
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</ComputeScalar>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
<StmtCond StatementText="	IF (@.OLD_Trasa_P_Celkem is null)
	" StatementId="19" StatementCompId="26" StatementType="COND">
<Condition />
<Then>
<Statements>
<StmtSimple StatementText="	BEGIN
			-- ?ádek neexistuje, provádím INSERT na základě vstupních parametr?
			INSERT INTO
				Snímky_Tras
				(
				Datum?as,
				úst?edna,
				Trasa,
				P_Celkem
				)
			VALUES
				(
				@.TIMESTAMPMARK,
				@.úst?edna,
				@.Trasa,
				1
				)
	" StatementId="20" StatementCompId="27" StatementType="INSERT" StatementSubTreeCost="0.0165769" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="18">
<RelOp NodeId="1" PhysicalOp="Assert" LogicalOp="Assert" EstimateRows="1" EstimateIO="0" EstimateCPU="1.8e-007" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0165769" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<Assert StartupExpression="0">
<RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0165767" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Column="Expr1011" />
<ColumnReference Column="Expr1012" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1012" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1012" />
</ProbeColumn>
<RelOp NodeId="3" PhysicalOp="Nested Loops" LogicalOp="Left Semi Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="12" EstimatedTotalSubtreeCost="0.0132894" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
<ColumnReference Column="Expr1011" />
</OutputList>
<NestedLoops Optimized="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1011" />
</DefinedValue>
</DefinedValues>
<OuterReferences>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
</OuterReferences>
<ProbeColumn>
<ColumnReference Column="Expr1011" />
</ProbeColumn>
<RelOp NodeId="4" PhysicalOp="Clustered Index Insert" LogicalOp="Insert" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="19" EstimatedTotalSubtreeCost="0.0100022" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</OutputList>
<ScalarInsert>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1003" />
<ScalarOperator ScalarString="CONVERT_IMPLICIT(smalldatetime,[@.TIMESTAMPMARK],0)">
<Convert DataType="smalldatetime" Style="0" Implicit="1">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="(1)">
<Const ConstValue="(1)" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Datum?as] = RaiseIfNull([Expr1003]),[IRIX].[dbo].[Snímky_Tras].[úst?edna] = RaiseIfNull([@.úst?edna]),[IRIX].[dbo].[Snímky_Tras].[Trasa] = RaiseIfNull([@.Trasa]),[IRIX].[dbo].[Snímky_Tras].[P_Celkem] = [Expr1004]">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1003" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1004" />
</Identifier>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</ScalarInsert>
</RelOp>
<RelOp NodeId="5" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Index="[PK__Snímky__0519C6AF]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky]" Column="úst?edna" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Datum?as]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[úst?edna]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<RelOp NodeId="6" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0032831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" NoExpandHint="0">
<DefinedValues />
<Object Database="[IRIX]" Schema="[dbo]" Table="[Trasy]" Index="[PK__Trasy__15502E78]" />
<SeekPredicates>
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Trasy]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[Trasa]">
<Identifier>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="CASE WHEN [Expr1011] IS NULL THEN (0) ELSE CASE WHEN [Expr1012] IS NULL THEN (1) ELSE NULL END END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1011" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="IS NULL">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</Predicate>
</Assert>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
<Else>
<Statements />
</Else>
</StmtCond>
<StmtSimple StatementText="	END
		ELSE
		BEGIN
			-- ?ádek existuje, provádím UPDATE
			UPDATE
				Snímky_Tras
			SET
				P_Celkem = @.OLD_Trasa_P_Celkem
			WHERE
				(Datum?as = @.TIMESTAMPMARK) and (úst?edna = @.úst?edna) and (Trasa = @.Trasa)
	" StatementId="21" StatementCompId="30" StatementType="UPDATE" StatementSubTreeCost="0.0132841" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132841" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Index="[PK__Snímky_Tras__1A14E395]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Datum?as" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="úst?edna" />
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="Trasa" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[@.TIMESTAMPMARK]">
<Identifier>
<ColumnReference Column="@.TIMESTAMPMARK" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.úst?edna]">
<Identifier>
<ColumnReference Column="@.úst?edna" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[@.Trasa]">
<Identifier>
<ColumnReference Column="@.Trasa" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Snímky_Tras].[P_Celkem] = RaiseIfNull([@.OLD_Trasa_P_Celkem])">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Snímky_Tras]" Column="P_Celkem" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.OLD_Trasa_P_Celkem" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.TIMESTAMPMARK" ParameterCompiledValue="'2006-06-22 08:28:00.000'" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Then>
</StmtCond>
<StmtSimple StatementText="	END
	END

	-- aktualizace IRI(ID)
	UPDATE
		Sherman
	SET
		Sh_ID = @.ID,
		DBTIME = @.DBTIME,
		Aktualizováno = GETDATE()
	WHERE
		ID = 0;
" StatementId="22" StatementCompId="33" StatementType="UPDATE" StatementSubTreeCost="0.0132842" StatementEstRows="1" StatementOptmLevel="TRIVIAL">
<QueryPlan CachedPlanSize="8">
<RelOp NodeId="0" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132842" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList />
<SimpleUpdate>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator ScalarString="getdate()">
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
<ScalarOperator ScalarString="getdate()">
<Identifier>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<Object Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Index="[PK__Sherman__182C9B23]" />
<SeekPredicate>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="ID" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="(0)">
<Const ConstValue="(0)" />
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekPredicate>
<SetPredicate>
<ScalarOperator ScalarString="[IRIX].[dbo].[Sherman].[Sh_ID] = RaiseIfNull([@.ID]),[IRIX].[dbo].[Sherman].[DBTIME] = RaiseIfNull([@.DBTIME]),[IRIX].[dbo].[Sherman].[Aktualizováno] = RaiseIfNull(getdate())">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="Sh_ID" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.ID" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="DBTIME" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="@.DBTIME" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
<Assign>
<ColumnReference Database="[IRIX]" Schema="[dbo]" Table="[Sherman]" Column="Aktualizováno" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNull">
<ScalarOperator>
<Identifier>
<ColumnReference Column="ConstExpr1010">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
</SimpleUpdate>
</RelOp>
<ParameterList>
<ColumnReference Column="@.DBTIME" ParameterCompiledValue="'2006-06-22 08:30:19.000'" />
<ColumnReference Column="@.ID" ParameterCompiledValue="(32214847)" />
</ParameterList>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
ParameterCompiled value is the value that was passed to the statement when it was compiled and cached. In your case one plan was cached with the value of 1, the other with the value of 0.
The times are also in microseconds (1 millionth of a second), not milliseconds (1 thousandth of a second).
At 122 microseconds this is still blistering fast, and with a difference of 76 microseconds in execution time it would take over 13000 end to end executions before there was a full second of difference in execution time.
Since this is express there will be only 1 scheduler for user queries. Are some of the systems supporting more simultaneous connections?
|||WOW, microsecs? This is incredible. I do not understand how execution can take up to 0,05 sec. I'm measuring in C# this way:
starttime = DateTime.Now();
ExecuteNonQuery();
endtime = DateTime.Now();
All systems are accessed by one connection only.
|||There are numerous layers between C# and execution in the server. SqlClient must consume the results and produce datasets, there are protocols that must be negotiated in both the client app and the server before the query is submitted and the results are produced.
To get real execution time for each query run it from sqlcmd.
The format would be
set statistics time on
set statistics profile on
set statistics io on
<your query here>
In the output you will have the time for parsing and compiling each statement, the number of logical and physical IO's and a run time plan with both estimated and actual row counts.
From that you should be able to determine whether the slowdown is in the server, or between the app and the server.
|||Is there any chance how to set this statistics in app or server side, not via sqlcmd, because i'm executing stored procedures with a lot of parameters, please?
Thank you Jerome for kind help.
|||You can set these in the app, but you need to retrieve the output which will include multiple result sets, and several messages. You can also set the parameters when submitting the batch from sqlcmd, but either way works.
No comments:
Post a Comment