Lightroom Classic: Empty catalog containing thousands of thumbnails

  • 2
  • Problem
  • Updated 8 months ago
  • (Edited)
I have been working with thousands of images in a catalog, but deleted them now that I've finished with them. So now the catalog is back to exactly 0 images. Then, I optimized the catalog.

I don't want to delete the catalog, as it contains a couple of handy other settings.

On disk however, the "[Catalog] Previews.lrdata" directory still contains tens of thousands of files and directories. For what? Why does Lightroom need to keep so many files around? Surely it's not going to reuse old thumbnails, that would be crazy.

So two conclusions:
1) Adobe, you need to fix this problem. A catalog with 0 images should have 0 thumbnails. Period.
2) How can I reliably clean up the on-disk thumbnails for a catalog with >0 pictures? Iow: how can I know which files are no longer pertaining to any one picture in the catalog?
Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes

Posted 8 months ago

  • 2
Photo of Johan Elzenga

Johan Elzenga, Champion

  • 2252 Posts
  • 934 Reply Likes
Just trash the previews.lrdata. Lightroom will rebuild it when you import new images.
Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes
I don't want to "just" anything, frankly. This is something that needs fixing on Adobe's end.

The reason: one might have a catalog that does still contain thousands of picture, and then there's no way of knowing which files in the previews.lrdata can be safely removed without trashing the previews. I also don't want to slow down my pc while it's rebuilding all thumbnails for 6 days.
(Edited)
Photo of Jim Wilde

Jim Wilde, Champion

  • 386 Posts
  • 153 Reply Likes
The way I think it's supposed to work is that when images files are removed from the catalog, any associated previews are not immediately deleted (because in some cases the removal is an un-doable action, thus retaining the previews until it's certain that "undo" can't be used is quite logical). However, the previews are marked for deletion, which usually occurs the next time the catalog is opened, although the preview folder structure is not deleted (as it will be re-used when new imports are done).

I've tested this behaviour several times in the past, and it seems fairly consistent.

In the specific situation you describe, Johan's advice remains the most pragmatic solution as I don't really think there's much for Adobe to fix. I suppose one could argue that if the image files are deleted from disk (rather than just removed from the catalog) the associated previews could be deleted immediately rather than when the catalog is next opened, as permanent deletion is not un-doable....though I'd probably be surprised if Adobe expended any resources to change that. 
Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes
> thus retaining the previews until it's certain that "undo" can't be used is quite logical

It might not be. Previews are nonessential and can be deleted safely, after which they can easily be regenerated. I'm not sure what sort of situation might cause a source file to disappear from a catalog, while the thumbnails doesn't need to be removed. Can you elaborate on that?

> However, the previews are marked for deletion, which usually occurs the next time the catalog is opened,

What does "usually" mean? ;)
But no, they are not. Those rouge files will remain on-disk forever. Once a thumbnail file has gone rouge, it lives there. No matter how many times I reopen the catalog and/or optimize it. Until one day, when it's manually destroyed. It adds up quickly as well. At one point I had in excess of 20GB of thumbnails for an EMPTY catalog. This is absolutely ridiculous, but even more so when there's that much too many thumbnails for a NON-EMPTY catalog. Because I have no way of knowing which are rouge and which are "legitimate".

> In the specific situation you describe, Johan's advice remains the most pragmatic solution as I don't really think there's much for Adobe to fix.

There is. Delete thumbnails when the original/source picture is deleted. Period.
A deletion is always permanent, even if the file on-disk is kept. Try it. A deletion cannot ever be undone. Afaik.

> I'd probably be surprised if Adobe expended any resources to change that

Oh I agree with you on that. I'd be surpized if Adobe expends any resources on any bugfix *at all*. Given how many bugs LR has, they probably don't give a monkey's toss anymore. It's more likely they will cram it full of even more useless features. But that is a totally different problem.
Photo of Robert Frost

Robert Frost

  • 435 Posts
  • 73 Reply Likes
