Как оптимизировать представления?
КОД:
select `A`.`lb0003_id` AS `lb0003_id`,`C`.`lb0101_id` AS `lb0101_id`,`C`.`lb0101_name1` AS `lb0101_name1`,`C`.`lb0101_name2` AS `lb0101_name2`,`C`.`lb0101_name3` AS `lb0101_name3`,`C`.`lb0101_name1_alt` AS `lb0101_name1_alt`,`C`.`lb0101_name2_alt` AS `lb0101_name2_alt`,`C`.`lb0101_name3_alt` AS `lb0101_name3_alt`,`C`.`lb0101_dateOfBirth` AS `lb0101_dateOfBirth`,`C`.`lb0101_idn` AS `lb0101_idn`,`C`.`lb0101_idCard_no` AS `lb0101_idCard_no`,`C`.`lb0101_idCard_dateOfIssue` AS `lb0101_idCard_dateOfIssue`,`C`.`lb0101_idCard_issuedBy` AS `lb0101_idCard_issuedBy`,`C`.`lb0101_idCard_validity` AS `lb0101_idCard_validity`,`C`.`lb0101_passport_no` AS `lb0101_passport_no`,`C`.`lb0101_passport_dateOfIssue` AS `lb0101_passport_dateOfIssue`,`C`.`lb0101_passport_issuedBy` AS `lb0101_passport_issuedBy`,`C`.`lb0101_passport_validity` AS `lb0101_passport_validity`,`C`.`lb0101_location1` AS `lb0101_location1`,`C`.`lb0101_address1` AS `lb0101_address1`,`C`.`lb0101_phone_home` AS `lb0101_phone_home`,`C`.`lb0101_phone_mobile1` AS `lb0101_phone_mobile1`,`C`.`lb0101_phone_mobile2` AS `lb0101_phone_mobile2`,`C`.`lb0101_comments` AS `lb0101_comments`,`C`.`lb0101_email` AS `lb0101_email`,`C`.`lb0101_representative_name` AS `lb0101_representative_name`,`C`.`lb0101_representative_details` AS `lb0101_representative_details`,`C`.`lb0101_created` AS `lb0101_created`,`C`.`lb0101_createdby` AS `lb0101_createdby`,`C`.`lb0101_deleted` AS `lb0101_deleted` from (`ru-rv-od`.`lb0101_client` `C` join `ru-rv-od`.`vw_lb0101_clientbyaccess1cache` `A` on((convert(`A`.`target_lb0003_id` using utf8) = `C`.`lb0101_createdby`)))
union
select `A`.`lb0102_lb0003_id` AS `lb0003_id`,`C`.`lb0101_id` AS `lb0101_id`,`C`.`lb0101_name1` AS `lb0101_name1`,`C`.`lb0101_name2` AS `lb0101_name2`,`C`.`lb0101_name3` AS `lb0101_name3`,`C`.`lb0101_name1_alt` AS `lb0101_name1_alt`,`C`.`lb0101_name2_alt` AS `lb0101_name2_alt`,`C`.`lb0101_name3_alt` AS `lb0101_name3_alt`,`C`.`lb0101_dateOfBirth` AS `lb0101_dateOfBirth`,`C`.`lb0101_idn` AS `lb0101_idn`,`C`.`lb0101_idCard_no` AS `lb0101_idCard_no`,`C`.`lb0101_idCard_dateOfIssue` AS `lb0101_idCard_dateOfIssue`,`C`.`lb0101_idCard_issuedBy` AS `lb0101_idCard_issuedBy`,`C`.`lb0101_idCard_validity` AS `lb0101_idCard_validity`,`C`.`lb0101_passport_no` AS `lb0101_passport_no`,`C`.`lb0101_passport_dateOfIssue` AS `lb0101_passport_dateOfIssue`,`C`.`lb0101_passport_issuedBy` AS `lb0101_passport_issuedBy`,`C`.`lb0101_passport_validity` AS `lb0101_passport_validity`,`C`.`lb0101_location1` AS `lb0101_location1`,`C`.`lb0101_address1` AS `lb0101_address1`,`C`.`lb0101_phone_home` AS `lb0101_phone_home`,`C`.`lb0101_phone_mobile1` AS `lb0101_phone_mobile1`,`C`.`lb0101_phone_mobile2` AS `lb0101_phone_mobile2`,`C`.`lb0101_comments` AS `lb0101_comments`,`C`.`lb0101_email` AS `lb0101_email`,`C`.`lb0101_representative_name` AS `lb0101_representative_name`,`C`.`lb0101_representative_details` AS `lb0101_representative_details`,`C`.`lb0101_created` AS `lb0101_created`,`C`.`lb0101_createdby` AS `lb0101_createdby`,`C`.`lb0101_deleted` AS `lb0101_deleted` from (`ru-rv-od`.`lb0101_client` `C` join `ru-rv-od`.`vw_lb0102_client_access_actual` `A` on((`A`.`lb0102_client_lb0101_id` = `C`.`lb0101_id`)))