Reg : Efficiency among query optimizers in hive

早过忘川 提交于 2021-02-18 18:13:25

问题


After reading about query optimization techniques I came to know about the below techniques.

1. Indexing - bitmap and BTree
2. Partitioning
3. Bucketing

I got the difference between partitioning and bucketing, and when to use them but I'm still confused how indexes actually work. Where is the metadata for index is stored? Is it the namenode which is storing it? I.e., actually while creating partitions or buckets we can see multiple directories in hdfs which explains the query performance optimization but how to visualize indexes? Are they really used in real life despite partitioning and bucketing being in the picture?

Please help me for the above queries and is there's any dedicated page for hadoop and hive developers community?


回答1:


  1. Indexes in Hive were never used in real life and were never efficient and as @mazaneicha noticed in the comment Indexing feature is removed completely in Hive 3.0, read this Jira: HIVE-18448. It was a great try any way, thanks to Facebook support, valuable lessons have been learned.

But there are light-weight indexes in ORC (well, not actually classic indexes but min, max and Bloom filter, it helps to prune stripes). ORC indexes also are most efficient is the data is sorted during insert (distribute+sort)

  1. Partitioning is the most efficient if partitioning schema corresponds to how the table is being filtered or how is it being loaded (allows to load partitions in parallel, if the increment data is the whole partition it works efficiently).

  2. Bucketing can help with optimizing joins and group by but sort-merge-bucket-mapjoin has serious restrictions making it also not efficient. Both tables should have the same bucketing schema, which in real life is rare or can be extremely inefficient. Also data should be sorted when loading buckets.

Consider using ORC with built-in indexes and Bloom filters, keep less number of files in your table to avoid metadata overload and avoid mappers copying thousands of files. Read this partitions in hive interview questions and this Sorted Table in Hive

Useful links.

Official documentation: LanguageManual

Cloudera community: https://community.cloudera.com/



来源:https://stackoverflow.com/questions/61300659/reg-efficiency-among-query-optimizers-in-hive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!