Array
(
)

performance de conculta

Victor Pavia
   - 13 ago 2013

Pessoal,
Esta consulta esta bastante lenta no meu banco. Gostaria, se possível, de alguma sugestão para melhorar a performance:
select saldo+quantidade as saldoatual,case when valoranterior is null then 0 else VALORANTERIOR end as valoranterior,*
from (select case when saldoprev is null then 0 else saldoprev end as saldo,
*,case when valorantigo is null then 0 else valorantigo end as antigo
from (
select distinct tt.nseqitmmov,tt.idprd,codigoreduzido,nomefantasia,preco1 as aprazo,
case when qtdeentrada is null then tt.quantidade * TUND.FATORCONVERSAO else tr.qtdeentrada END as quantidade,
case when tr.custoreposicaoa is null then tp.CUSTOREPOSICAO else tr.CUSTOREPOSICAOA end as precocheio,
preco1,margembrutalucro,tp.custounitario,
case when prdcesta is null then 'NÃO' else prdcesta end as prdcesta

,case when prdexterno is null then 'NÃO' else prdexterno end as prdexterno
,(select top 1 valoranterior from historicoprecosprodutos where idprd = tp.idprd
and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valoranterior
,(select top 1 novovalor from historicoprecosprodutos where idprd = tp.idprd
and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valorantigo
,prodpdv,libsaldo,codcfo, SALDOANTERIOR as saldoprev,tpcp.matlimp,ttb.VALOR as IPI
from tmov t WITH (NOLOCK)
inner join titmmov tt (NOLOCK) on (tt.idmov = t.idmov)
left join TUND (NOLOCK) on (TUND.CODUND = TT.CODUND)
left join TRELSLD tr on (tr.IDMOV = tt.IDMOV and tt.NSEQITMMOV = tr.NSEQITMMOV)
inner join tprd tp (NOLOCK) on (tp.idprd = tt.idprd)
left join tprdcompl tpcp (NOLOCK) on (tp.idprd = tpcp.idprd)
left join ttrbprd ttp (NOLOCK) on(ttp.idprd = tp.idprd)
left join TTRBMOV ttb (NOLOCK) on (ttb.IDMOV = tt.IDMOV and ttb.NSEQITMMOV = tt.NSEQITMMOV)
where substring(t.codtmv,1,1) = '1' and ttb.codtrb = 'IPI'

and t.numeromov = '000002470'

and t.codfilial = '1'

)TGERAL )TGERAL2 order by nseqitmmov

Alex Lekao
   - 13 ago 2013

Oi Vitor, boa tarde!!

Experimenta dar uma olhada no plano de execucao estimado no SSMS, ele devera indicar algum indice para vc criar que ajudara no desempenho.

nao cheguei a analisar o seu codigo.

por enquanto to meio correria... rsrsr

Mariana Carvalho
   - 13 ago 2013

aonde podemos ver mesmo este plano?

Ignez
|
MVP
    13 ago 2013

No Query Analyser, clique em CTRL + L que o plano de execução é exibido. Ou então clique em CTRL + M para ativar a exibição do plano de execução quando você executar a query.

Mariana Carvalho
   - 13 ago 2013

obrigada Ignez, mas o passo a passo na ferramenta visual? sabe?

Alex Lekao
   - 14 ago 2013


Citação:
obrigada Ignez, mas o passo a passo na ferramenta visual? sabe?


Oi Mariana, bom dia!!!

No SSMS, va em Consulta, Exibir plano de Execucao Estimado.

E tem um botaozinho tambem na barra de ferramentas que se chama Exibir Plano de Execucao Estimado.

Abraco.

Emanoel Deivison
   - 14 ago 2013

Bom dia,

Uma das coisas a serem verificadas é o uso de outer´s join´s que nada mais é dar a flexibilidade de trazer informações que por algum motivo podem não constar nas tabelas que foram feitas as junções.

Outra coisa é olhar o plano de execução e verificar qual o plano sugerido pelo MS SQL Server, pois os SGDB´s sugerem um plano de execução (não que ele seja o ideal).

O ideal é ir verificando o plano de execução e ir melhorando sua query, sempre se atentando as melhores práticas de programação recomendadas por especialistas ou até mesmo os fabricantes de banco de dados...

Dicas e conselhos de como utilizar Tuning em databases.

http://social.msdn.microsoft.com/Forums/sqlserver/pt-BR/dae66577-ca48-4508-a52c-07a2ddd3588a/dicas-e-conselhos-de-como-utilizar-tuning-em-databases

Caso não conseguir resolver os problemas mencionados, por favor, postar além da sua query as estruturas das tabelas e se possível script com cargas para podermos tentar simular o seu ambiente e vermos o motivo da lentidão em sua instrução sql.

Abração e bons códigos!

Emanoel Deivison
   - 14 ago 2013

Já vi que você fez uso de NOLOCK e mais alguns comandos que nos ajuda na questão de performance... Cuidado nos efeitos colaterais que eles podem causar em uma query problemática...

Links interessantes:

http://techne.cesar.org.br/uso-de-nolock-no-microsoft-sql-server/

http://blogs.msdn.com/b/fcatae/archive/2010/10/05/como-usar-select-with-nolock-para-melhorar-a-performance.aspx

Victor Pavia
   - 14 ago 2013

Esse é o xml do plano de execução, se alguém puder me ajudar, eu agradeço:

<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1" Build="10.0.4000.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="55623300000" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="33426900" StatementText="select saldo+quantidade as saldoatual,case when valoranterior is null then 0 else VALORANTERIOR end as valoranterior,* from (select case when saldoprev is null then 0 else saldoprev end as saldo, *,case when valorantigo is null then 0 else valorantigo end as antigo from ( select distinct tt.nseqitmmov,tt.idprd,codigoreduzido,nomefantasia,preco1 as aprazo, case when qtdeentrada is null then tt.quantidade * TUND.FATORCONVERSAO else tr.qtdeentrada END as quantidade, case when tr.custoreposicaoa is null then tp.CUSTOREPOSICAO else tr.CUSTOREPOSICAOA end as precocheio, preco1,margembrutalucro,tp.custounitario, case when prdcesta is null then 'NÃO' else prdcesta end as prdcesta ,case when prdexterno is null then 'NÃO' else prdexterno end as prdexterno ,(select top 1 valoranterior from historicoprecosprodutos where idprd = tp.idprd and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valoranterior ,(select top 1 novovalor from historicoprecosprodutos where idprd = tp.idprd and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valorantigo ,prodpdv,libsaldo,codcfo, SALDOANTERIOR as saldoprev,tpcp.matlimp,ttb.VALOR as IPI from tmov t WITH (NOLOCK) inner join titmmov tt (NOLOCK) on (tt.idmov = t.idmov) left join TUND (NOLOCK) on (TUND.CODUND = TT.CODUND) left join TRELSLD tr on (tr.IDMOV = tt.IDMOV and tt.NSEQITMMOV = tr.NSEQITMMOV) inner join tprd tp (NOLOCK) on (tp.idprd = tt.idprd) left join tprdcompl tpcp (NOLOCK) on (tp.idprd = tpcp.idprd) left join ttrbprd ttp (NOLOCK) on(ttp.idprd = tp.idprd) left join TTRBMOV ttb (NOLOCK) on (ttb.IDMOV = tt.IDMOV and ttb.NSEQITMMOV = tt.NSEQITMMOV) where substring(t.codtmv,1,1) = '1' and ttb.codtrb = 'IPI' and t.numeromov = '000002470' and t.codfilial = '1' )TGERAL )TGERAL2 order by nseqitmmov" StatementType="SELECT" QueryHash="0xDC548AAA7CCEC91F" QueryPlanHash="0x03B06606753DFAD9">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan CachedPlanSize="408" CompileTime="927" CompileCPU="423" CompileMemory="8632">
<RelOp AvgRowSize="237" EstimateCPU="5562.33" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="33426900">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
<ColumnReference Column="Expr1050" />
<ColumnReference Column="Expr1051" />
<ColumnReference Column="Expr1052" />
<ColumnReference Column="Expr1053" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1050" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] IS NULL THEN (0.0000) ELSE [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1051" />
<ScalarOperator ScalarString="CASE WHEN [Expr1049] IS NULL THEN (0.0000) ELSE [Expr1049] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1049" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1049" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1052" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] IS NULL THEN (0.0000) ELSE [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] END+[Expr1024]">
<Arithmetic Operation="ADD">
<ScalarOperator>
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1024" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1053" />
<ScalarOperator ScalarString="CASE WHEN [Expr1038] IS NULL THEN (0.0000) ELSE [Expr1038] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1038" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1038" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="193" EstimateCPU="921275" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Gather Streams" NodeId="1" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="33421400">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<Parallelism>
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="193" EstimateCPU="2773850" EstimateIO="17399700" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Distinct Sort" NodeId="2" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="32500100">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<MemoryFractions Input="0.998688" Output="1" />
<Sort Distinct="true">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1024" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1025" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1026" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1027" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1038" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1049" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="193" EstimateCPU="852455" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Repartition Streams" NodeId="3" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="12326600">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</PartitionColumns>
<RelOp AvgRowSize="193" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="4" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="11474100">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1024" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[QTDEENTRADA] as [tr].[QTDEENTRADA] IS NULL THEN [corporermaux].[dbo].[TITMMOV].[QUANTIDADE] as [tt].[QUANTIDADE]*[corporermaux].[dbo].[TUND].[FATORCONVERSAO] ELSE CONVERT_IMPLICIT(numeric(31,8),[corporermaux].[dbo].[TRELSLD].[QTDEENTRADA] as [tr].[QTDEENTRADA],0) END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Arithmetic Operation="MULT">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Convert DataType="numeric" Precision="31" Scale="8" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1025" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[CUSTOREPOSICAOA] as [tr].[CUSTOREPOSICAOA] IS NULL THEN [corporermaux].[dbo].[TPRODUTODEF].[CUSTOREPOSICAO] ELSE [corporermaux].[dbo].[TRELSLD].[CUSTOREPOSICAOA] as [tr].[CUSTOREPOSICAOA] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</Identifier>
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1049" />
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[NOVOVALOR]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="212" EstimateCPU="116253" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Left Outer Join" NodeId="5" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="11471300">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</OutputList>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterReferences>
<RelOp AvgRowSize="216" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="6" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="5747320">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1038" />
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[VALORANTERIOR]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="207" EstimateCPU="116253" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Left Outer Join" NodeId="7" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="5744540">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</OutputList>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterReferences>
<RelOp AvgRowSize="198" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="8" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="20550.5">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1026" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TPRDCOMPL].[PRDCESTA] as [tpcp].[PRDCESTA] IS NULL THEN 'NÃO' ELSE [corporermaux].[dbo].[TPRDCOMPL].[PRDCESTA] as [tpcp].[PRDCESTA] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="'NÃO'" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1027" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TPRDCOMPL].[PRDEXTERNO] as [tpcp].[PRDEXTERNO] IS NULL THEN 'NÃO' ELSE [corporermaux].[dbo].[TPRDCOMPL].[PRDEXTERNO] as [tpcp].[PRDEXTERNO] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="'NÃO'" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="198" EstimateCPU="2907.37" EstimateIO="9.96877" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Right Outer Join" NodeId="9" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="17769.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="true">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]=[corporermaux].[dbo].[TPRDCOMPL].[IDPRD] as [tpcp].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="32" EstimateCPU="0.142062" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Sort" NodeId="10" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.310362">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<MemoryFractions Input="5.07763E-05" Output="6.6616E-08" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="32" EstimateCPU="0.051688" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="11" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.16267">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="32" EstimateCPU="0.0041529" EstimateIO="0.106829" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="12" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.110982" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Index="[PKTPRDCOMPL]" Alias="[tpcp]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="178" EstimateCPU="2098.82" EstimateIO="10827.3" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Sort" NodeId="13" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="14851.7">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="0.00125986" Output="0.00125986" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="178" EstimateCPU="793.628" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Repartition Streams" NodeId="14" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1925.55">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="178" EstimateCPU="222.605" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Right Outer Join" NodeId="15" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="1131.92">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="0.00127111" Output="5.04066E-05" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TRELSLD].[IDMOV] as [tr].[IDMOV]=[corporermaux].[dbo].[TITMMOV].[IDMOV] as [tt].[IDMOV] AND [corporermaux].[dbo].[TITMMOV].[NSEQITMMOV] as [tt].[NSEQITMMOV]=[corporermaux].[dbo].[TRELSLD].[NSEQITMMOV] as [tr].[NSEQITMMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="42" EstimateCPU="3.56747" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1053620" LogicalOp="Repartition Streams" NodeId="16" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="39.625">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</PartitionColumns>
<RelOp AvgRowSize="42" EstimateCPU="0.579568" EstimateIO="35.4779" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1053620" LogicalOp="Clustered Index Scan" NodeId="17" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="36.0575" TableCardinality="1053620">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Index="[PKTRELSLD]" Alias="[tr]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="155" EstimateCPU="333.95" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Repartition Streams" NodeId="18" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="869.688">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</PartitionColumns>
<RelOp AvgRowSize="155" EstimateCPU="154.471" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Right Outer Join" NodeId="19" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="535.738">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="3.14338E-06" Output="1.24653E-07" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TUND].[CODUND]=[corporermaux].[dbo].[TITMMOV].[CODUND] as [tt].[CODUND]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="23" EstimateCPU="0.029127" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="168" LogicalOp="Distribute Streams" NodeId="20" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.0333345">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</PartitionColumns>
<RelOp AvgRowSize="23" EstimateCPU="0.0003418" EstimateIO="0.00386574" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="168" LogicalOp="Clustered Index Scan" NodeId="21" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.00420754" TableCardinality="168">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Index="[PKTUND]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="150" EstimateCPU="323.846" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Repartition Streams" NodeId="22" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="381.234">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</PartitionColumns>
<RelOp AvgRowSize="150" EstimateCPU="2.45878" EstimateIO="0.00673496" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Inner Join" NodeId="23" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="57.3887">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="true">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTO].[IDPRD]=[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="47" EstimateCPU="0.142062" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Sort" NodeId="24" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.604999">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<MemoryFractions Input="2.0362E-06" Output="8.07467E-08" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="47" EstimateCPU="0.0537326" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="25" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.457307">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="47" EstimateCPU="0.0041529" EstimateIO="0.399421" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="26" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.403574" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Index="[PKTPRDDEF]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="114" EstimateCPU="0.063154" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="27" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="54.3182">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="false">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTO].[IDPRD]=[corporermaux].[dbo].[TITMMOV].[IDPRD] as [tt].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="72" EstimateCPU="0.0935839" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="28" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.349751">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</PartitionColumns>
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="72" EstimateCPU="0.0041529" EstimateIO="0.252014" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="29" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.256167" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</OutputList>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Index="[PKTPRD]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="50" EstimateCPU="1.70516" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Sort" NodeId="30" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="53.9053">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="3.87584E-07" Output="3.87584E-07" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="50" EstimateCPU="0.219331" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Repartition Streams" NodeId="31" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="52.1945">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="50" EstimateCPU="0.0998936" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="32" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="51.9752">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<NestedLoops Optimized="true" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Column="Expr1076" />
</OuterReferences>
<RelOp AvgRowSize="35" EstimateCPU="0.0998936" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="35" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="44.3156">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<NestedLoops Optimized="true" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Column="Expr1075" />
</OuterReferences>
<RelOp AvgRowSize="33" EstimateCPU="0.173794" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="38" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="36.005">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="2.00423E-08" Output="2.48801E-07" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</HashKeysProbe>
<RelOp AvgRowSize="27" EstimateCPU="0.0308292" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Repartition Streams" NodeId="41" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="5.88366">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="27" EstimateCPU="1.03479" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Inner Join" NodeId="42" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="5.85283">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<MemoryFractions Input="2.72003E-07" Output="1.39151E-06" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] = [corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] AND [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV] = [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="13" EstimateCPU="0.214895" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Bitmap Create" NodeId="43" Parallel="true" PhysicalOp="Bitmap" EstimatedTotalSubtreeCost="3.19957">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Bitmap>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Bitmap1074" />
</DefinedValue>
</DefinedValues>
<HashKeys>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeys>
<RelOp AvgRowSize="13" EstimateCPU="0.214895" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Inner Join" NodeId="44" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="3.19957">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<MemoryFractions Input="1.41155E-06" Output="1.13955E-06" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] = [corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] AND [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV] = [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="13" EstimateCPU="0.0488821" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Bitmap Create" NodeId="45" Parallel="true" PhysicalOp="Bitmap" EstimatedTotalSubtreeCost="1.93249">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Bitmap>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Bitmap1073" />
</DefinedValue>
</DefinedValues>
<HashKeys>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeys>
<RelOp AvgRowSize="13" EstimateCPU="0.0488821" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Repartition Streams" NodeId="46" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.93249">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="36" EstimateCPU="0.169439" EstimateIO="1.57868" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Index Scan" NodeId="47" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="1.74812" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVCFX]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODFILIAL] as [t].[CODFILIAL]=(1) AND [corporermaux].[dbo].[TMOV].[NUMEROMOV] as [t].[NUMEROMOV]='000002470'">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODFILIAL" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="NUMEROMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'000002470'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Bitmap>
</RelOp>
<RelOp AvgRowSize="13" EstimateCPU="0.0728523" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="27993.5" LogicalOp="Repartition Streams" NodeId="48" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.05218">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="22" EstimateCPU="0.169439" EstimateIO="0.689792" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="27993.5" LogicalOp="Index Scan" NodeId="49" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.859231" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVTMV]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="substring([corporermaux].[dbo].[TMOV].[CODTMV] as [t].[CODTMV],(1),(1))='1' AND PROBE([Bitmap1073],[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA],[corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV])">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Intrinsic FunctionName="substring">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODTMV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Intrinsic FunctionName="PROBE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Bitmap1073" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Bitmap>
</RelOp>
<RelOp AvgRowSize="29" EstimateCPU="0.760717" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="307929" LogicalOp="Repartition Streams" NodeId="51" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.61847">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="29" EstimateCPU="0.169439" EstimateIO="0.68831" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="307929" LogicalOp="Index Scan" NodeId="52" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.85775" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVCFO]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="PROBE([Bitmap1074],[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA],[corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV])">
<Intrinsic FunctionName="PROBE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Bitmap1074" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="24" EstimateCPU="0.130287" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Repartition Streams" NodeId="60" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="29.9475">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="33" EstimateCPU="0.954084" EstimateIO="28.4468" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Clustered Index Scan" NodeId="61" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="29.4009" TableCardinality="1734560">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Index="[PKTTRBMOV]" Alias="[ttb]" IndexKind="Clustered" />
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[CODTRB] as [ttb].[CODTRB]='IPI'">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="CODTRB" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'IPI'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
<RelOp AvgRowSize="17" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="47577.3" EstimateRewinds="217.623" EstimateRows="1" LogicalOp="Index Seek" NodeId="63" Parallel="true" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="8.21071" TableCardinality="1395350">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Index="[TXIMVSEQ]" Alias="[tt]" IndexKind="NonClustered" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[IDMOV] as [ttb].[IDMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[NSEQITMMOV] as [ttb].[NSEQITMMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<RelOp AvgRowSize="26" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0.000796586" EstimateRewinds="47795" EstimateRows="1" LogicalOp="Clustered Index Seek" NodeId="65" Parallel="true" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="7.55967" TableCardinality="1395350">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</OutputList>
<IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Index="[PKTITMMOV]" Alias="[tt]" TableReferenceId="-1" IndexKind="Clustered" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[CODCOLIGADA] as [tt].[CODCOLIGADA]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[IDMOV] as [tt].[IDMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[NSEQITMMOV] as [tt].[NSEQITMMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Merge>
</RelOp>
</Merge>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Merge>
</RelOp>
</ComputeScalar>
</RelOp>
<RelOp AvgRowSize="16" EstimateCPU="0.00010028" EstimateIO="0.01" EstimateRebinds="235845" EstimateRewinds="55623100000" EstimateRows="1" LogicalOp="Lazy Spool" NodeId="83" Parallel="true" PhysicalOp="Table Spool" EstimatedTotalSubtreeCost="5607740">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</OutputList>
<Spool>
<RelOp AvgRowSize="20" EstimateCPU="0.0186357" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="84" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="33037.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="5.04667E-10" Output="1.00933E-09" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="20" EstimateCPU="0.0162503" EstimateIO="0" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1166.29" LogicalOp="Inner Join" NodeId="85" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="25986.2">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<NestedLoops Optimized="false">
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]<=[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]">
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
<RelOp AvgRowSize="11" EstimateCPU="0.0724197" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="86" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="20806.9">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="1.00933E-09" Output="5.04667E-10" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="11" EstimateCPU="0.0656624" EstimateIO="1.19695" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="87" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.12">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="15" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="88" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="2" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</TopSort>
</RelOp>
<RelOp AvgRowSize="20" EstimateCPU="0.0656624" EstimateIO="1.66613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="89" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.59">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="24" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="90" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</ColumnsWithNoStatistics>
</Warnings>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="1" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</TopSort>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</ComputeScalar>
</RelOp>
<RelOp AvgRowSize="16" EstimateCPU="0.00010028" EstimateIO="0.01" EstimateRebinds="235845" EstimateRewinds="55623100000" EstimateRows="1" LogicalOp="Lazy Spool" NodeId="95" Parallel="true" PhysicalOp="Table Spool" EstimatedTotalSubtreeCost="5607740">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</OutputList>
<Spool>
<RelOp AvgRowSize="20" EstimateCPU="0.0186357" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="96" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="33037.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="5.04667E-10" Output="1.00933E-09" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="20" EstimateCPU="0.0162503" EstimateIO="0" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1166.29" LogicalOp="Inner Join" NodeId="97" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="25986.2">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<NestedLoops Optimized="false">
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]<=[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]">
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
<RelOp AvgRowSize="11" EstimateCPU="0.0724197" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="98" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="20806.9">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="1.00933E-09" Output="5.04667E-10" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="11" EstimateCPU="0.0656624" EstimateIO="1.19695" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="99" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.12">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="15" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="100" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="4" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</TopSort>
</RelOp>
<RelOp AvgRowSize="20" EstimateCPU="0.0656624" EstimateIO="1.66613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="101" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.59">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="24" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="102" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</ColumnsWithNoStatistics>
</Warnings>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="3" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</TopSort>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</ComputeScalar>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Parallelism>
</RelOp>
</ComputeScalar>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>

Victor Pavia
   - 14 ago 2013

Esse é o xml do plano de execução, se alguém puder me ajudar, eu agradeço:

<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1" Build="10.0.4000.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="55623300000" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="33426900" StatementText="select saldo+quantidade as saldoatual,case when valoranterior is null then 0 else VALORANTERIOR end as valoranterior,* from (select case when saldoprev is null then 0 else saldoprev end as saldo, *,case when valorantigo is null then 0 else valorantigo end as antigo from ( select distinct tt.nseqitmmov,tt.idprd,codigoreduzido,nomefantasia,preco1 as aprazo, case when qtdeentrada is null then tt.quantidade * TUND.FATORCONVERSAO else tr.qtdeentrada END as quantidade, case when tr.custoreposicaoa is null then tp.CUSTOREPOSICAO else tr.CUSTOREPOSICAOA end as precocheio, preco1,margembrutalucro,tp.custounitario, case when prdcesta is null then 'NÃO' else prdcesta end as prdcesta ,case when prdexterno is null then 'NÃO' else prdexterno end as prdexterno ,(select top 1 valoranterior from historicoprecosprodutos where idprd = tp.idprd and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valoranterior ,(select top 1 novovalor from historicoprecosprodutos where idprd = tp.idprd and idreajustepreco <= (select top 1 idreajustepreco from historicoprecosprodutos where idprd = tp.idprd order by idreajustepreco desc)order by idreajustepreco desc) as valorantigo ,prodpdv,libsaldo,codcfo, SALDOANTERIOR as saldoprev,tpcp.matlimp,ttb.VALOR as IPI from tmov t WITH (NOLOCK) inner join titmmov tt (NOLOCK) on (tt.idmov = t.idmov) left join TUND (NOLOCK) on (TUND.CODUND = TT.CODUND) left join TRELSLD tr on (tr.IDMOV = tt.IDMOV and tt.NSEQITMMOV = tr.NSEQITMMOV) inner join tprd tp (NOLOCK) on (tp.idprd = tt.idprd) left join tprdcompl tpcp (NOLOCK) on (tp.idprd = tpcp.idprd) left join ttrbprd ttp (NOLOCK) on(ttp.idprd = tp.idprd) left join TTRBMOV ttb (NOLOCK) on (ttb.IDMOV = tt.IDMOV and ttb.NSEQITMMOV = tt.NSEQITMMOV) where substring(t.codtmv,1,1) = '1' and ttb.codtrb = 'IPI' and t.numeromov = '000002470' and t.codfilial = '1' )TGERAL )TGERAL2 order by nseqitmmov" StatementType="SELECT" QueryHash="0xDC548AAA7CCEC91F" QueryPlanHash="0x03B06606753DFAD9">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan CachedPlanSize="408" CompileTime="927" CompileCPU="423" CompileMemory="8632">
<RelOp AvgRowSize="237" EstimateCPU="5562.33" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="33426900">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
<ColumnReference Column="Expr1050" />
<ColumnReference Column="Expr1051" />
<ColumnReference Column="Expr1052" />
<ColumnReference Column="Expr1053" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1050" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] IS NULL THEN (0.0000) ELSE [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1051" />
<ScalarOperator ScalarString="CASE WHEN [Expr1049] IS NULL THEN (0.0000) ELSE [Expr1049] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1049" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1049" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1052" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] IS NULL THEN (0.0000) ELSE [corporermaux].[dbo].[TRELSLD].[SALDOANTERIOR] as [tr].[SALDOANTERIOR] END+[Expr1024]">
<Arithmetic Operation="ADD">
<ScalarOperator>
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1024" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1053" />
<ScalarOperator ScalarString="CASE WHEN [Expr1038] IS NULL THEN (0.0000) ELSE [Expr1038] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1038" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="(0.0000)" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1038" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="193" EstimateCPU="921275" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Gather Streams" NodeId="1" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="33421400">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<Parallelism>
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="193" EstimateCPU="2773850" EstimateIO="17399700" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Distinct Sort" NodeId="2" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="32500100">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<MemoryFractions Input="0.998688" Output="1" />
<Sort Distinct="true">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1024" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1025" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1026" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1027" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1038" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Column="Expr1049" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OrderByColumn>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="193" EstimateCPU="852455" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Repartition Streams" NodeId="3" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="12326600">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</PartitionColumns>
<RelOp AvgRowSize="193" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="4" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="11474100">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1024" />
<ColumnReference Column="Expr1025" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Column="Expr1049" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1024" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[QTDEENTRADA] as [tr].[QTDEENTRADA] IS NULL THEN [corporermaux].[dbo].[TITMMOV].[QUANTIDADE] as [tt].[QUANTIDADE]*[corporermaux].[dbo].[TUND].[FATORCONVERSAO] ELSE CONVERT_IMPLICIT(numeric(31,8),[corporermaux].[dbo].[TRELSLD].[QTDEENTRADA] as [tr].[QTDEENTRADA],0) END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Arithmetic Operation="MULT">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Convert DataType="numeric" Precision="31" Scale="8" Style="0" Implicit="true">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</Identifier>
</ScalarOperator>
</Convert>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1025" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TRELSLD].[CUSTOREPOSICAOA] as [tr].[CUSTOREPOSICAOA] IS NULL THEN [corporermaux].[dbo].[TPRODUTODEF].[CUSTOREPOSICAO] ELSE [corporermaux].[dbo].[TRELSLD].[CUSTOREPOSICAOA] as [tr].[CUSTOREPOSICAOA] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</Identifier>
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1049" />
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[NOVOVALOR]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="212" EstimateCPU="116253" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Left Outer Join" NodeId="5" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="11471300">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</OutputList>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterReferences>
<RelOp AvgRowSize="216" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="6" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="5747320">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Column="Expr1038" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1038" />
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[VALORANTERIOR]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="207" EstimateCPU="116253" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Left Outer Join" NodeId="7" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="5744540">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</OutputList>
<NestedLoops Optimized="false">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterReferences>
<RelOp AvgRowSize="198" EstimateCPU="2781.17" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Compute Scalar" NodeId="8" Parallel="true" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="20550.5">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
<ColumnReference Column="Expr1026" />
<ColumnReference Column="Expr1027" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1026" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TPRDCOMPL].[PRDCESTA] as [tpcp].[PRDCESTA] IS NULL THEN 'NÃO' ELSE [corporermaux].[dbo].[TPRDCOMPL].[PRDCESTA] as [tpcp].[PRDCESTA] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="'NÃO'" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
<DefinedValue>
<ColumnReference Column="Expr1027" />
<ScalarOperator ScalarString="CASE WHEN [corporermaux].[dbo].[TPRDCOMPL].[PRDEXTERNO] as [tpcp].[PRDEXTERNO] IS NULL THEN 'NÃO' ELSE [corporermaux].[dbo].[TPRDCOMPL].[PRDEXTERNO] as [tpcp].[PRDEXTERNO] END">
<IF>
<Condition>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="NULL" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Const ConstValue="'NÃO'" />
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</Identifier>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp AvgRowSize="198" EstimateCPU="2907.37" EstimateIO="9.96877" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="55623300000" LogicalOp="Right Outer Join" NodeId="9" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="17769.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="true">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]=[corporermaux].[dbo].[TPRDCOMPL].[IDPRD] as [tpcp].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="32" EstimateCPU="0.142062" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Sort" NodeId="10" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.310362">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<MemoryFractions Input="5.07763E-05" Output="6.6616E-08" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="32" EstimateCPU="0.051688" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="11" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.16267">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="32" EstimateCPU="0.0041529" EstimateIO="0.106829" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="12" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.110982" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDEXTERNO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRDCESTA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="LIBSALDO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="PRODPDV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Alias="[tpcp]" Column="MATLIMP" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRDCOMPL]" Index="[PKTPRDCOMPL]" Alias="[tpcp]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="178" EstimateCPU="2098.82" EstimateIO="10827.3" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Sort" NodeId="13" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="14851.7">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="0.00125986" Output="0.00125986" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="178" EstimateCPU="793.628" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Repartition Streams" NodeId="14" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1925.55">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="178" EstimateCPU="222.605" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="74994300" LogicalOp="Right Outer Join" NodeId="15" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="1131.92">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="0.00127111" Output="5.04066E-05" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TRELSLD].[IDMOV] as [tr].[IDMOV]=[corporermaux].[dbo].[TITMMOV].[IDMOV] as [tt].[IDMOV] AND [corporermaux].[dbo].[TITMMOV].[NSEQITMMOV] as [tt].[NSEQITMMOV]=[corporermaux].[dbo].[TRELSLD].[NSEQITMMOV] as [tr].[NSEQITMMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="42" EstimateCPU="3.56747" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1053620" LogicalOp="Repartition Streams" NodeId="16" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="39.625">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</PartitionColumns>
<RelOp AvgRowSize="42" EstimateCPU="0.579568" EstimateIO="35.4779" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1053620" LogicalOp="Clustered Index Scan" NodeId="17" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="36.0575" TableCardinality="1053620">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="NSEQITMMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="SALDOANTERIOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="QTDEENTRADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Alias="[tr]" Column="CUSTOREPOSICAOA" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TRELSLD]" Index="[PKTRELSLD]" Alias="[tr]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="155" EstimateCPU="333.95" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Repartition Streams" NodeId="18" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="869.688">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</PartitionColumns>
<RelOp AvgRowSize="155" EstimateCPU="154.471" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Right Outer Join" NodeId="19" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="535.738">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="3.14338E-06" Output="1.24653E-07" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TUND].[CODUND]=[corporermaux].[dbo].[TITMMOV].[CODUND] as [tt].[CODUND]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="23" EstimateCPU="0.029127" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="168" LogicalOp="Distribute Streams" NodeId="20" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.0333345">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</PartitionColumns>
<RelOp AvgRowSize="23" EstimateCPU="0.0003418" EstimateIO="0.00386574" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="168" LogicalOp="Clustered Index Scan" NodeId="21" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.00420754" TableCardinality="168">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="CODUND" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Column="FATORCONVERSAO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TUND]" Index="[PKTUND]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="150" EstimateCPU="323.846" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Repartition Streams" NodeId="22" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="381.234">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</PartitionColumns>
<RelOp AvgRowSize="150" EstimateCPU="2.45878" EstimateIO="0.00673496" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="35407300" LogicalOp="Inner Join" NodeId="23" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="57.3887">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="true">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTO].[IDPRD]=[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="47" EstimateCPU="0.142062" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Sort" NodeId="24" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.604999">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<MemoryFractions Input="2.0362E-06" Output="8.07467E-08" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="47" EstimateCPU="0.0537326" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="25" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.457307">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="47" EstimateCPU="0.0041529" EstimateIO="0.399421" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="26" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.403574" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="PRECO1" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOUNITARIO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="MARGEMBRUTALUCRO" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="CUSTOREPOSICAO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Index="[PKTPRDDEF]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
<RelOp AvgRowSize="114" EstimateCPU="0.063154" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="27" Parallel="true" PhysicalOp="Merge Join" EstimatedTotalSubtreeCost="54.3182">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Merge ManyToMany="false">
<InnerSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTO].[IDPRD]=[corporermaux].[dbo].[TITMMOV].[IDPRD] as [tt].[IDPRD]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp AvgRowSize="72" EstimateCPU="0.0935839" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Repartition Streams" NodeId="28" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="0.349751">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</PartitionColumns>
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="72" EstimateCPU="0.0041529" EstimateIO="0.252014" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="7408" LogicalOp="Clustered Index Scan" NodeId="29" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.256167" TableCardinality="7408">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</OutputList>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="NOMEFANTASIA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Column="CODIGOREDUZIDO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTO]" Index="[PKTPRD]" IndexKind="Clustered" />
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="50" EstimateCPU="1.70516" EstimateIO="0.00563063" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Sort" NodeId="30" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="53.9053">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="3.87584E-07" Output="3.87584E-07" />
<Sort Distinct="false">
<OrderBy>
<OrderByColumn Ascending="true">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="50" EstimateCPU="0.219331" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Repartition Streams" NodeId="31" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="52.1945">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</PartitionColumns>
<RelOp AvgRowSize="50" EstimateCPU="0.0998936" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="32" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="51.9752">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<NestedLoops Optimized="true" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Column="Expr1076" />
</OuterReferences>
<RelOp AvgRowSize="35" EstimateCPU="0.0998936" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="35" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="44.3156">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<NestedLoops Optimized="true" WithUnorderedPrefetch="true">
<OuterReferences>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Column="Expr1075" />
</OuterReferences>
<RelOp AvgRowSize="33" EstimateCPU="0.173794" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Inner Join" NodeId="38" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="36.005">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<MemoryFractions Input="2.00423E-08" Output="2.48801E-07" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</HashKeysProbe>
<RelOp AvgRowSize="27" EstimateCPU="0.0308292" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Repartition Streams" NodeId="41" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="5.88366">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="27" EstimateCPU="1.03479" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Inner Join" NodeId="42" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="5.85283">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<MemoryFractions Input="2.72003E-07" Output="1.39151E-06" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] = [corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] AND [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV] = [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="13" EstimateCPU="0.214895" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Bitmap Create" NodeId="43" Parallel="true" PhysicalOp="Bitmap" EstimatedTotalSubtreeCost="3.19957">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Bitmap>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Bitmap1074" />
</DefinedValue>
</DefinedValues>
<HashKeys>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeys>
<RelOp AvgRowSize="13" EstimateCPU="0.214895" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="1169.5" LogicalOp="Inner Join" NodeId="44" Parallel="true" PhysicalOp="Hash Match" EstimatedTotalSubtreeCost="3.19957">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<MemoryFractions Input="1.41155E-06" Output="1.13955E-06" />
<Hash>
<DefinedValues />
<HashKeysBuild>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysBuild>
<HashKeysProbe>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeysProbe>
<ProbeResidual>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] = [corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA] AND [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV] = [corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="IS">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</ProbeResidual>
<RelOp AvgRowSize="13" EstimateCPU="0.0488821" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Bitmap Create" NodeId="45" Parallel="true" PhysicalOp="Bitmap" EstimatedTotalSubtreeCost="1.93249">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Bitmap>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Bitmap1073" />
</DefinedValue>
</DefinedValues>
<HashKeys>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</HashKeys>
<RelOp AvgRowSize="13" EstimateCPU="0.0488821" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Repartition Streams" NodeId="46" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.93249">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="36" EstimateCPU="0.169439" EstimateIO="1.57868" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="12864.5" LogicalOp="Index Scan" NodeId="47" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="1.74812" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVCFX]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TMOV].[CODFILIAL] as [t].[CODFILIAL]=(1) AND [corporermaux].[dbo].[TMOV].[NUMEROMOV] as [t].[NUMEROMOV]='000002470'">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODFILIAL" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="NUMEROMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'000002470'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Bitmap>
</RelOp>
<RelOp AvgRowSize="13" EstimateCPU="0.0728523" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="27993.5" LogicalOp="Repartition Streams" NodeId="48" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.05218">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="22" EstimateCPU="0.169439" EstimateIO="0.689792" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="27993.5" LogicalOp="Index Scan" NodeId="49" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.859231" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVTMV]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="substring([corporermaux].[dbo].[TMOV].[CODTMV] as [t].[CODTMV],(1),(1))='1' AND PROBE([Bitmap1073],[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA],[corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV])">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Intrinsic FunctionName="substring">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODTMV" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Intrinsic FunctionName="PROBE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Bitmap1073" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Bitmap>
</RelOp>
<RelOp AvgRowSize="29" EstimateCPU="0.760717" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="307929" LogicalOp="Repartition Streams" NodeId="51" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="1.61847">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="29" EstimateCPU="0.169439" EstimateIO="0.68831" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="307929" LogicalOp="Index Scan" NodeId="52" Parallel="true" PhysicalOp="Index Scan" EstimatedTotalSubtreeCost="0.85775" TableCardinality="307929">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</OutputList>
<IndexScan Ordered="false" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCFO" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Index="[TXMOVCFO]" Alias="[t]" IndexKind="NonClustered" />
<Predicate>
<ScalarOperator ScalarString="PROBE([Bitmap1074],[corporermaux].[dbo].[TMOV].[CODCOLIGADA] as [t].[CODCOLIGADA],[corporermaux].[dbo].[TMOV].[IDMOV] as [t].[IDMOV])">
<Intrinsic FunctionName="PROBE">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Bitmap1074" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TMOV]" Alias="[t]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
<RelOp AvgRowSize="24" EstimateCPU="0.130287" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Repartition Streams" NodeId="60" Parallel="true" PhysicalOp="Parallelism" EstimatedTotalSubtreeCost="29.9475">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Parallelism PartitioningType="Hash">
<PartitionColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</PartitionColumns>
<RelOp AvgRowSize="33" EstimateCPU="0.954084" EstimateIO="28.4468" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="47796" LogicalOp="Clustered Index Scan" NodeId="61" Parallel="true" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="29.4009" TableCardinality="1734560">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="VALOR" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Index="[PKTTRBMOV]" Alias="[ttb]" IndexKind="Clustered" />
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[CODTRB] as [ttb].[CODTRB]='IPI'">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="CODTRB" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'IPI'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</IndexScan>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
<RelOp AvgRowSize="17" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="47577.3" EstimateRewinds="217.623" EstimateRows="1" LogicalOp="Index Seek" NodeId="63" Parallel="true" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="8.21071" TableCardinality="1395350">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</ColumnsWithNoStatistics>
</Warnings>
<IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Index="[TXIMVSEQ]" Alias="[tt]" IndexKind="NonClustered" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[IDMOV] as [ttb].[IDMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TTRBMOV].[NSEQITMMOV] as [ttb].[NSEQITMMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TTRBMOV]" Alias="[ttb]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
<RelOp AvgRowSize="26" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0.000796586" EstimateRewinds="47795" EstimateRows="1" LogicalOp="Clustered Index Seek" NodeId="65" Parallel="true" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="7.55967" TableCardinality="1395350">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</OutputList>
<IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="QUANTIDADE" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODUND" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Index="[PKTITMMOV]" Alias="[tt]" TableReferenceId="-1" IndexKind="Clustered" />
<SeekPredicates>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[CODCOLIGADA] as [tt].[CODCOLIGADA]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="CODCOLIGADA" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[IDMOV] as [tt].[IDMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="IDMOV" />
</Identifier>
</ScalarOperator>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TITMMOV].[NSEQITMMOV] as [tt].[NSEQITMMOV]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TITMMOV]" Alias="[tt]" Column="NSEQITMMOV" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
</SeekPredicates>
</IndexScan>
</RelOp>
</NestedLoops>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Merge>
</RelOp>
</Merge>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
</Hash>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Merge>
</RelOp>
</ComputeScalar>
</RelOp>
<RelOp AvgRowSize="16" EstimateCPU="0.00010028" EstimateIO="0.01" EstimateRebinds="235845" EstimateRewinds="55623100000" EstimateRows="1" LogicalOp="Lazy Spool" NodeId="83" Parallel="true" PhysicalOp="Table Spool" EstimatedTotalSubtreeCost="5607740">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</OutputList>
<Spool>
<RelOp AvgRowSize="20" EstimateCPU="0.0186357" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="84" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="33037.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="5.04667E-10" Output="1.00933E-09" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="20" EstimateCPU="0.0162503" EstimateIO="0" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1166.29" LogicalOp="Inner Join" NodeId="85" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="25986.2">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<NestedLoops Optimized="false">
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]<=[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]">
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
<RelOp AvgRowSize="11" EstimateCPU="0.0724197" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="86" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="20806.9">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="1.00933E-09" Output="5.04667E-10" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="11" EstimateCPU="0.0656624" EstimateIO="1.19695" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="87" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.12">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="15" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="88" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="2" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</TopSort>
</RelOp>
<RelOp AvgRowSize="20" EstimateCPU="0.0656624" EstimateIO="1.66613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="89" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.59">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="24" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="90" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</ColumnsWithNoStatistics>
</Warnings>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="VALORANTERIOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="1" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</TopSort>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</ComputeScalar>
</RelOp>
<RelOp AvgRowSize="16" EstimateCPU="0.00010028" EstimateIO="0.01" EstimateRebinds="235845" EstimateRewinds="55623100000" EstimateRows="1" LogicalOp="Lazy Spool" NodeId="95" Parallel="true" PhysicalOp="Table Spool" EstimatedTotalSubtreeCost="5607740">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</OutputList>
<Spool>
<RelOp AvgRowSize="20" EstimateCPU="0.0186357" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="96" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="33037.3">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="5.04667E-10" Output="1.00933E-09" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="20" EstimateCPU="0.0162503" EstimateIO="0" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1166.29" LogicalOp="Inner Join" NodeId="97" Parallel="true" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="25986.2">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<NestedLoops Optimized="false">
<Predicate>
<ScalarOperator ScalarString="[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]<=[corporermaux].[dbo].[historicoprecosprodutos].[idreajustepreco]">
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
<RelOp AvgRowSize="11" EstimateCPU="0.0724197" EstimateIO="0.0112613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="1" LogicalOp="TopN Sort" NodeId="98" Parallel="true" PhysicalOp="Sort" EstimatedTotalSubtreeCost="20806.9">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<MemoryFractions Input="1.00933E-09" Output="5.04667E-10" />
<TopSort Distinct="false" Rows="1">
<OrderBy>
<OrderByColumn Ascending="false">
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OrderByColumn>
</OrderBy>
<RelOp AvgRowSize="11" EstimateCPU="0.0656624" EstimateIO="1.19695" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="99" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.12">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="15" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="100" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="4" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</TopSort>
</RelOp>
<RelOp AvgRowSize="20" EstimateCPU="0.0656624" EstimateIO="1.66613" EstimateRebinds="235845" EstimateRewinds="0" EstimateRows="3887.63" LogicalOp="Eager Spool" NodeId="101" Parallel="true" PhysicalOp="Index Spool" EstimatedTotalSubtreeCost="1071.59">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Spool>
<SeekPredicateNew>
<SeekKeys>
<Prefix ScanType="EQ">
<RangeColumns>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</RangeColumns>
<RangeExpressions>
<ScalarOperator ScalarString="[corporermaux].[dbo].[TPRODUTODEF].[IDPRD]">
<Identifier>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[TPRODUTODEF]" Column="IDPRD" />
</Identifier>
</ScalarOperator>
</RangeExpressions>
</Prefix>
</SeekKeys>
</SeekPredicateNew>
<RelOp AvgRowSize="24" EstimateCPU="0.0673989" EstimateIO="0.610532" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="61129" LogicalOp="Table Scan" NodeId="102" Parallel="true" PhysicalOp="Table Scan" EstimatedTotalSubtreeCost="0.677931" TableCardinality="61129">
<OutputList>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</OutputList>
<Warnings>
<ColumnsWithNoStatistics>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</ColumnsWithNoStatistics>
</Warnings>
<TableScan Ordered="false" ForcedIndex="false" NoExpandHint="false">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="IDPRD" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="NOVOVALOR" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" Column="idreajustepreco" />
</DefinedValue>
</DefinedValues>
<Object Database="[corporermaux]" Schema="[dbo]" Table="[historicoprecosprodutos]" TableReferenceId="3" IndexKind="Heap" />
</TableScan>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</TopSort>
</RelOp>
</Spool>
</RelOp>
</NestedLoops>
</RelOp>
</ComputeScalar>
</RelOp>
</Parallelism>
</RelOp>
</Sort>
</RelOp>
</Parallelism>
</RelOp>
</ComputeScalar>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>

Gabrielsimas
   - 14 ago 2013

Fala aí Pávia, tudo bem?

Eu utilizei há um tempo atrás este tutorial que me ajudou muito

http://www.codeproject.com/Articles/9990/SQL-Tuning-Tutorial-Understanding-a-Database-Execu

Forte Abraço

Victor Pavia
   - 14 ago 2013

Bom pessoal,

É o seguinte:
Estava usando left join em uma tabela que não pode ter left join.
Mudei para inner join e funcionou.

Obrigado pela atenção.

Mariana Carvalho
   - 14 ago 2013


Citação:
Oi Vitor, boa tarde!!

Experimenta dar uma olhada no plano de execucao estimado no SSMS, ele devera indicar algum indice para vc criar que ajudara no desempenho.

nao cheguei a analisar o seu codigo.

por enquanto to meio correria... rsrsr


Obrigada Alex.

Alex Lekao
   - 14 ago 2013

Disponha Mariana!!!