Using the clean thumbnails button in Tools->Settings->Cache DB will also delete image entries from the database.
Any image that doesn't have a rating or colour assigned will be entirely removed from the database, along with associated categories and tagged/untagged status. A folder full of unrated/uncoloured images will also have its database entry deleted. An image that has been rated or coloured will have its thumbnail deleted but the database info isn't affected, so categories will remain.
To test this you should use images that don't already have XMP data in them and turn off writing XMP data to images. Take 2 images and rate one, then give both a category. Use the category search and both images will show up. Use the clean thumbnails or delete all button. Refresh the view and only the rated image will remain. If you start with a clean database you can see it happen when you click the clean thumbnails button, the number of files reported in the directory will drop to 1.
0.53 / 0.51: Cleaning thumbnail cache can remove image info
Moderators: helmut, XnTriq, xnview, Dreamer