[Digikam-users] Database inconsistencies
Marcel Wiesweg
marcel.wiesweg at gmx.de
Thu Dec 13 18:45:41 GMT 2012
The images with status=3 and a NULL album are intentional, these are deleted
entries which are kept in the database, should the image appear again (could
happen with lengthy move operations)
They should be cleared after a time.
The other entries seem to be invalid. There is a trigger which deletes entries
in all dependent tables when the entry in "Images" is deleted. Dont know why
there are these leftovers.
Marcel
> I found what I suspect to be a few inconsistencies in my digikam
> database and would like to know if there are any tools to clean them up
> and if it is safe to remove those orphan entries listed below:
>
> Images without albums (count: 1481):
> SELECT * FROM `Images` WHERE album is NULL
> Note: all those have status=3 whatever this means
>
> Comment without attached images (count: 3):
> SELECT * FROM `Images` RIGHT JOIN ImageComments ON Images.id=imageId
> WHERE `Images`.`id` IS NULL
>
> |HaarMatrix| without attached images (count: 2):
> SELECT * FROM `Images` RIGHT JOIN Image|HaarMatrix| ON Images.id=imageId
> WHERE `Images`.`id` IS NULL
> Note: one of them has imageId set to -1
>
> |Information| without attached images (count: 31):
> SELECT * FROM `Images` RIGHT JOIN Image|Information| ON
> Images.id=imageId WHERE `Images`.`id` IS NULL
> Note: one of them has imageId set to -1
>
> Metadata without attached images (count: 41):
> SELECT * FROM `Images` RIGHT JOIN ImageMetadata ON Images.id=imageId
> WHERE `Images`.`id` IS NULL
> Note: one of them has imageId set to -1
>
> Positions without attached images (count: 10):
> SELECT * FROM `Images` RIGHT JOIN ImagePositions ON Images.id=imageId
> WHERE `Images`.`id` IS NULL
> Note: one of them has imageId set to -1
More information about the Digikam-users
mailing list