Garbage Collection

  • SQLRNNR (9/5/2013)


    Thomas Abraham (9/5/2013)


    raulggonzalez (9/5/2013)


    Thanks for the question, but it would have been useful if it was specified that is a SQL Server 2012 environment as in previous versions this didn't exist.

    +1 as I don't use 2012, I responded based on what I knew from 2008. I could have looked up "sp_filestream_force_garbage_collection ", but as another poster said, that just seemed like a made up procedure name. At least I learned something.

    Thanks Steve for the question.

    Looks like that may have been fixed. When I answered the question, 2012 was specified.

    Glad to see that this has been added in 2012 to force GC

    Oh that's so cheeky... I want my points back :Whistling:

  • nice question

  • Not worked on SQL 2012 yet. So this question made me dig for the informaiton and I'm glad to get it correct and earn some knowledge as well. 🙂

  • L' Eomot Inversé (9/5/2013)


    This question is somewhat confused and the answer is wrong.

    It says the files "not be removed immediately" and asks how to force this garbage collection to occur. The word "this" means something, and the only thing "this garbage collection" can be using as a referent for "this" is removing the files. As the garbage collector will do nothing with the files unless both the current checkpoint LSN and the last backup LSN are both beyond the LSN of the delete operation, and the files will only be removed when the garbage collector has processed them twice, causing the garbage collector to run will do nothing at all unless there has been both a checkpoint and a log backup since the delete operation, and even if this forced run occurs when the backup and checkpoint LSNs are both high enough it will not remove the files if it is the first such run, just mark their tombstones so that the next GC run will remove them.

    I disagree, Tom, and think you're being a little pedantic here. The question asked how can you force the garbage collection to run, not force it to delete files. The way SQL Server operates is not compromised by your forcing the GC process to run, which is what the questions asks.

    I have awarded back points because the original question did not mention SQL Server 2012.

  • Steve Jones - SSC Editor (9/11/2013)


    L' Eomot Inversé (9/5/2013)


    This question is somewhat confused and the answer is wrong.

    It says the files "not be removed immediately" and asks how to force this garbage collection to occur. The word "this" means something, and the only thing "this garbage collection" can be using as a referent for "this" is removing the files. As the garbage collector will do nothing with the files unless both the current checkpoint LSN and the last backup LSN are both beyond the LSN of the delete operation, and the files will only be removed when the garbage collector has processed them twice, causing the garbage collector to run will do nothing at all unless there has been both a checkpoint and a log backup since the delete operation, and even if this forced run occurs when the backup and checkpoint LSNs are both high enough it will not remove the files if it is the first such run, just mark their tombstones so that the next GC run will remove them.

    I disagree, Tom, and think you're being a little pedantic here. The question asked how can you force the garbage collection to run, not force it to delete files. The way SQL Server operates is not compromised by your forcing the GC process to run, which is what the questions asks.

    I have awarded back points because the original question did not mention SQL Server 2012.

    So you think the word "this" in your question is meaningless, has no referent? Surely "this garbage collection" is the stuff you have just mentioned, not something you have not mentioned; that's what that little word "this" means, isn't it?

    It would be a good idea to alter the wording a bit so that it has to be understood your way - make it say "how can you force the garbage collector run right away" instead of saying "how can you force this garbage collection to occur right away"; no need to award points back for a change like that, the important thing is to eliminate as far as possible the risk of people it reading it the way I read it (which I believe is the way most people would read it) and taking away the wrong lesson.

    Tom

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply