NULL THEN @PeriodEnd ELSE [Austritt_Kostenstelle] END GROUP BY Kostenstelle.Abteilung_ID - -- --SNIP- -- -- This works perfectly on database servers 2000 and 2005! Okay, let's execute this command with sp_executesql: - -- --SNIP- -- -- declare @PeriodBegin sp_executesql structure. So, I'm running into heavy performance issues which break down our current database solution. :( Sounds like you might have a bad plan cached. Can you try adding OPTION QueryPlan CachedPlanSize = "94" CompileTime = "321" CompileCPU = "306" CompileMemory = "1384"> <MissingIndexes> <MissingIndexGroup Impact = "8.43038"> <MissingIndex Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Sitzung]"> <ColumnGroup Usage = "INEQUALITY"> <Column Name = "[Dauer]" ColumnId = "7" / > < / ColumnGroup> <ColumnGroup 0.0399058" AvgRowSize = "17" EstimatedTotalSubtreeCost = "0.76535" Parallel = "0" EstimateRebinds = "0" EstimateRewinds = "0"> <OutputList> <ColumnReference Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Kostenstelle]" Column = "Abteilung_ID" / > <ColumnReference Column = "Expr1018" / > < / OutputList> <MemoryFractions Input = "0" Output ScalarOperator ScalarString = "SUM([KVP_DB].[dbo].[Sitzung].[Dauer])"> <Aggregate Distinct = "0" AggType = "SUM"> <ScalarOperator> <Identifier> <ColumnReference Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Sitzung]" Column = "Dauer" / > < / Identifier> < / ScalarOperator> < / Aggregate> < / ScalarOperator> < / DefinedValue> < / DefinedValues> <HashKeysBuild> <ColumnReference Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Kostenstelle]" Column = "Abteilung_ID" / > < / HashKeysBuild> <RelOp NodeId = "1" PhysicalOp = "Hash Match" LogicalOp 0.242801" AvgRowSize = "17" EstimatedTotalSubtreeCost = "0.725445" Parallel = "0" EstimateRebinds = "0" EstimateRewinds = "0"> <OutputList> <ColumnReference Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Sitzung]" Column = "Dauer" / > <ColumnReference Database = "[KVP_DB]" Schema = "[dbo]" Table = "[Kostenstelle]" Column = "Abteilung_ID" / > < / OutputList> <MemoryFractions Input = "0.746269" Output = "0.746269
be greatly appreciated. Thanks in advance. Server: Msg 8999, Level 16, State 1, Line 1 Database tempdb allocation errors prevent further CHECKDB processing. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:87) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:103) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:104) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:107) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:109) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:111) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was ALLOCATED 0_PCT_FULL'. Server: Msg 8906, Level 16, State 1, Line 1 Page (1:114) in database ID 2 is allocated in the SGAM (1:3) and PFS (1:1), but was
example in the article. I then reproduced the experiment of your article in the AdventureWorks database and ran the query Q1, making sure that all indices for the xml columns had Schema = 3D"[dbo]" Table = 3D"[AttributesNameValue]" Alias = 3D"[ANV]" Column = 3D"AttributeId" / > NoExpandHint = 3D"0"> Database = 3D"[AdventureWorks]" Schema = 3D"[dbo]" Table = 3D"[AttributesNameValue]" Alias = 3D"[ANV]" Column = 3D"AttributeId" / > Schema 3D"14" EstimatedTotalSubtreeCost = 3D"31.7678" Parallel = 3D"1" EstimateRebinds = 3D"19971" EstimateRewinds = 3D"0"> Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[attribute:1]" Column = 3D"id" / > Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[value:4]" Column = 3D"id Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[value:4]" Column = 3D"pk1 3D"23" EstimatedTotalSubtreeCost = 3D"24.5263" Parallel = 3D"1" EstimateRebinds = 3D"19971" EstimateRewinds = 3D"0"> Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[attribute:1]" Column = 3D"id" / > Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[value:4]" Column = 3D"id Database = 3D"[AdventureWorks]" Schema = 3D"[sys]" Table = 3D"[xml_index_nodes_2091154495_32000]" Alias = 3D"[value:4]" Column = 3D"pk1