On Thu, 01 Dec 2011 09:34:03 -0800, William Lee wlee@wikia-inc.com wrote:
I'm a developer at Wikia. We have a use case for searching through a file's metadata. This task is challenging now, because the field Image.img_metadata is a blob.
We propose expanding the metadata field into a new table. We propose the name image_metadata. It will have three columns: img_name, attribute (varchar) and value (varchar). It can be joined with Image on img_name.
On the application side, LocalFile's load* and decodeRow methods will have to be changed to support the new table.
One issue to consider is the file archive. Should we replicate the metadata table for file archive? Or serialize the data and store it in a new table (something like fa_metadata)?
Please let us know if you see any issues with this plan. We hope that this will be useful to the MediaWiki project, and a candidate to merge back.
Thanks, Will
imgmeta_name, imgmeta_attribute, imgmeta_value would fit our standards for column naming better.
Why isn't our image table primary key an integer anyways?
We already have columns for the metadata blobs. And I'm assuming that you don't need to query old image versions for metadata. If that's the case then how about leaving the oi_metadata column in use?