• 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