Viewing 15 posts - 8,296 through 8,310 (of 22,219 total)
Since you've posted this question to a second location, we're now getting into cross-chatter. I made several recommendations over there for how to fix it. It depends on your data,...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 7:47 am
Ha! In short, no, it doesn't "stay shrunk". As you add data (or junk mail) to the system, it's going to need to grow to contain that additional data. You...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 7:43 am
scott_lotus (4/30/2014)
That is an interesting comment. I had read in the past to avoid creating your own indexes because DTA was more likely to do it correctly.
I would love to...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 7:13 am
OK. Please follow my advice about investigating the execution plans.
Modifying the query will cause a recompile. But you also get recompiles from other sources. You can get a recompile because...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 6:20 am
I strongly recommend looking over the execution plan for the query and do your own investigation and tuning. The DTA is notorious for making poor choices at times and you...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 6:16 am
You've conflated rows with pages. The number of rows doesn't really matter. It's the number of pages that affects how index defragmentation occurs within the index. If the index is...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 5:08 am
Pretty sure Koen has nailed it already. The JOIN is likely to change the order in which data is retrieved, so a sort operation will be necessary.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 5:04 am
It sounds like you're hitting bad parameter sniffing. But, without seeing the "good" and "bad" execution plans, it's hard to know for sure. You need to capture both plans and...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 5:02 am
mister.magoo (4/29/2014)
Grant Fritchey (4/29/2014)
Try using the WAITFOR command in T-SQL. That'll pause the execution of the query and you should see a timeout.
Except that will be a Command Timeout, not...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 2:49 am
Assuming you don't have throttling enabled and just have the default group, you can get it from here:
SELECT * FROM sys.dm_os_performance_counters AS dopc
WHERE dopc.counter_name = 'cpu usage %'
AND dopc.instance_name =...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 2:36 am
According to the statistics you're moving 197 million rows with no where clause. Don't bother with an index. It won't do any good. As currently built out, there's almost nothing...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 2:30 am
Yeah, but that's index fragmentation. Shrinking and growing a database file fragments at the OS level. There's a decent little article about how to look at this over here at...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 29, 2014 at 3:47 pm
TheSQLGuru (4/29/2014)
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 29, 2014 at 3:42 pm
Try using the WAITFOR command in T-SQL. That'll pause the execution of the query and you should see a timeout.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 29, 2014 at 3:38 pm
You can get the plan_handle by querying sys.dm_exec_query_stats or sys.dm_exec_proc_stats if it's a stored procedure. If you need to use sys.dm_exec_query_stats, you can combine it with sys.dm_exec_sql_text in order to...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 29, 2014 at 3:37 pm
Viewing 15 posts - 8,296 through 8,310 (of 22,219 total)