Re: Moving disk files by export/import?



Bill Moseley wrote:
> On Mon, Jan 05, 2009 at 09:41:13AM +0800, Bengt Thuree wrote:
>> Bill Moseley wrote:
>>> 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!
>>> http://svn.gnome.org/svn/f-spot/trunk/extensions/Tools/ChangePhotoPath/
>>> 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.
>>>
>> This is a problem with sqlite.
>> sqlite does the update in a few seconds to a few minutes, but then it
>> takes a LONG time to actually update the database.
>> That is, the code executes very quickly. But if you do select in the
>> tables you will see it is not actually updated.
>
> There's no sqlite server running in the background to finish an
> update.  And you can't have an update that returns without updating
> the database.  A not-so-small chunk of the Internet would come to a
> grinding halt if that was true. ;)
>
> My guess the reason it is slow is because it's doing all the work in
> the application -- 20K images, two select * from photos, process every
> image one-by-one building the arrays, and then again process every
> image one-by-one reading again and one update for every
> photo plus for every photo_version row associated with a photo.
> That's a lot database queries when it seems it could be done in just
> two.  (Again, I'm not clear if there's anything else that has to
> happen in f-spot, but discussion the db updates here.)
>
>
> It's always best to let the database do the things it is good at:

Amen

When I did all my testing, 15 months or so ago, the job database was not
properly working. At that time the extension finished all its work
fairly quickly, perhaps 30 seconds or so to process 20k+ photos.
But after the extension finished, core part of f-spot had another 2-3
hours before it finished updating the f-spot database. That is, if I
were doing a manual select in sqlite at the same time, it took 2-3 hours
before this manual select reported 0 rows (with the old path).

But for sure, you are the expert right now on this extension :)

/Bengt




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