Viewing 15 posts - 2,911 through 2,925 (of 5,841 total)
DOH!! Coffee clearly hadn't kicked in when I posted! At least I offered up a few improvements ... 🙂
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 29, 2012 at 8:27 am
Hardy21 (5/29/2012)
I have just given one option to change the query.
It will calculate and store filtered records in temp table so during delete, it will...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 29, 2012 at 7:23 am
Brian Souder (5/16/2012)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 29, 2012 at 7:15 am
SQL Kiwi (5/27/2012)
htiteuf (5/23/2012)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 28, 2012 at 7:54 am
Welsh Corgi (5/24/2012)
SQLKnowItAll (5/15/2012)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 25, 2012 at 7:52 am
Jayanth_Kurup (5/25/2012)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 25, 2012 at 7:45 am
SOOOO many things could be at play here - you likely need to get a professional involved for a few hours to identify what the root cause is. Here...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 25, 2012 at 7:42 am
Sean Lange (5/24/2012)
TheSQLGuru (5/24/2012)
Sean Lange (5/24/2012)
TheSQLGuru (5/24/2012)
Actually Grant I don't see even the slightest hint of a question from the OP - it is just a bunch of code. ...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 10:00 am
Sean Lange (5/24/2012)
TheSQLGuru (5/24/2012)
Actually Grant I don't see even the slightest hint of a question from the OP - it is just a bunch of code. No request about...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 9:16 am
I updated my post to include the connect bug link.
Here are my findings:
select MAX(mycol) from mytable_unpart where id<=10
NC INDEX scan
Table 'mytable_unpart'. Scan count 1, logical reads 283
select MAX(mycol)...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 9:13 am
Gullimeel (5/24/2012)
Speaking of "based on testing, not a wild guess" - have you actually TRIED your SELECT MAX(... query on a large partitioned table?
I had put a real time example...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 8:17 am
chandan_jha18 (5/24/2012)
TheSQLGuru (5/24/2012)
WHERE DsLocationCode = CAST(term.TerminalID AS VARCHAR)
AND...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 8:00 am
The left join on the MIN is going to suck in any case, but these are the real killers here I bet:
WHERE DsLocationCode = CAST(term.TerminalID AS VARCHAR)
AND (sup.SupplierCode LIKE...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 7:21 am
Grant Fritchey (5/23/2012)
Can you post the execution plan for the query? It's hard to suggest improvements not knowing the structure of your system, tables, indexes, constraints, etc.
Actually Grant I don't...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 7:11 am
I would have (probably clustered) index on your datetimestamp column. then do something like this:
declare @error int, @rowcount int
set @rowcount = 9999
while @rowcount > 0
begin
begin tran
...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
May 24, 2012 at 7:07 am
Viewing 15 posts - 2,911 through 2,925 (of 5,841 total)