+-- Mainly used for manual queries -- usually too slow to be very useful
+-- for web views in the long run (except for the special case of the
+-- partial index below).
+CREATE TABLE exif_info (
+ image integer NOT NULL REFERENCES images (id) ON DELETE CASCADE,
+ key varchar NOT NULL,
+ value varchar NOT NULL,
+
+ PRIMARY KEY ( image, key )
+);
+
+CLUSTER exif_info_pkey ON exif_info;
+CREATE UNIQUE INDEX exif_info_fast_listing ON exif_info (image, key) INCLUDE (value)
+ WHERE key IN ('ExposureProgram', 'FocalLength', 'ExposureTime', 'FNumber', 'ISO', 'ISOSetting',
+ 'ExposureBiasValue', 'ExposureCompensation', 'DateTimeOriginal', 'Model', 'Flash');
+