[ 
https://issues.apache.org/jira/browse/TAJO-838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14184043#comment-14184043
 ] 

ASF GitHub Bot commented on TAJO-838:
-------------------------------------

Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/192#discussion_r19374759
  
    --- Diff: 
tajo-algebra/src/main/java/org/apache/tajo/algebra/CreateIndex.java ---
    @@ -0,0 +1,129 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.tajo.algebra;
    +
    +import com.google.common.base.Objects;
    +import com.google.gson.annotations.Expose;
    +import com.google.gson.annotations.SerializedName;
    +import org.apache.tajo.algebra.Sort.SortSpec;
    +import org.apache.tajo.util.TUtil;
    +
    +import java.util.Map;
    +
    +public class CreateIndex extends UnaryOperator {
    +  @Expose @SerializedName("IsUnique")
    +  private boolean unique = false;
    +  @Expose @SerializedName("IndexName")
    +  private String indexName;
    +  @Expose @SerializedName("SortSpecs")
    +  private SortSpec[] sortSpecs;
    +  @Expose @SerializedName("Properties")
    +  private Map<String, String> params;
    +  @Expose @SerializedName("IndexMethodSpec")
    +  private IndexMethodSpec methodSpec;
    +
    +  public CreateIndex(final String indexName, final SortSpec[] sortSpecs) {
    +    super(OpType.CreateIndex);
    +    this.indexName = indexName;
    +    this.sortSpecs = sortSpecs;
    +    this.methodSpec = new IndexMethodSpec("TWO_LEVEL_BIN_TREE");
    +  }
    +
    +  public void setUnique(boolean unique) {
    +    this.unique = unique;
    +  }
    +
    +  public boolean isUnique() {
    +    return this.unique;
    +  }
    +
    +  public void setIndexName(String indexName) {
    +    this.indexName = indexName;
    +  }
    +
    +  public String getIndexName() {
    +    return indexName;
    +  }
    +
    +  public void setSortSpecs(SortSpec[] sortSpecs) {
    --- End diff --
    
    SortSpec[] contains indexing keys.


> Improve query planner to utilize index
> --------------------------------------
>
>                 Key: TAJO-838
>                 URL: https://issues.apache.org/jira/browse/TAJO-838
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: planner/optimizer
>            Reporter: Jihoon Son
>            Assignee: Jihoon Son
>            Priority: Minor
>
> Index can improve the query performance when the selectivity of query is high.
> Thus, query planner should decide whether index is used or not for a given 
> query.
> The selectivity can be guessed using statistics.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to