0
Apache Impala를 테스트 중이며 GROUP BY와 LIKE를 함께 사용하면 매우 느리게 작동합니다. 별도의 쿼리가 훨씬 빠르게 작동합니다. 대안이있는 경우Group By and Like를 사용하는 임팔라 쿼리의 성능이 느림
# 1.37s 1.08s 1.35s
SELECT * FROM hive.default.pcopy1B where
(lower("by") like '%part%' and lower("by") like '%and%' and lower("by") like '%the%')
or (lower(title) like '%part%' and lower(title) like '%and%' and lower(title) like '%the%')
or (lower(url) like '%part%' and lower(url) like '%and%' and lower(url) like '%the%')
or (lower(text) like '%part%' and lower(text) like '%and%' and lower(text) like '%the%')
limit 100;
# 156.64s 155.63s
select "by", type, ranking, count(*) from pcopy where
(lower("by") like '%part%' and lower("by") like '%and%' and lower("by") like '%the%')
or (lower(title) like '%part%' and lower(title) like '%and%' and lower(title) like '%the%')
or (lower(url) like '%part%' and lower(url) like '%and%' and lower(url) like '%the%')
or (lower(text) like '%part%' and lower(text) like '%and%' and lower(text) like '%the%')
group by "by", type, ranking
order by 4 desc limit 10;
누군가가이 문제가 발생하는 이유를 설명하고, 시겠어요 : 여기에 두 가지 예?
두 개의 쿼리는 나에게 매우 다른 것처럼 보입니다. 첫 번째는 레코드를 선택하고 하나의 커서 만 필요하며 두 번째는 모든 레코드를 검색하고 GROUP과 SORT를 모두 실행해야합니다. 반환되는 레코드가 너무 많으면 시간의 차이를 설명 할 수 있습니다. 또는 나는 무엇인가 놓쳤 느냐? – LSerni