【发布时间】:2021-09-16 04:14:07
【问题描述】:
我正在努力提高我的查询性能,因为我正在处理大数据。 (许多 TB 的数据) 我正在开发 Impala。
我使用的查询如下所述。这是子查询的形式。不知道如何优化它。 可能是加入。如果是,我无法将此子查询转换为 JOINS。
请就如何将此子查询转换为 JOINS 提出建议。我需要提高查询性能
select mytable.id,group_concat(mytable.acqid) as 'acqid',group_concat(mytable.address) as 'address'
from (select myinnertable.id, case when myinnertable.mykey = 'AcqId' then myinnertable.myvalue end as 'acqid',
case when myinnertable.mykey = 'Address' then myinnertable.myvalue end as 'address'
from (select id,mykey,myvalue
from table1
where table1.date_col BETWEEN '2021-05-02' and '2021-05-19' and mykey!='velList'
) myinnertable
) mytable
group by mytable.id;
【问题讨论】:
-
您的查询只涉及一个表。你会想到什么样的
JOIN?