Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query causing disk space issues


Query causing disk space issues

Author
Message
Jeff K
 Jeff K
Valued Member
Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)

Group: General Forum Members
Points: 69 Visits: 170
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.
TheGreenShepherd
TheGreenShepherd
Mr or Mrs. 500
Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)Mr or Mrs. 500 (597 reputation)

Group: General Forum Members
Points: 597 Visits: 583
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?
Jeff K
 Jeff K
Valued Member
Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)

Group: General Forum Members
Points: 69 Visits: 170
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).
Suresh B.
Suresh B.
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1128 Visits: 5326
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.
HowardW
HowardW
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1211 Visits: 9892
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search