Skip to content

Instantly share code, notes, and snippets.

View jjradha's full-sized avatar

Marcello Miorelli jjradha

View GitHub Profile
<?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.2" Build="11.0.3412.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="7" StatementEstRows="175.59" StatementId="1" StatementOptmLevel="TRIVIAL" StatementSubTreeCost="0.0136683" StatementText="INSERT INTO @tmp&#xD;&#xA; SELECT strBxOrderNo&#xD;&#xA; ,sintReturnId&#xD;&#xA; FROM TABLEBACKUPS.dbo.tblBReturnHistory rh&#xD;&#xA; WHERE rh.sintReturnStatusId in ( 3 )&#xD;&#xA; AND rh.dtmAdded &gt;= @OrderStartDate&#xD;&#xA; AND rh.dtmAdded &lt; @OrderEndDate&#xD;&#xA;&#xD;&#xA;" StatementType="INSERT" QueryHash="0x7EEE3E7E1BB16CBA" QueryPlanHash="0x7B47810B99B185EE" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="f
exec sp_reset_connection
go
declare @p5 int
set @p5=86400
exec dbo.udpProductBulletPointSelectByTier1NoteTypeCode @Tier1=N'WO029',@LanguageID=2,@SeasonItemID=N'16HSM',@ListNoteTypeCode=N'',@CacheDuration=@p5 output
select @p5
go
exec sp_reset_connection
go
declare @p5 int
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="2" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.00657048" StatementText="select&#xD;&#xA; t2.Tier1 as [StyleCode],&#xD;&#xA; t2.Tier1Descr as [StyleDescription],&#xD;&#xA; coalesce(t1.URL, t2.URL) as [StyleUrl],&#xD;&#xA; t2.Tier2 as [ColourCode],&#xD;&#xA; t2.Tier2Descr as [ColourDescription],&#xD;&#xA; t2.URL as [ColourUrl],&#xD;&#xA; t2.ClassID,&#xD;&#xA; t2.SegmentID,&#xD;&#xA; t2.GroupID,&#xD;&#xA;
@jjradha
jjradha / query plan procedure dbo.udpProductBulletPointSelectByTier1NoteTypeCode.xml
Created August 3, 2016 13:53
query plan procedure dbo.udpProductBulletPointSelectByTier1NoteTypeCode
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="8" StatementEstRows="60" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="70" StatementSubTreeCost="123.48" StatementText="insert into @NoteTypeCodeTable ( NoteTypeCode ) &#xD;&#xA; select BulletPoint.NoteTypeCode.value('.', 'varchar(50)') as NoteTypeCode &#xD;&#xA; from @ListNoteTypeCodeXml.nodes('/BulletPoint/NoteTypeCode') as BulletPoint ( NoteTypeCode )" StatementType="INSERT" QueryHash="0x3A3C4752330FF5F1" QueryPlanHash="0xCEDD1B1B9CDA6E3C" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="fa
PRINT 'THE SERVER IS ' + @@SERVERNAME
--select db_name()
PRINT 'THE DATABASE IS ' + db_NAME()
PRINT ''
GO
USE [master]
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="4" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.0259727" StatementText="INSERT INTO @Addresses(TaxRegionId)&#xD;&#xA;SELECT DISTINCT TaxRegionId&#xD;&#xA;FROM dbo.[ShipTaxAddress]&#xD;&#xA;WHERE [CountryCode] = @countryCode&#xD;&#xA;AND [AddressFormatID] = @addressFormatID&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(50),[MatchAddressLine1]), ISNULL(@addressLine1, '')) = ISNULL(@addressLine1, '')&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(50),[MatchAddressLine2]), ISNULL(@addressLine2, '')) = ISNULL(@addressLine2, '')&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="4" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.0259727" StatementText="INSERT INTO @Addresses(TaxRegionId)&#xD;&#xA;SELECT DISTINCT TaxRegionId&#xD;&#xA;FROM dbo.[ShipTaxAddress]&#xD;&#xA;WHERE [CountryCode] = @countryCode&#xD;&#xA;AND [AddressFormatID] = @addressFormatID&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(50),[MatchAddressLine1]), ISNULL(@addressLine1, '')) = ISNULL(@addressLine1, '')&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(50),[MatchAddressLine2]), ISNULL(@addressLine2, '')) = ISNULL(@addressLine2, '')&#xD;&#xA;AND ISNULL (CONVERT(nvarchar(
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="10" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.00657344" StatementText="SELECT TOP 1 ISNULL(pst.TaxCode, '') as TaxCode&#xD;&#xA; , ISNULL(pst.TaxRate, 0) as TaxRate&#xD;&#xA;FROM dbo.[ProductShipTax] pst&#xD;&#xA;WHERE EXISTS (&#xD;&#xA;&#xD;&#xA; SELECT TaxRegionId&#xD;&#xA; FROM dbo.[ShipTaxAddress]&#xD;&#xA; WHERE [CountryCode] = @countryCode&#xD;&#xA; AND [AddressFormatID] = @addressFormatID&#xD;&#xA;&#xD;&#xA; AND ([MatchAddressLine1] = @AddressLine1 OR ([MatchAddressLine1] IS NULL AND @AddressLine1 IS NULL) )&
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="7" StatementEstRows="1000070" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="120" StatementSubTreeCost="24.5016" StatementText="select t.*&#xD;&#xA;from RADHE_01 t&#xD;&#xA;where t.MYXML.exist('*') = 0 OR t.MYXML IS NULL" StatementType="SELECT" QueryHash="0x78CFEF157D3D2516" QueryPlanHash="0x831670FA8C31EE5A" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="24" CompileTime="1" CompileCPU="1" CompileMemory="312">
<?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.2" Build="12.0.2000.8" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="1" StatementEstRows="15" StatementId="1" StatementOptmLevel="TRIVIAL" CardinalityEstimationModelVersion="120" StatementSubTreeCost="0.0032985" StatementText="select [name] from italian_cities&#xD;&#xA;order by [name] desc" StatementType="SELECT" QueryHash="0xDAAE8C127A4785E4" QueryPlanHash="0xB60E0157D0A84290" RetrievedFromCache="true">
<StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
<QueryPlan DegreeOfParallelism="1" CachedPlanSize="16" CompileTime="0" CompileCPU="0" CompileMemory="88">
<MemoryGrantInfo SerialReq