hive sql子查询缓慢
生活随笔
收集整理的這篇文章主要介紹了
hive sql子查询缓慢
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
查詢數據最新分區,有時候數據不是t-1的,需要獲取到最后一次的分區數據,之前使用的是最大分區:
select user_no,score from table_a?where pday=(select max(pday) from table_a)上述方式為子查詢,會掃描所有分區執行非常緩慢,經查詢發現,join管理會更快,如下:
selectuser_no,score from (select max(pday) pday from table_a where pday>='${three_day_ago}') t1 join table_a t2 on t1.pday=t2.pday可酌情針對近x天的數據匹配
總結
以上是生活随笔為你收集整理的hive sql子查询缓慢的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 非常详细的STM32 CAN通信的贴子,
- 下一篇: 我心中的计算机作文500,我眼中的作文5