Garbage collection logic

Right now if you run it will check all libraries and go thru all of history of each library. And it takes long time to do this.

But what is the point to check libraries with unlimited history if no blocks will be removed?
For now I run script that takes history settings from DB and run GC script only on libraries with limited history.

It will be great to see automatic check if history set to unlimited and skip such library.