日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

hive not in效率優化

作者:NoOne-csdn 更新時間: 2022-04-01 編程語言

hive not in 效率忍不了

select
  shop_id
from
  whitelist
where
  date = '${date-1}'
  and shop_id not in (
    select
      shop_id
    from
      whitelist
    where
      date =  '${date-2}'
  )
  limit 20

愣是跑了十幾分鐘沒完
修改后

select
  a.shop_id
from
  (
    select
      shop_id
    from
      whitelist
    where
      date = '${date-1}'
  ) a
  left join (
    select
      shop_id
    from
      whitelist
    where
      date = '${date-2}'
  ) b
on a.shop_id = b.shop_id
where
  b.shop_id is null

4s跑完

原文鏈接:https://blog.csdn.net/weixin_40161254/article/details/120545462

欄目分類
最近更新