<?php require_once( dirname(dirname(dirname( __FILE__ ))) . '/wp-load.php' ); ?>
<!-- START of header -->
<?php get_header(); ?>
<!-- END of header -->

<!-- warapper -->

<div class="docs-content">
    <!-- START of page navigation -->
    <?php get_template_part( 'docs_navigation' ); ?>
    <!-- END of page navigation -->
    <!-- START of pusher -->
    <div class="docs-content-body">
        <div id="content" class="docs-content-body__inner">

            <div id="outline-container-1" class="outline-3">
            <h1 id="sec-1"><span class="section-number-3">3.6</span> Indexes </h1>
            <div class="outline-text-3" id="text-1">


            <p>
            Indexes exist to make queries and searches more efficient. When dealing with very large data sets, these indexes save on precious time and resources. A condition-based search can be processed quickly by creating an index for the columns of a container.
            There are 3 types of index - hash index (HASH), tree index (TREE) and space index (SPATIAL). A hash index is used in an equivalent-value search when searching with a query in a container. Besides equivalent-value search, a tree index is used in comparisons including the range (bigger/same, smaller/same etc.).
            The index that can be set differs depending on the container type and column data type.
            </p>
            <ul>
            <li>
            Hash Index
            <ul>
            <li>
            An equivalent value search can be conducted quickly but this is not suitable for searches that read the rows sequentially.
            </li>
            <li>
            Columns of the following data type can be set in a collection. Cannot be set in a TimeSeries container.
            <ul>
            <li>
            String
            </li>
            <li>
            Bool
            </li>
            <li>
            Byte
            </li>
            <li>
            Short
            </li>
            <li>
            Integer
            </li>
            <li>
            Long
            </li>
            <li>
            Float
            </li>
            <li>
            Double
            </li>
            <li>
            Timestamp
            </li>
            </ul>
            </li>
            </ul>
            </li>
            <li>
            Besides equivalent-value search, a tree index
            <ul>
            <li>
            is used in comparisons including the range (bigger/same, smaller/same etc.).
            </li>
            <li>
            This can be used for columns of the following data type in any type of container, except for columns corresponding to a rowkey in a TimeSeries container.
            <ul>
            <li>
            String
            </li>
            <li>
            Bool
            </li>
            <li>
            Byte
            </li>
            <li>
            Short
            </li>
            <li>
            Integer
            </li>
            <li>
            Long
            </li>
            <li>
            Float
            </li>
            <li>
            Double
            </li>
            <li>
            Timestamp

            </li>
            </ul>
            </li>
            </ul>
            </li>
            <li>
            Space Index
            <ul>
            <li>
            Can be used for only GEOMETRY columns in a collection. This is specified when conducting a spatial search at a high speed.

            </li>
            </ul>
            </li>
            </ul>

            <p>Although there are no restrictions on the no. of indexes that can be created in a container, creation of an index needs to be carefully designed. An index is updated when the rows of a configured container are inserted, updated or deleted. Therefore, when multiple indexes are created in a column of a row that is updated frequently, this will affect the performance in insertion, update or deletion operations.
            </p>
            <p>
            An index is created in a column as shown below.
            </p>
            <ul>
            <li>
            A column that is frequently searched and sorted.
            </li>
            <li>
            A column that is frequently used in the condition of the WHERE section of TQL
            </li>
            <li>
            High cardinality column (containing few duplicated values)

            </li>
            </ul>
            </div>
        </div>
    </div>
</div>
</div>

<!-- / main -->

<?php get_footer(); ?>