Reboot your computer, open Lr with that catalog and then leave it overnight. It should clear all the data in the various databases, but it takes a while since there is a lot to tidy up. The records in the catalog have to be cleared for each file; the previews have to be deleted as well as the actual image file and xmp file; the records in the previews database have to be updated, and the rootpixels database, and the acr cache has to have its records deleted and its database updated.

If you have deleted tens of thousands of images at once, that will take quite a while. Personally I wouldn't delete that many at once in case LR gets overwhelmed! Preferably delete them in smaller batches, and backup the catalog in between batches. Remember the program is written by humans, and none of them is perfect! So programs will always have bugs.

Bob Frost
(Edited)
Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes
> Reboot your computer, open Lr with that catalog and then leave it overnight.
You're joking, right?

> it takes a while since there is a lot to tidy up
Rocking a 2GB/s SSD and a fast quadcore CPU with 32GB of memory, it shouldn't "take a while". It shouldn't take more than 5 minutes. It's only 20,000 files. It's really not quite THAT much. You're grossly underestimating what a computer can do (or I'm grossly overestimating Adobe's ability to make a program that performs as well as the computer it runs on).

> Personally I wouldn't delete that many at once in case LR gets overwhelmed!
Awww, poor thing get overwhelmed. LR is at version 8.1, time to bloody man up and act as professional as its high price point.

> Remember the program is written by humans, and none of them is perfect! So programs will always have bugs.
It's also written by a huge commerical company, and costs a LOT of money. So bugs that are obvious (I can name LOADS of other if you like) are unacceptable.
Photo of Robert Frost

Robert Frost

  • 435 Posts
  • 73 Reply Likes
> it takes a while since there is a lot to tidy up
Rocking a 2GB/s SSD and a fast quadcore CPU with 32GB of memory, it shouldn't "take a while". It shouldn't take more than 5 minutes. It's only 20,000 files. It's really not quite THAT much. You're grossly underestimating what a computer can do (or I'm grossly overestimating Adobe's ability to make a program that performs as well as the computer it runs on).

You are probably forgetting that it does all that stuff in the background, at background cpu speeds, not at top priority speeds. That allows use of the computer for other stuff while LR sorts out the mess that you've created by deleting 20,000 files all at once!!

Bob Frost
Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes
Low priority !== low speed

Besides, I haven't created the mess, LR has.
Photo of Jim Wilde

Jim Wilde, Champion

  • 386 Posts
  • 153 Reply Likes
Imagine a situation where a user removes an image from the catalog without realising that he had 1000 images selected. Performing an action without realising that multiple images are selected happens a lot. Let's assume he had 1:1 previews already built for those 1000 images. So, current behaviour allows the user to Ctrl/Cmd+Z to undo that removal, and those 1000 1:1 previews still exist. Your way would require him to rebuild those 1000 1:1 previews.....which side of that debate do think I'm coming down on?

"Usually" means every time I've tested it, which is a lot more than once. I'd like to be able to say "always", but I'm a cautious guy who tries to choose my words carefully.

When you use the "Remove Photos" option, there are two options: Delete from Disk or Remove. The former IS permanent and cannot be undone, the latter is not permanent and can be undone. Yes, I have tried it, many times.




Photo of martijn Saly

martijn Saly

  • 214 Posts
  • 29 Reply Likes
> So, current behaviour allows the user to Ctrl/Cmd+Z to undo that removal, and those 1000 1:1 previews still exist. Your way would require him to rebuild those 1000 1:1 previews.....which side of that debate do think I'm coming down on?

So, deleting pictures should also delete the thumbnails.
Undoing that deletion should also undo deleting the thumbnails.
And we're done.

Deleting images FROM DISK (what I did) should permanently delete thumbnails. Deleting FROM DISK is not undoable in LR. Yes, a user can restore them from the recycle bin, but that doesn't put them back into the catalog.

So as for deleting pictures FROM DISK: Give me one reason to keep their thumbnails around.
(Edited)