Pages: 1 [2]   Go Down

Author Topic: Sorting issue with a Collection  (Read 6258 times)

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Sorting issue with a Collection
« Reply #20 on: January 29, 2015, 09:16:12 pm »

Hi,

Out of curiosity I did a little bit of research on the subject and would like to restate my views:

- Custom order in LR utilizes a known method that allows to insert, add, delete, reorder records (images) in a very rapid and efficient way.
- The issue about running out of possible gaps/spaces in clusters is also known, as shown in the following quote from a post in a technical forum from 2010:

Author: Mark Byers
http://stackoverflow.com/questions/3399253/how-to-store-ordered-items-which-often-change-position-in-db
Quote
If you relax the constraint that the Position column must contain integers from 1 to N and instead allow it to contain any numbers then you can do both searches and updates efficiently.

You can insert an item between two other items with position A and B by calculating the average (A + B) DIV 2. For example if A is 10000 and B is 12000 then your new position is 11000. Occasionally you will run out of gaps due to clustering, at which point you can run through the whole table redistributing the positions more evenly.

The solution here is to update all records in the table to redistribute the positions whenever the problem occurs. My guess here is that the Adobe developers thought that this would never occur due to the available digits, so they did not include this functionality.

- It does not have anything to do with the number of images in the collection. It might happen in a collection with only 3 images (you might want to check the sanity of somebody who cannot decide how to sort 3 images, but that's another topic).

- Three ways to implement the solution:

a) As part of the startup checks (see if there is a long entry in the affected table and renumber)
b) As part of the "optimize catalog" function
c) As a conditional check everytime you change the order in custom mode (this might be inefficient)

But I'm sure the people at Adobe have a better method

Regards,
Pages: 1 [2]   Go Up