CREATE OR REPLACE INDEX idx_files_photo_id ON files (photo_id, file_primary);