Viewing 15 posts - 20,596 through 20,610 (of 22,226 total)
Bummer. Then you'll need to create a compound index, at least based on my tests. The query is basically OK (since you fixed the implicit data conversion, those things will...
"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 24, 2008 at 6:33 am
Start here. Then try here. Then go here. You could also do a search of articles here at SQL Server Central.
"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 24, 2008 at 6:30 am
I'd check to see if you've got open connections and possibly uncommitted transactions. For it to just degrade linearly over time means that resources are being consumed and not released....
"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 24, 2008 at 6:25 am
Absolutely. If you can't find a local copy of books online, you can refer to them at MSDN.
"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 24, 2008 at 6:19 am
No, based on the data I tested with, 1000 rows not 7 million, the date column alone didn't supply a selective enough non-clustered index for the optimizer to choose it...
"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 24, 2008 at 6:16 am
I thought I had seen that 10% number too. Here's where it's referenced.
"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 24, 2008 at 6:11 am
You've effectively got a cursor going on with that query running in the SELECT statement. I'd try it like this:
SELECT a.OrderID
,a.UniqueID
...
"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 24, 2008 at 5:34 am
I don't know about the DBCC thing. Sorry.
It sounds like you've got a CREATE statement inside your procedure definition. That's a problem. You'll need to remove that.
"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 23, 2008 at 9:06 am
It really depends on the shop. I've worked where I was the System Administrator, DBA and Developer. Now I work for a largish company where we have 14 DBA's. I...
"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 23, 2008 at 8:42 am
Nope. Sorry.
The best you can do is write some code to generate the scripts, but you'll need 25 commands for 25 tables.
"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 23, 2008 at 8:21 am
Turning a badly performing query into a stored procedure won't improve performance. You'll need to determine what the query is doing. Is the function being done in the best way?...
"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 23, 2008 at 8:20 am
If you have to rearrange the columns on the second table, the best way is to drop & recreate the table. Or will that cause issues somewhere else?
Use the MS...
"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 23, 2008 at 7:50 am
Excellent points. Very well delivered. You've summarized where I find myself. I think the only real remaining issue I have with my team is that they do want to toss...
"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 23, 2008 at 6:52 am
Once you've got the datatype right, it comes down to indexing. I modified your first example to run against AdventureWorks, just so I had something to test:
DECLARE @period DATETIME
SET @period...
"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 23, 2008 at 6:45 am
Until you're down to squeezing the last 10-20ms out of a query, I don't think it matters. COALESCE has a lot more flexibility than ISNULL, so, I'd say, if 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 23, 2008 at 6:25 am
Viewing 15 posts - 20,596 through 20,610 (of 22,226 total)