It would be useful to disable a smart collection or, even better, disable a set of smart collections, so they are no longer processed until re-enabled.
As it is we can only delete the smart collections and recreate them when we need them again next month.
A selective export and import option of smart collections would serve a similar purpose and would add functionality to LR but would not be as simple to use just for this disable/enable purpose.
Whilst here I would also like to add my vote to the many people who have asked for a smart collection A only to select images from within smart collection B. Though I can see some concerns: how many levels down does it allow should B only select from smart collection C, etc. That is maybe why they have not implemented it. Also there would be a possibility of creating an infinite loop should smart collection A only select from B but B is set up to only select from A. Perhaps it could be limited to only allow selection from smart collection B provided that B does not have use any sub-selection of its own.
- 36 Posts
- 8 Reply Likes
Posted 1 year ago
Johan Elzenga, Champion
- 1712 Posts
- 698 Reply Likes
The problem with feature suggestions is that people can suggest anything they like. Thy don't have to check how difficult it is to add this to the existing code. They don't have to check wether Lightroom would become even more bloatware with all these features. They don't have to check whether more than a handful of people might ever use this. And of course they always think that their feature request is the most important request in the history of Lightroom and so it is unbelievable that it is still not implemented...
Johan Elzenga, Champion
- 1712 Posts
- 698 Reply Likes
- 36 Posts
- 8 Reply Likes
John R. Ellis, Champion
- 4034 Posts
- 1065 Reply Likes
There have been very few posts in the last many years about very slow smart collections. It would be good to narrow down what it is about your situation causing this.
- How many photos in your catalog?
- Has your catalog been upgraded from previous major versions, and if so, which ones?
- Can you right-click each smart collection and do Export Smart Collection Settings. Zip up the 12 .lrsmcol files, upload to Dropbox or similar, and post the sharing link here. I'm intimately familiar with LR's search capabilities (see my Any Filter plugin), so I might be able to identify a culprit.
- 36 Posts
- 8 Reply Likes
90,000 images and Lightroom Classic is fully up-to-date (7.0.1) and catalogue converted. It is on a reasonably fast Windows 10 PC with 16GB. Not much else runs concurrently. LR is on a HD, not a SSD.
Right now I have 12 SC (Smart Collections) similar to the two in the attached zip file in one set, then the group is repeated for each camera and lens combination. Previously they were a little more complex
https://www.dropbox.com/s/kh80r9f0gs7v4g2/LR.zip?dl=0
BTW The lens description in the image file is "EF24-105mm f/4L IS USM", it might be faster if I searched for the full description but I can imagine instances where limiting it to some embedded text is preferable, eg to include different versions of a 50mm lens.
Each group takes over 2 minutes to process before the numbers appear. If I close LR and re-open it immediately it takes 20 seconds to refill them. But by the next day when I start LR it is back to over 2 mins per group.
I would like to keep many SC sets active (or disabled if that was an option) so I didn't have to edit and re-edit each time for each new criteria, e.g. date ranges, lens type, camera number etc. but as they are so slow I have now deleted all but one set.
(I do have some other SCs but they are quick to resolve)
It would be even better if a group could select from another smart collection, eg SC 2 selects all images for a camera and lens type, then each SC in a group pull from SC 2 and refine that selection by, say aperture value range. That would make setting up groups much easier and I would only need to change SC 2 to get the next batch of figures.
John R. Ellis, Champion
- 4034 Posts
- 1065 Reply Likes
John R. Ellis, Champion
- 4034 Posts
- 1065 Reply Likes
John R. Ellis, Champion
- 4034 Posts
- 1065 Reply Likes
- 36 Posts
- 8 Reply Likes
Lightroom Classic version: 7.0.1 [ 1142117 ]
John R. Ellis, Champion
- 4054 Posts
- 1067 Reply Likes
"Each group takes over 2 minutes to process before the numbers appear. If I close LR and re-open it immediately it takes 20 seconds to refill them. But by the next day when I start LR it is back to over 2 mins per group."
This
strongly indicates that unusually slow or excessive disk i/o is slowing down
the "cold starts" compared to the "warm starts" by a factor
of 6.
With a
cold start, the operating system's in-memory disk cache is empty, so LR has to
read the relevant parts of the catalog file from disk. But with a warm start
(restarting LR immediately after you exited), the catalog file is already in
the disk cache, so little extra disk i/o is required.
There are
two possibilities: Your disk is responding to read requests unusually slowly,
or your catalog file is excessively large for some reason. Once you post the size of your .lrcat catalog
file, we can compare the size / photo with my catalog and others to see if
yours is excessively large (per photo).
Before someone shouts "Optimize!", consider: LR Classic optimizes the catalog when it converted from an earlier version, so your catalog was optimized in the last week or so. So while you could try File > Optimize Catalog, it's unlikely it will have any effect. (It also compresses the history field of each photo, resulting in catalogs that can be 50% or more smaller than LR 6.)
------------------------
I did some
quickie timings with a plugin script to verify that on warm starts, your LR is
executing smart collections roughly as fast as mine, further pointing the
finger at cold-start disk i/o.
I timed the execution of a smart collection very similar to the ones you posted. For warm starts, I observed times similar to what you (roughly) observed: 0.9 x 10^-5 sec/photo on my catalog, versus 1.8 x 10^-5 sec/photo on your catalog. But for cold starts, I observed just slightly slower times of 1.1 x 10^-5 sec/photo, versus order-of-magnitude larger times of 11 x 10^-5 sec/photo on your catalog.
(My timing was done on a somewhat smaller catalog stored on a reasonably fast external hard drive, with a Macbook Pro mid-2015 with 16 GB memory. The test smart collection returned 14K photos. The SQL query execution time is directly proportional to the number of photos, since SQL indexes can't be used for these queries.)
Below is
the timing script I used. You can run this script in your LR by doing
Preferences > Presets, clicking Show Lightroom Presets Folder, and creating
a subfolder "Scripts" under the "Lightroom" folder that's
selected in Mac Finder or Windows Explorer.
Then copy the script into a file "timesmartcollection.lua" in
that folder and restart LR. You'll see a
Scripts menu appear on the far right of LR's menu bar, and the script
"timesmartcollection" will appear in that dropdown.
If you want to measure cold and warm starts, you'll have to make a copy of your catalog folder and measure with the copy. Delete the smart collections from that copy so they don't affect the timing. To measure cold starts, you can either reboot your computer each time; or on Mac, use the "purge" command in Terminal. On Windows, the following recipe supposedly works, though I haven't tried it: https://stackoverflow.com/questions/478340/clear-file-cache-to-repeat-performance-testing
If you
want to time a different smart collection, in the LR's Collections panel,
right-click the smart collection and do Export Smart Collection Settings. Open the exported .lrsmcol file in a text
editor and copy and paste into the "timesmartcolleciton.lua" script
where indicated.
local LrApplication = import "LrApplication"
local LrDate = import "LrDate"
local LrDialogs = import "LrDialogs"
local LrTasks = import "LrTasks"
local catalog = LrApplication.activeCatalog ()
local s
--[[**** Insert the contents of the .lrsmcol file here ***************]]
s = {
id = "CC90F266-2911-427C-8753-1469B13A76AD",
internalName = "Focal 28-105mm 24-105 lens",
title = "Focal 28-105mm 24-105 lens",
type = "LibrarySmartCollection",
value = {
{
criteria = "lens",
operation = "all",
value = "24-105",
value2 = "",
},
{
criteria = "cameraSN",
operation = "==",
value = "1831227178",
value2 = "",
},
{
criteria = "focalLength",
operation = "in",
value = 28,
value2 = 105,
},
combine = "intersect",
},
version = 0,
}
--[[******************************************************************]]
LrTasks.startAsyncTask (function ()
local t = LrDate.currentTime ()
local photos = catalog:findPhotos {searchDesc = s.value}
t = LrDate.currentTime () - t
LrDialogs.message (s.title,
string.format ("%d photos\n%g seconds", #photos, t))
end)
John R. Ellis, Champion
- 4054 Posts
- 1067 Reply Likes
John R. Ellis, Champion
- 4054 Posts
- 1067 Reply Likes

So you'd first select the desired smart collection and then the appropriate camera/lens filter.
John R. Ellis, Champion
- 4054 Posts
- 1067 Reply Likes
The camera serial number, lens id, apertural, and focal length are all stored in a few small SQL tables, and each of those fields have indexes. But the tables are small enough such that a linear scan through 90K in-memory entries should be extremely fast even if it doesn't use the index (e.g. for the "contains" operators), and if the tables don't happen to be in memory, they could be read in a small fraction of a second. That's all demonstrated by timings on my catalog.
So clearly something bad and out of the ordinary is happening with your catalog, but I don't see any clues as to what.
In addition to using filter presets as suggested before, a couple more workaround suggestions:
- Use "is" rather than "contains" for serial number and lens id for any remaining smart collections using those fields. That will allow the indexes to be used (but as discussed before, the tables are so small that a linear scan without the indexes should be plenty fast enough, unless the SQLite query optimizer has gone off the rails with your particular queries).
- Try exporting a copy of the catalog with File > Export As Catalog, with all of the options unchecked, and open the copy in LR. That will export a "clean" SQL database, perhaps "cleaner" than what the Optimize command does -- I believe the Export essentially rebuilds the tables from scratch. So maybe there are some rotted bits that are embedded in the old catalog that exporting will remove. Just an educated guess, probably only a 15% chance of having an effect.
- 36 Posts
- 8 Reply Likes
I opened LR this morning and saved a catalogue as requested with no options
Switched off PC and restart PC.
Open the new catalogue and it took 20 seconds to fill the one set of SCs.
Using FILE > OPEN RECENT switched back to the original catalogue and this took 75 seconds to fill the same SCs.
Using FILE > OPEN RECENT switched back to the new catalogue and this took 12 seconds to fill the same SCs.
Using FILE > OPEN RECENT switched back to the orginal catalogue and this took 8 seconds to fill the same SCs.
All timings start once it has got all windows in the Browse module open and I can see the list of SCs
BTW did you see my post where I thanked you for all the work and help you have done because I can't see my post in the above thread. I hadn't thought about using a combination of Filter Preset and SC. This makes great sense. It did improve the performance and would make future changes a little easier. I have now gotten all the stats I need for my work so probably won't need this set of SCs again. But I have learned a lot from you should I need to do anything similar. Thank you.
John R. Ellis, Champion
- 4054 Posts
- 1067 Reply Likes
- 140 Posts
- 30 Reply Likes
Just speculation, but will be useful if I need to do this to my own catalog sometime. I have >18.000 photos synced in LR CC 2015.
Sreenivas Ramaswamy, Employee
- 27 Posts
- 12 Reply Likes
I have logged a feature request internally so that we can track this idea.
For now users can do the following workaround (not great but still it works) to get the same effect. Create a Collection set called "Disabled smart collections" or any name you like. Move all the smart collections you want disabled into it. Collapse the collection set and restart Lightroom. As long as this collection set remains collapsed they won't be evaluated. One drawback of this approach is that users need to remember to keep the collection set collapsed. If they open it they need to remember to close it and restart Lightroom to get the benefit.
John R. Ellis, Champion
- 4047 Posts
- 1067 Reply Likes
- 140 Posts
- 30 Reply Likes
Sreenivas Ramaswamy, Employee
- 27 Posts
- 12 Reply Likes
- 140 Posts
- 30 Reply Likes
- 36 Posts
- 8 Reply Likes
Related Categories
-
Lightroom Classic CC
- 13653 Conversations
- 3064 Followers