I’m looking to get the best performance out of querying a table containing EXIF data. The queries in question will only search the EXIF data for the specified strings and return the row index on a match.
With that said, would it better to store the EXIF data in a table with separate columns for each of the tags, or would storing all of the tags in a single column as one long delimited string suit me just as well?
There are around 115 EXIF tags I’ll be storing, and each record would be around 1500 to 2000 chars in length if concatenated into a single string.
If you store them all in one column you’re not going to be able to get performance benefits from indexes. You’ll also be violating a cardinal rule of database design, which has its own consequences (each column should only store one piece of data).
I would probably use a structure similar to this:
The EXIF_Tags table would have all of the valid tags and the Images table would hold the images. You can then have indexes on the
exif_tag_idcolumn and possibly theexif_valuecolumn for quick searching.