Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: trivial edits in removal section, add some links

Table of Contents

Indexing Is Removed since 3.0

There are alternate options which might work similarily to indexing:

  • Materialized views with automatic rewriting can result in very similar results.  Hive 2.3.0 adds support for materialzed views.
  • Using columnar file formats (ParquetORC they can do selective scanning; they may even skip entire files/blocks.
Note

Indexing has been removed in version 3.0 (HIVE-18448).

Overview of Hive Indexes

The goal of Hive indexing is to improve the speed of query lookup on certain columns of a table. Without an index, queries with predicates like 'WHERE tab1.col1 = 10' load the entire table or partition and process all the rows. But if an index exists for col1, then only a portion of the file needs to be loaded and processed.

...

  • Indexes – design document (lists indexing JIRAs with current status, starting with HIVE-417)

...

Configuration Parameters for Hive Indexes

The Configuration Properties document describes parameters that configure Hive indexes.

Simple Examples

This section gives some indexing examples adapted from the Hive test suite.

Note
titleCase sensitivity

In Hive 0.12.0 and earlier releases, the index name is case-sensitive for CREATE INDEX and DROP INDEX statements.  HoweverHowever, ALTER INDEX requires an index name that was created with lowercase letters (see HIVE-2752). This bug will be fixed in a future release by is fixed in Hive 0.13.0 by making index names case-insensitive for all HiveQL statements; in the meantime. For releases prior to 0.13.0, the best practice is to use lowercase letters for all index names.

...