안녕. 어느 것이이 mysql select 문의 where 조건을 단순화 할 수 있습니까? 결과를 가져 오는 데 시간이 오래 걸리거나 SET SQL_BIG_SELECTS = 1을 묻습니다. 아래 쿼리 어느 것이이 mysql select의 where 조건을 단순화 할 수 있습니까
: 가우편가 SW10BH12 또는 와 같은 값을 포함
* 표시 req_area * 포함 켄싱턴 첼시, SW10,
같은 데이터영역의 값은 입니다. Kensington and Chel 바다,
* town_area *는 웨스트 브롬톤, 첼시와 같은 값을 가짐.
select `a`.`user_id` AS `user_id`,`a`.`req_area` AS `req_area`,`a`.`req_area2` AS `req_area2`,`a`.`req_area3` AS `req_area3`,
`a`.`req_property_type` AS `req_property_type`,`a`.`req_bedrooms` AS `req_bedrooms`,`b`.`latitude` AS `latitude`,
`b`.`longitude` AS `longitude`,`b`.`postcode` AS `postcode`
from (`cff_user_property_req_view` `a` join `cff_uk_short_postcodes` `b`)
where
(`b`.`postcode` regexp concat("'",TRIM(`a`.`req_area`),'|',TRIM(`a`.`req_area2`),'|',TRIM(`a`.`req_area3`),"'")>=1 or
`b`.`region` regexp concat("'",TRIM(`a`.`req_area`),'|',TRIM(`a`.`req_area2`),'|',TRIM(`a`.`req_area3`),"'")>=1 or
`b`.`town_area` regexp concat("'",concat('[[:<:]]',`a`.`req_area`,'[[:>:]]'),'|',concat('[[:<:]]',`a`.`req_area2`,'[[:>:]]'),'|',concat('[[:<:]]',`a`.`req_area3`,'[[:>:]]'),"'")>=1)
order by `a`.`user_id`;
미리 감사드립니다.