|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, February 27, 2013 1:38 PM
Points: 370,
Visits: 670
|
|
Running trace on the following query shows :
Some trace events have not been reported to SQL Server Profiler because the server has reached its maximum available memory for the process
in the trace:
select top 1 fld1, fld2, sum(Qty) from Transactions t INNER JOIN TempLocations t1 on t1.LocationNo=t.LocationNo where TypeID in ('R','Y') and updated = 0 and t.fld1 = '00979' group by t.fld1,t.fld2 having sum(Qty) > 0
When I run the above query either thru application or thru query analyzer, it keeps on running but does not produce any result. While the query is running, if I start the profiler, I get the above message.
but if I remove the statement "and t.fld1 = '00979' then the query produces the result.
This is strange. Can anyone help?
Thanks.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 6:53 AM
Points: 1,654,
Visits: 8,562
|
|
How many rows are there in transactions table? If its a big table then try indexing this field fld1 which u said is slowing down the query and see if this helps..
MJ
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, February 27, 2013 1:38 PM
Points: 370,
Visits: 670
|
|
Manu, Transactions is a huge table and fld1 is indexed.
Thanks.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 6:53 AM
Points: 1,654,
Visits: 8,562
|
|
Check the index fragmentation and execution plan of query.
MJ
|
|
|
|