select identity_public_id, data, i.created_at from identity i join identity_email ie using (identity_id) join email e using (email_id) where ((?1 is null) or (i.identity_public_id = ?1)) and ((?2 is null) or (e.address = ?2))