当前位置: 首页 > news >正文

网站模版怎么做的app排名优化

网站模版怎么做的,app排名优化,手机怎么建立微信公众号,手机门户网站建设分析&回答 Hive 大表和小表的关联 优先选择将小表放在内存中。小表不足以放到内存中,可以通过bucket-map-join(不清楚的话看底部文章)来实现,效果很明显。 两个表join的时候,其方法是两个join表在join key上都做hash bucket&#xff0c…

分析&回答

Hive 大表和小表的关联

  • 优先选择将小表放在内存中。
  • 小表不足以放到内存中,可以通过bucket-map-join(不清楚的话看底部文章)来实现,效果很明显。
    • 两个表join的时候,其方法是两个join表在join key上都做hash bucket,并且把你打算复制的那个(相对)小表的bucket数设置为大表的倍数。这样数据就会按照key join,做hash bucket。
    • 小表依然复制到所有节点,Map join的时候,小表的每一组bucket加载成hashtable,与对应的一个大表bucket做局部join,这样每次只需要加载部分hashtable就可以了。
    • set hive.optimize.bucketmapjoin = true;
    • 注意:如果表不是bucket的,则只是做普通join。

Spark 大表和小表的关联

采用了BroadcastHashJoin广播小表,但必须满足两个条件:

  1. 表的统计信息是否正确,也就是你要让执行计划知道你是小表,这一条我看基本上99%的文章都没有告诉你,这也是我折腾两天才发现的,我发现了就想告诉大家。我想起做MPP数据库跑批结束都会要求收集统计信息才想到的。
  2. 广播的表数据量小于spark.sql.autoBroadcastJoinThreshold值,这一条几乎所有文章都说了。 InMemoryTableScan , 除了占用内存外,效率是极高
    Spark 中 执行hive table scan操作,返回的MapPartitionsRDD对其重新定义mapPartition方法,将其行转列,并且最终cache到内存中。

MySQL 大表和小表的关联

MySQL 中一般使用 left outer join的左表必须是大表

反思&扩展

left join和left outer join的区别

left join是left outer join的缩写,所以作用是一样的。另外在SQL里没有区分大小写,也就是left join和LEFT JOIN都是可以的。

  • left join: 包含左表的所有行,对应的右表行可能为空。
  • right join: 包含右表的所有行,对应的左表行可能为空。
  • full join: 只包含左右表都匹配并且不为空的行。

Introduction to Bucket Map Join

In Apache Hive, while the tables are large and all the tables used in the join are bucketed on the join columns we use Hive Bucket Map Join feature. Moreover, one table should have buckets in multiples of the number of buckets in another table in this type of join.

How Bucket Map Join Works

Let’s understand with an example. For suppose if one table has 2 buckets then the other table must have either 2 buckets or a multiple of 2 buckets (2, 4, 6, and so on). Further, since the preceding condition is satisfied then the joining can be done on the mapper side only.

Else a normal inner join is performed. Therefore, it implies that only the required buckets are fetched on the mapper side and not the complete table.

Hence, onto each mapper, only the matching buckets of all small tables are replicated. As a result of this, the efficiency of the query improves drastically. However, make sure data does not sort in a bucket map join.

Also, note that by default Hive does not support a bucket map join. So, we need to set the following property  to true for the query to work as this join:

set hive.optimize.bucketmapjoin = true

喵呜面试助手:一站式解决面试问题,你可以搜索微信小程序 [喵呜面试助手] 或关注 [喵呜刷题] -> 面试助手 免费刷题。如有好的面试知识或技巧期待您的共享!

http://www.15wanjia.com/news/40797.html

相关文章:

  • 网络做翻译的网站公司怎么在百度上推广
  • 做宣传网站需要多少钱网站营销外包哪家专业
  • 淘宝网官方网站网页版seo专业培训中心
  • 顶呱呱做网站吗千万别在百度上搜别人的名字
  • java可以做网站吗刷神马seo排名首页排名
  • 21年网站搭建公司排行榜网站优化北京seo
  • 武汉光谷做网站费用网络热词2021
  • 常州免费网站建设免费友链平台
  • 易语言可以做网站了吗接app推广的单子在哪接
  • 淘宝怎么优化关键词排名百度推广优化师培训
  • 网站开发流程详细介绍客户关系管理
  • 怎样用一台电脑做代理 让别的电脑通过代理上几个网站百度竞价一个月5000够吗
  • 网站建设合同图片营业推广案例
  • 建设厅安全员证书查询网站群排名优化软件官网
  • 湖南长沙市芙蓉区疫情最新消息seo培训网的优点是
  • 做地铁建设的公司网站整合营销传播策划方案
  • 遵义网站建设oadminapp定制开发
  • 百度网站托管谷歌搜索引擎在线
  • 源码网站下载百度快照seo
  • 网站做优化和推广哪个好广东最新疫情
  • 2024新冠又来了吗广州seo顾问seocnm
  • 彩票系统网站建设搜索关键词排名优化服务
  • 移动网站是什么意思企业网站制作方案
  • 软文营销的步骤引擎seo优
  • 政府网站建设基础seo推广优化服务
  • 一个用户注册的网站怎么做seo百度站长工具
  • 织梦网站后台默认登陆路径安卓排名优化
  • mobi域名网站精准客户资源购买
  • yyf做的搞笑视频网站重庆seo是什么
  • 中国拟在建项目网优化工具箱下载