Re: Moving disk files by export/import?

On Sun, Jan 04, 2009 at 07:57:43AM +0100, Lorenzo Milesi wrote:
> Il giorno dom, 04/01/2009 alle 09.42 +0800, Bengt Thuree ha scritto:
> > Check the Change Photo Path extension...
> exactly!

I guess the extension provides the progress meter, but seems like a
lot of code to do something the database can do in a few updates
wrapped in a transaction.

But, I assume it's doing more work than just changing paths in the
database.  Is that correct?

Am I reading the code correctly?

It looks like it does a select * from photos to find if there's at
least one path to change.  Then does a select * from photos to find
all photos to change then for each photo finds all associated versions
of that photo and pushes that version info onto a set of arrays.  So
end up with a set of related arrays, the length of which is the total
number of versions to change.

Once that is done the code seems to loop over the version arrays, and
for each version fetch the photo if not already loaded from a previous
version, and then updates that specific version's path.  Hum, I'm
missing where it's also changing the photo's uri.  Perhaps the
"photo_store" does that?

Anyway, I can imagine why the author noted that it was slow.  My guess
is with 20K photos sqlite would do it in just a few seconds, if that.

Bill Moseley
moseley hank org
Sent from my iMutt

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]