ALL COVERED TOPICS

NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

Hive Top-K Optimization

A simple optimization of top-k queries that can make a huge difference: going from the default behavior of:

  1. sifting through all the data (necessary),
  2. sorting it all (necessary),
  3. writing all the results to disk (unnecessary—saving all the limit results from each map is enough), and
  4. having the reducer process again all the data (unnecessary—the previous step already reduced the amount of data down to the limit * number_of_partitions).

For reference a top-k query is:

SELECT * FROM T ORDER BY a DESC LIMIT 10

Original title and link: Hive Top-K Optimization (NoSQL database©myNoSQL)

via: http://www.qubole.com/blog/index.php/top-k-optimization/