I am having a problem with my operation system locking up during long running queries on SQL Server.
I am running SQL Server Developer Edition 64-bit on Windows 7 on my local machine, a laptop
with 2 dual core processors, 8GB of RAM, and a 1TB hard drive. I am the only user and am executing only one query at a time.
The database has one table with about 27M records. The table has a primary key on two fields (year [int] and code [char(9)]) and 30 other fields, all ints or short varchars and chars.
The year field runs from 1980 to 2011. The queries are run either through SSMS or and ODBC connection to R.
When I run the query
declare @y int = n
select year, age from X where year=@y order by year, age
for n between 1980 and 2011, the query executes in from 4 to 30 seconds in SSMS.
But when I run
select year, age from X order by year, age
the query fails to complete in an hour. At this point if I try to start the Task Manager, I get a message that there are no threads available. Trying to stop the query in SSMS never completes.
The screen generally locks up, requiring a hard reboot.
I have tried retrieving the the data via ODBC sequentially one year at a time. It works well for about 22 years and then slows dramatically for 2 years and then queries fail to complete. The slowdown occurs when the Performance Monitor shows that no more
memory is being acquired.
The only work around seems to be to restart the MSSQLSERVER service after about 20 years. The restart causes the service to release lots of memory.
Other long running queries behave in a similar fashion.
I have not seen any problems with memory-intensive operations with other software (mostly R operations).
I have tried replacing all the hardware, reinstalling all the software (including the operation system), and upgrading SQL Server to SP1. Nothing seems to help.
I have also tried running the same database on a similarly configured desktop (slightly slower processor and smaller hard drive). The query that failed to complete in an hour on the laptop completed in 8 minutes on the desktop and no locking-up problems occur on this or other queries.
The only real difference between the laptop and the desktop is that the laptop is in a corporate domain and subject to more security software and group policies; the desktop is on the network, but in its own workgroup.
Any ideas on what could be causing the problem?
Thanks,
John Kane
John Kane