![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
--Compute Scalar(DEFINE [Expr1002]=Convert([globalagg1004])))--Stream Aggregate(DEFINE [globalagg1004]=SUM([partialagg1003])))--Parallelism(Gather Streams) --Merge Join(Inner Join, MERGE [G].[HANDLE])=([E].[GUIA]), RESIDUAL [G].[HANDLE]=[E].[GUIA]))--Parallelism(Distribute Streams, PARTITION COLUMNS: ([G].[HANDLE])) |--Index Seek(OBJECT [Saude].[dbo].[SAM_GUIA].[AX_1603PEG] AS [G]), SEEK [G].[PEG]=736740) ORDERED FORWARD)--Sort(ORDER BY [E].[GUIA] ASC))--Hash Match(Aggregate, HASH [E].[GUIA]),RESIDUAL [E].[GUIA]=[E].[GUIA]) DEFINE [partialagg1003]=COUNT(*)))--Parallelism(Repartition Streams, PARTITION COLUMNS [E].[GUIA]))--Clustered Index Scan(OBJECT [Saude]..[dbo].[SAM_GUIA_EVENTOS].[PK__SAM_GUIA_EVENTOS__68736660] AS [E]), WHERE |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I have one query that executes many times in a week. I created one Maintenances plan that Rebuild all index in my Database that has been executed at 23:40 Saturday until stop finished at Sunday. However at middle of week (Wednesday or Thursday), that query don't return result like that must be. The time exceeded and the result are total wrong. I compare the normal executed plan and the "crazy" one that SQL create to mount result. The normal is nested with index seek (very fast, the wrong is Merger with hash aggregate (very slow). After Index Rebuild, the executed plan bring result that must be, but when the merge plan are executed with many updates on that tables (SAM_GUIA_EVENTO and SAM_GUIA), at middle of week, the result are total wrong, with many rows back. I recommended Index Seek force by coalesce function on one column aggregate, but everyone here were very panic with that behavior of SQL Server. |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
The real problem is incorret result. I can´t rebuild index on these two table , because our scenario works 24 hours by day. These table are too big (17 Gbytes one and 4 Gbytes other), with many Index. The Index Rebuild only can do at weekends. I intend to eliminated some Index that are redundant(I just begun), but that bug is very crazy. That became SQL Server not a good solution for OLTP that grows up strongly. I saw many scenarios like that...bad performance when the Database became too large. |
![]() |
| Thread Tools | |
| Display Modes | |
| |