Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Query causing disk space issues Expand / Collapse
Author
Message
Posted Wednesday, September 26, 2012 2:08 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 8:06 AM
Points: 69, Visits: 167
OK, I'm out of ideas.

Rather than use an existing document management model, my company has decided to build their own. In this model, they are storing actual documents in the database in BLOB format (nvarchar(max)). To this point, there really isn't a problem.

We recently started having disk space issues on the server containing this database instance. Doing a SELECT * from {table} is causing something to be written to the C drive. Restarting services does NOT free the disk space but a reboot does. My first thought was tempdb, but tempdb is on the D drive (as are all system databases) and does not change at all in size before, during, or after the query is run. What am I missing?

The SELECT * is just ad hoc testing to find the problem. The actual code is cleaner but is, over time, causing disk space issues.
Post #1364920
Posted Wednesday, September 26, 2012 3:56 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 6:34 PM
Points: 565, Visits: 458
I hate these types of responses, but how are you certain that it's the query that's causing something to be written to that volume?
Post #1364966
Posted Wednesday, September 26, 2012 9:54 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 8:06 AM
Points: 69, Visits: 167
That's a fair question.

I don't know that I can prove it 100%. What I can say, though, is that I can monitor disk space for the better part of 15 minutes and not see it change. Then I run a query such as SELECT TOP 500 FROM {table} and watch the available disk space get smaller and smaller. Space continues to decrease until either I stop the query or execution completes. The disk space is stable again (unchanged for several hours).
Post #1365023
Posted Wednesday, September 26, 2012 11:58 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 4:17 AM
Points: 1,101, Visits: 5,279
Jeff K (9/26/2012)
... Doing a SELECT * from {table} is causing something to be written to the C drive. Restarting services does NOT free the disk space but a reboot does. ...

I "guess" virtual memory is causing this issue.
Post #1365039
Posted Thursday, September 27, 2012 6:05 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 6:01 AM
Points: 1,232, Visits: 9,681
Hang on, are you running this Select * from <table> from SSMS on the local server?

The data you see in the results tab has to go somewhere. Remember that SSMS is a client not a server, so it has to receive data and then store it, so you can see it in a grid.

SSMS backs the query result tab to temporary files in the user's temp folder, which is likely to be stored on the C drive. If it's a massive table, you'll get massive temp files.
Post #1365175
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse