ETL design question

  • Source: flat files (.txt and csv). Destination: a single SQL Server 2008RS2 table

    (1) I have straight across imported the flatfiles into SQL Server staging tables so that I can examine contents. For each flat file there is a staging table (1 to 1 relationship)

    (2) after examining staging tables a relational database schema has emerged indicating the flat files come from a relational database. Have found how to join up the flat files to generate the rows needed to populate the final destination table.

    (3) built a SELECT INTO query. The format of the ETL query is as follows:

    SELECT TOP 1000

    row1 based on logic,

    row2 based on logic and substring transformation,

    row3, row4, row 20, etc.

    INTO

    FROM

    <TABLES various JOINS>

    The above INSERT statement works ONLY if I constrain to 1000 rows. But, if I remove constraint it runs for hours and ultimately brings over no information.

    There are millions of rows against which I must run the query logic so that I bring over the data as needed and don't know how I would break up the source into 1000 row blocks. What approach to take or technology to use given volume of source data?

  • How many rows are we talking about here?

    How many flat files (aka how many joins)?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This is literally the query: 7 JOINS and millions of rows.

    --KEYWORDS

    SELECT TOP 1000

    publisher_name as account,

    reverse(left(reverse(publisher_name),(charindex('-',reverse(publisher_name),0))-2)) as publisher,

    C.campaign_id,

    channel_bing_pixel = CASE WHEN D.dimension_name = 'Channel_Bing_Pixel' then value END,

    google_conversion_label = CASE WHEN D.dimension_name = 'Channel_Google_ConversionLabel' then value END,

    updated_on = getdate(),

    created_on = getdate(),

    group_location_display_name = CASE when D.dimension_name = 'group_location_display_name' THEN value END,

    headline = NULL,

    K.keyword_url,

    REVERSE(LEFT(REVERSE(LEFT(K.keyword_url, CHARINDEX('&pcrid',K.keyword_url + '&pcrid')-1)),8)) as unique_id,

    K.keyword,

    G.group_name,

    FK.impressions,

    C.campaign_start_date as campaign_created_on,

    C.last_modified as campaign_updated_on,

    match_type = K.keyword_match_type,

    group_subdomain = CASE

    WHEN D.dimension_name = 'Group_Subdomain' THEN D.value

    ELSE 'UNKNOWN' END,

    group_care_types = CASE

    WHEN D.dimension_name = 'Group_Caretypes' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_type = CASE

    WHEN D.dimension_name = 'Group_Location_Type' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_county = CASE

    WHEN D.dimension_name = 'Group_Location_County' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_state = CASE

    WHEN D.dimension_name = 'Group_Location_State' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_city = CASE

    WHEN D.dimension_name = 'Group_Location_City' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_neighborhood = CASE

    WHEN D.dimension_name ='Group_Location_Neighborhood' THEN D.value

    ELSE 'UNKNOWN' END,

    group_location_class = CASE

    WHEN D.dimension_name ='Group_Keyword_Class' THEN D.value

    ELSE 'UNKNOWN' END,

    group_network = CASE

    WHEN D.dimension_name ='Group_Network' THEN D.value

    ELSE 'UNKNOWN' END,

    channel_phone_number = CASE

    WHEN D.dimension_name ='Channel_Phone_Number' THEN D.value

    ELSE 'UNKNOWN' END,

    C.campaign_name,

    C.campaign_status

    FROM [24632_settings_keyword] K

    JOIN [24632_settings_group] G ON K.group_id = G.group_id

    JOIN [24632_settings_campaign]C ON G.campaign_id = C.campaign_id

    JOIN [24632_settings_dimension] D ON G.group_id = D.object_id

    JOIN [24632_settings_creative] SC ON G.group_id = SC.group_id

    JOIN [24632_settings_placement] SP ON G.group_id = SP.group_id

    JOIN [dbo].[24632_settings_publisher] P on c.[marin_pca_id] = p.[marin_pca_id]

    --gets keyword impressions

    JOIN [24632_fact_keyword] FK ON K.group_id = FK.group_id

    UNION ALL X2

    to bring over Creatives and Impressions.

  • Time to take a look at the execution plan. Remove the TOP and get an estimated execution plan.

    Maybe you need some indexes to speed up the query.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • ok, I forgot to mention, I have definitely created indexes. This was necessary so that I could even run them as TOP 1000 queries. They are as follows.

    create index I_groupid on [24632_settings_group] (group_id);

    create index I_groupid on [24632_settings_keyword] (group_id);

    create index I_campaignid on [24632_settings_campaign] (campaign_id);

    create index I_creativeid on [24632_settings_creative] (creative_id);

    create index I_placementid on [24632_settings_placement] (placement_id);

    create index I_keywordid on [24632_settings_keyword] (keyword_id);

    create index I_creativeid on [24632_fact_creative] (creative_id);

    create index I_placementid on [24632_fact_placement] (placement_id);

    create index I_keywordid on [24632_fact_keyword] (keyword_id);

    create index I_marin_pca_id on [24632_settings_campaign] (marin_pca_id);

    create clustered index I_marin_pca_id ON [24632_settings_publisher] (marin_pca_id);

    create nonclustered index I_nc_groupid on [24632_settings_creative] (group_id);

    create nonclustered index I_nc_groupid on [24632_settings_placement] (group_id);

    create nonclustered index I_nc_groupid on [24632_settings_keyword] (group_id);

    create nonclustered index I_nc_groupid on [24632_fact_creative] (group_id);

    create nonclustered index I_nc_groupid on [24632_fact_placement] (group_id);

    create nonclustered index I_nc_groupid on [24632_fact_keyword] (group_id);

    Here's the estimated execution plan with the above indexes, without TOP 1000:

    <ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.1" Build="10.50.1600.1">

    <BatchSequence>

    <Batch>

    <Statements>

    <StmtSimple StatementText=" SELECT publisher_name as account, reverse(left(reverse(publisher_name),(charindex('-',reverse(publisher_name),0))-2)) as publisher, C.campaign_id, channel_bing_pixel = CASE WHEN D.dimension_name = 'Channel_Bing_Pixel' then value END, google_conversion_label = CASE WHEN D.dimension_name = 'Channel_Google_ConversionLabel' then value END, updated_on = getdate(), created_on = getdate(), group_location_display_name = CASE when D.dimension_name = 'group_location_display_name' THEN value END, headline = NULL, K.keyword_url, REVERSE(LEFT(REVERSE(LEFT(K.keyword_url, CHARINDEX('&pcrid',K.keyword_url + '&pcrid')-1)),8)) as unique_id, K.keyword, G.group_name, FK.impressions, C.campaign_start_date as campaign_created_on, C.last_modified as campaign_updated_on, match_type = K.keyword_match_type, group_subdomain = CASE WHEN D.dimension_name = 'Group_Subdomain' THEN D.value ELSE 'UNKNOWN' END, group_care_types = CASE WHEN D.dimension_name = 'Group_Caretypes' THEN D.value ELSE 'UNKNOWN' END, group_location_type = CASE WHEN D.dimension_name = 'Group_Location_Type' THEN D.value ELSE 'UNKNOWN' END, group_location_county = CASE WHEN D.dimension_name = 'Group_Location_County' THEN D.value ELSE 'UNKNOWN' END, group_location_state = CASE WHEN D.dimension_name = 'Group_Location_State' THEN D.value ELSE 'UNKNOWN' END, group_location_city = CASE WHEN D.dimension_name = 'Group_Location_City' THEN D.value ELSE 'UNKNOWN' END, group_location_neighborhood = CASE WHEN D.dimension_name ='Group_Location_Neighborhood' THEN D.value ELSE 'UNKNOWN' END, group_location_class = CASE WHEN D.dimension_name ='Group_Keyword_Class' THEN D.value ELSE 'UNKNOWN' END, group_network = CASE WHEN D.dimension_name ='Group_Network' THEN D.value ELSE 'UNKNOWN' END, channel_phone_number = CASE WHEN D.dimension_name ='Channel_Phone_Number' THEN D.value ELSE 'UNKNOWN' END, C.campaign_name, C.campaign_status FROM [24632_settings_keyword] K JOIN [24632_settings_group] G ON K.group_id = G.group_id JOIN [24632_settings_campaign]C ON G.campaign_id = C.campaign_id JOIN [24632_settings_dimension] D ON G.group_id = D.object_id JOIN [24632_settings_creative] SC ON G.group_id = SC.group_id JOIN [24632_settings_placement] SP ON G.group_id = SP.group_id JOIN [dbo].[24632_settings_publisher] P on c.[marin_pca_id] = p.[marin_pca_id] --gets keyword impressions JOIN [24632_fact_keyword] FK ON K.group_id = FK.group_id " StatementId="1" StatementCompId="1" StatementType="SELECT" StatementSubTreeCost="500.325" StatementEstRows="1" StatementOptmLevel="FULL" QueryHash="0x836A5756741E818D" QueryPlanHash="0xFF08338B650D8513">

    <StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false" />

    <QueryPlan CachedPlanSize="208" CompileTime="1428" CompileCPU="1427" CompileMemory="23000">

    <MissingIndexes>

    <MissingIndexGroup Impact="86.9351">

    <MissingIndex Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]">

    <ColumnGroup Usage="EQUALITY">

    <Column Name="[object_id]" ColumnId="3" />

    </ColumnGroup>

    <ColumnGroup Usage="INCLUDE">

    <Column Name="[dimension_name]" ColumnId="5" />

    <Column Name="[value]" ColumnId="6" />

    </ColumnGroup>

    </MissingIndex>

    </MissingIndexGroup>

    </MissingIndexes>

    <RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="72094" EstimatedTotalSubtreeCost="500.325" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1024" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1027" />

    <ColumnReference Column="Expr1028" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1030" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1027" />

    <ScalarOperator ScalarString="getdate()">

    <Identifier>

    <ColumnReference Column="ConstExpr1042">

    <ScalarOperator>

    <Intrinsic FunctionName="getdate" />

    </ScalarOperator>

    </ColumnReference>

    </Identifier>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1028" />

    <ScalarOperator ScalarString="getdate()">

    <Identifier>

    <ColumnReference Column="ConstExpr1043">

    <ScalarOperator>

    <Intrinsic FunctionName="getdate" />

    </ScalarOperator>

    </ColumnReference>

    </Identifier>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1030" />

    <ScalarOperator ScalarString="NULL">

    <Const ConstValue="NULL" />

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="72074" EstimatedTotalSubtreeCost="500.325" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1024" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1024" />

    <ScalarOperator ScalarString="reverse(substring(reverse([CampaignManagement].[dbo].[24632_settings_publisher].[publisher_name] as [P].[publisher_name]),(1),charindex(N'-',reverse([CampaignManagement].[dbo].[24632_settings_publisher].[publisher_name] as [P].[publisher_name]),(0))-(2)))">

    <Intrinsic FunctionName="reverse">

    <ScalarOperator>

    <Intrinsic FunctionName="substring">

    <ScalarOperator>

    <Intrinsic FunctionName="reverse">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    </Identifier>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(1)" />

    </ScalarOperator>

    <ScalarOperator>

    <Arithmetic Operation="SUB">

    <ScalarOperator>

    <Intrinsic FunctionName="charindex">

    <ScalarOperator>

    <Const ConstValue="N'-'" />

    </ScalarOperator>

    <ScalarOperator>

    <Intrinsic FunctionName="reverse">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    </Identifier>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(0)" />

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(2)" />

    </ScalarOperator>

    </Arithmetic>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="2" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="69072" EstimatedTotalSubtreeCost="500.325" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Column="Bmk1018" />

    </OuterReferences>

    <RelOp NodeId="3" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="66078" EstimatedTotalSubtreeCost="500.322" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    <ColumnReference Column="Bmk1018" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="marin_pca_id" />

    </OuterReferences>

    <RelOp NodeId="4" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="66074" EstimatedTotalSubtreeCost="500.319" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="marin_pca_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Column="Bmk1006" />

    </OuterReferences>

    <RelOp NodeId="5" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="54069" EstimatedTotalSubtreeCost="500.315" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Column="Bmk1006" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    </OuterReferences>

    <RelOp NodeId="6" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="54061" EstimatedTotalSubtreeCost="500.312" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Column="Bmk1021" />

    </OuterReferences>

    <RelOp NodeId="7" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="51067" EstimatedTotalSubtreeCost="500.309" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Column="Bmk1021" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="0">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </OuterReferences>

    <RelOp NodeId="8" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="51063" EstimatedTotalSubtreeCost="500.305" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1031" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1031" />

    <ScalarOperator ScalarString="reverse(substring(reverse(substring([CampaignManagement].[dbo].[24632_settings_keyword].[keyword_url] as [K].[keyword_url],(1),charindex(N'&pcrid',[CampaignManagement].[dbo].[24632_settings_keyword].[keyword_url] as [K].[keyword_url]+N'&pcrid')-(1))),(1),(8)))">

    <Intrinsic FunctionName="reverse">

    <ScalarOperator>

    <Intrinsic FunctionName="substring">

    <ScalarOperator>

    <Intrinsic FunctionName="reverse">

    <ScalarOperator>

    <Intrinsic FunctionName="substring">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(1)" />

    </ScalarOperator>

    <ScalarOperator>

    <Arithmetic Operation="SUB">

    <ScalarOperator>

    <Intrinsic FunctionName="charindex">

    <ScalarOperator>

    <Const ConstValue="N'&pcrid'" />

    </ScalarOperator>

    <ScalarOperator>

    <Arithmetic Operation="ADD">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'&pcrid'" />

    </ScalarOperator>

    </Arithmetic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="" />

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(1)" />

    </ScalarOperator>

    </Arithmetic>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(1)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(8)" />

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="9" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="51053" EstimatedTotalSubtreeCost="500.305" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="1">

    <OuterReferences>

    <ColumnReference Column="Bmk1000" />

    </OuterReferences>

    <RelOp NodeId="11" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0.097311" AvgRowSize="42055" EstimatedTotalSubtreeCost="500.302" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    <ColumnReference Column="Expr1067" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1067" />

    <ScalarOperator ScalarString="BmkToPage([Bmk1000])">

    <Intrinsic FunctionName="BmkToPage">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Column="Bmk1000" />

    </Identifier>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="12" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="0.097311" AvgRowSize="42055" EstimatedTotalSubtreeCost="500.302" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="1" WithUnorderedPrefetch="1">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1066" />

    </OuterReferences>

    <RelOp NodeId="15" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="23280.2" EstimateIO="0" EstimateCPU="0.097311" AvgRowSize="42046" EstimatedTotalSubtreeCost="496.256" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="1" WithUnorderedPrefetch="1">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1065" />

    </OuterReferences>

    <RelOp NodeId="18" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="9871.56" EstimateIO="0" EstimateCPU="0.0412631" AvgRowSize="42046" EstimatedTotalSubtreeCost="494.316" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="1" WithUnorderedPrefetch="1">

    <OuterReferences>

    <ColumnReference Column="Bmk1003" />

    <ColumnReference Column="Expr1064" />

    </OuterReferences>

    <RelOp NodeId="21" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="9871.56" EstimateIO="0" EstimateCPU="0.0429358" AvgRowSize="39048" EstimatedTotalSubtreeCost="492.615" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1003" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    <ColumnReference Column="Expr1063" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1063" />

    <ScalarOperator ScalarString="BmkToPage([Bmk1003])">

    <Intrinsic FunctionName="BmkToPage">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Column="Bmk1003" />

    </Identifier>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="22" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="9871.56" EstimateIO="0" EstimateCPU="0.0429358" AvgRowSize="39048" EstimatedTotalSubtreeCost="492.615" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1003" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <NestedLoops Optimized="1" WithUnorderedPrefetch="1">

    <OuterReferences>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1062" />

    </OuterReferences>

    <RelOp NodeId="25" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="10271.7" EstimateIO="0" EstimateCPU="133.291" AvgRowSize="39040" EstimatedTotalSubtreeCost="490.831" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <MemoryFractions Input="1" Output="0.0362504" />

    <Hash>

    <DefinedValues />

    <HashKeysBuild>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </HashKeysBuild>

    <HashKeysProbe>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="object_id" />

    </HashKeysProbe>

    <ProbeResidual>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_dimension].[object_id] as [D].[object_id]=[CampaignManagement].[dbo].[24632_settings_placement].[group_id] as [SP].[group_id]">

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="object_id" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </Identifier>

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </ProbeResidual>

    <RelOp NodeId="26" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="10443" EstimateIO="0.020162" EstimateCPU="0.0116443" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0318063" TableCardinality="10443" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </OutputList>

    <IndexScan Ordered="0" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Index="[I_nc_groupid]" Alias="[SP]" IndexKind="NonClustered" />

    </IndexScan>

    </RelOp>

    <RelOp NodeId="27" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="2.03675e+007" EstimateIO="0" EstimateCPU="2.03675" AvgRowSize="39040" EstimatedTotalSubtreeCost="357.509" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="object_id" />

    <ColumnReference Column="Expr1025" />

    <ColumnReference Column="Expr1026" />

    <ColumnReference Column="Expr1029" />

    <ColumnReference Column="Expr1032" />

    <ColumnReference Column="Expr1033" />

    <ColumnReference Column="Expr1034" />

    <ColumnReference Column="Expr1035" />

    <ColumnReference Column="Expr1036" />

    <ColumnReference Column="Expr1037" />

    <ColumnReference Column="Expr1038" />

    <ColumnReference Column="Expr1039" />

    <ColumnReference Column="Expr1040" />

    <ColumnReference Column="Expr1041" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Expr1025" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Channel_Bing_Pixel' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE NULL END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Channel_Bing_Pixel'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="NULL" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1026" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Channel_Google_ConversionLabel' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE NULL END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Channel_Google_ConversionLabel'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="NULL" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1029" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'group_location_display_name' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE NULL END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'group_location_display_name'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="NULL" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1032" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Subdomain' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Subdomain'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1033" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Caretypes' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Caretypes'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1034" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Location_Type' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Location_Type'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1035" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Location_County' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Location_County'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1036" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Location_State' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Location_State'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1037" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Location_City' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Location_City'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1038" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Location_Neighborhood' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Location_Neighborhood'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1039" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Keyword_Class' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Keyword_Class'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1040" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Group_Network' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Group_Network'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="Expr1041" />

    <ScalarOperator ScalarString="CASE WHEN [CampaignManagement].[dbo].[24632_settings_dimension].[dimension_name] as [D].[dimension_name]=N'Channel_Phone_Number' THEN [CampaignManagement].[dbo].[24632_settings_dimension].[value] as [D].[value] ELSE N'UNKNOWN' END">

    <IF>

    <Condition>

    <ScalarOperator>

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="N'Channel_Phone_Number'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Condition>

    <Then>

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </Identifier>

    </ScalarOperator>

    </Then>

    <Else>

    <ScalarOperator>

    <Const ConstValue="N'UNKNOWN'" />

    </ScalarOperator>

    </Else>

    </IF>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp NodeId="28" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="2.03675e+007" EstimateIO="333.068" EstimateCPU="22.4043" AvgRowSize="6017" EstimatedTotalSubtreeCost="355.472" TableCardinality="2.03675e+007" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="object_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </OutputList>

    <TableScan Ordered="0" ForcedIndex="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="object_id" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="dimension_name" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" Column="value" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_dimension]" Alias="[D]" IndexKind="Heap" />

    </TableScan>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    </Hash>

    </RelOp>

    <RelOp NodeId="57" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="19" EstimatedTotalSubtreeCost="1.74131" TableCardinality="1.65217e+006" Parallel="0" EstimateRebinds="9465.18" EstimateRewinds="805.537">

    <OutputList>

    <ColumnReference Column="Bmk1003" />

    </OutputList>

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1003" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Index="[I_groupid]" Alias="[G]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_placement].[group_id] as [SP].[group_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    <RelOp NodeId="62" PhysicalOp="RID Lookup" LogicalOp="RID Lookup" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="3015" EstimatedTotalSubtreeCost="1.65961" TableCardinality="1.65217e+006" Parallel="0" EstimateRebinds="9559.82" EstimateRewinds="310.734">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    </OutputList>

    <IndexScan Lookup="1" Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="group_name" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="Bmk1003" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[Bmk1003]">

    <Identifier>

    <ColumnReference Column="Bmk1003" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="68" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="2.35831" EstimateIO="0.003125" EstimateCPU="0.000159594" AvgRowSize="9" EstimatedTotalSubtreeCost="1.84262" TableCardinality="3.26655e+006" Parallel="0" EstimateRebinds="9034.03" EstimateRewinds="836.53">

    <OutputList />

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues />

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_creative]" Index="[I_nc_groupid]" Alias="[SC]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_creative]" Alias="[SC]" Column="group_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_placement].[group_id] as [SP].[group_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="69" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="15" EstimatedTotalSubtreeCost="3.94862" TableCardinality="7.11468e+006" Parallel="0" EstimateRebinds="21206.4" EstimateRewinds="2072.78">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    </OutputList>

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1000" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Index="[I_groupid]" Alias="[K]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="group_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_placement].[group_id] as [SP].[group_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    <RelOp NodeId="74" PhysicalOp="RID Lookup" LogicalOp="RID Lookup" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="9015" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="7.11468e+006" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    </OutputList>

    <IndexScan Lookup="1" Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_match_type" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" Column="keyword_url" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_keyword]" Alias="[K]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="Bmk1000" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[Bmk1000]">

    <Identifier>

    <ColumnReference Column="Bmk1000" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    <RelOp NodeId="85" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="15" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="181604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1021" />

    </OutputList>

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1021" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Index="[I_nc_groupid]" Alias="[FK]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="group_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_placement].[group_id] as [SP].[group_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_placement]" Alias="[SP]" Column="group_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="87" PhysicalOp="RID Lookup" LogicalOp="RID Lookup" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="3011" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="181604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    </OutputList>

    <IndexScan Lookup="1" Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" Column="impressions" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_fact_keyword]" Alias="[FK]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="Bmk1021" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[Bmk1021]">

    <Identifier>

    <ColumnReference Column="Bmk1021" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="91" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="19" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="718" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1006" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    </OutputList>

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1006" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Index="[I_campaignid]" Alias="[C]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_group].[campaign_id] as [G].[campaign_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_group]" Alias="[G]" Column="campaign_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="93" PhysicalOp="RID Lookup" LogicalOp="RID Lookup" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="12021" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="718" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="marin_pca_id" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    </OutputList>

    <IndexScan Lookup="1" Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="marin_pca_id" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_name" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_status" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="campaign_start_date" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="last_modified" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="Bmk1006" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[Bmk1006]">

    <Identifier>

    <ColumnReference Column="Bmk1006" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="105" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="15" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="20" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Column="Bmk1018" />

    </OutputList>

    <IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1018" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Index="[I_marin_pca_id]" Alias="[P]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="marin_pca_id" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[CampaignManagement].[dbo].[24632_settings_campaign].[marin_pca_id] as [C].[marin_pca_id]">

    <Identifier>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_campaign]" Alias="[C]" Column="marin_pca_id" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <RelOp NodeId="107" PhysicalOp="RID Lookup" LogicalOp="RID Lookup" EstimateRows="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="3011" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="20" Parallel="0" EstimateRebinds="1.49012e-008" EstimateRewinds="0">

    <OutputList>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    </OutputList>

    <IndexScan Lookup="1" Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" NoExpandHint="0">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" Column="publisher_name" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[CampaignManagement]" Schema="[dbo]" Table="[24632_settings_publisher]" Alias="[P]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="Bmk1018" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[Bmk1018]">

    <Identifier>

    <ColumnReference Column="Bmk1018" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    </QueryPlan>

    </StmtSimple>

    </Statements>

    </Batch>

    </BatchSequence>

    </ShowPlanXML>

    Does this execution plan say anything to you? Nothing to me so ofcourse I have something to learn. However, it will be a great help to know indexing is the best way to spend my time and not some other course of action. Thanks in advance for you advice Koen.

  • After looking 5 seconds at your execution plan:

    * you get a hint for a missing index. It's on a table that currently has a table scan with a cost of 71%

    * there are a lot of RID Lookups in the plan. Avoid those by using INCLUDE columns on your indexes.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • OK. The key here is you're telling me that indexing is how I solve this particular ETL problem.

    Thanks and I'm on my way to reading all about and implementing indexing to make this ETL work.

    If anyone else wants to look at it for 5 seconds and finds obvious types of indexes that could help speed up this query, then I'd appreciate it because it's very new territory for me.

  • KoldCoffee (10/14/2014)


    OK. The key here is you're telling me that indexing is how I solve this particular ETL problem.

    Yes, because adding 1 index and tuning 6 other existing indexes by adding included columns is not a lot of work and it might solve your problem right away. Other options would take considerably more time.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Awesome! I'm on the logical path. That's what I needed, because I was totally not sure about how to properly address this.

  • I see only "JOIN" so that's INNER JOINs on all your tables i.e. if one is missing a record then nothing returns for that whole output row.

    I would use LEFT OUTER JOIN to ensure I could at least get a record for every campaign or whatever you want the main focus to be.

  • I notice you have at least one duplicate index in your list. It won't make much difference to how quick your query runs, but it will slow down inserts, updates, index maintenance and backups, as well as using up disk space that you could be deploying elsewhere.

    John

  • our communal downlevel was blown away yesterday so am re - importing the flat files to sql before can use this info.

    Heartened by all the support. Can't wait to make the changes and see how the query responds.

  • Hi, just want to let you know that I got around to reimporting my files and on to adding indexes to the resulting tables which comprised a schema.

    The suggestions offered here gave me the confidence and clues I needed to move forward with idea of indexing and even what kind of indexes (include).

    In the end I have a very query-able set of imported tables. Thanks for all the help here.

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply