我正在处理一个数据库(2.5 GB),其中有些表只有40行,有些表有900万行数据。当我对大表进行任何查询时,都会花费更多的时间。我想在更短的时间内得到结果
对只有90行的表的小查询-->
hive> select count(*) from cidade;
Time taken: 50.172 secondshdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
<property>
<name>dfs.block.size</name>
<value>131072</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
</configuration>这些设置是否会影响配置单元的性能?dfs.replication=3 dfs.block.size=131072
是否可以从配置单元提示符将其设置为
hive>set dfs.replication=5此值是否仅在永久会话中保留?
或者在.xml文件中更改它更好?
发布于 2012-11-15 23:28:09
重要的是,select count(*)将导致hive启动map reduce作业。
你可能认为这很快,就像mysql查询一样。
但在hadoop中,即使是一个最简单的map reduce任务,总时间也是由提交到任务跟踪器,分配任务到任务跟踪器等组成的,所以总时间至少有几十秒。
在一张大桌子上试试select count(*)。时间不会增加太多。
因此,您需要了解hive和hadoop处理大数据。
发布于 2012-11-05 03:17:32
dfs.replication应该不会影响您的配置单元查询的运行时。它是从hdfs-site.xml中公开的一个属性,用于确定将一个数据块复制到多少个HDFS节点。dfs.replication为3表示每个数据块(总共)位于3个节点上。因此,它不是针对特定会话的。
https://stackoverflow.com/questions/13173289
复制相似问题