Menu

Proposal of global index on non-partition tab

w zc
2010-11-10
2013-04-26
  • w zc

    w zc - 2010-11-10

    Proposal of global index on non-partition table

    1. Extend _db_index catalog, add two attributes: is_global and node_name. The two attributes in _db_index are the same as they in _db_class.
    If the index is global index, is_global is 1, else it's 0.
    node_name manifest this index (B plus tree) is created on which node.

    2. Index (B plus tree) will be created only on the real table. But the index information will be saved into schema of both real table and proxy table(s).
    Like the figure shows:

    There are two nodes in cluster: node1 and node2. A global table named G_table is created on node1. A global index named i_GT is on G_table. The B Plus Tree is created only on the real node(). The schema of real table and proxy all contains the index information.

    When user execute the following statement:

    SELECT * from G_table where … using index i_GT
    

    No matter user connected to node1 or node2, CUBRID always can get the index information from the global table’s schema.

    My proposal is like this. Hi iamyaw, what's your opinion about this?

     
  • Kieun Park

    Kieun Park - 2010-11-12

    Basic concept looks good!
    Your basic concept is to make a kind of proxy for global index, right?
    Then, let's think about what is a important point for global index…
    I think, one of thigns is  obtaining BTID and BTREE_STATS from the real index. Those information is stored in the catalog file (please note that it differs from system catalog tables).
    The simillart thing is how to obtain the statistics information for the real class.
    Please see the "qo_get_indeX_info()" function in the "query_graph.c" file.
    and, this issue might be discussed with the person who is in charge of the task of getting statistics information from the remote node. Who is it?

     
  • Wang Dong

    Wang Dong - 2010-11-12

    I can ask the question about statistic.
    In fact, the statistic info in sm_class can be from the real class.
    In prepare qo_node, it will get statistic from server side.
    qo_add_node->qo_get_class_info->grok_classes()->sm_get_class_with_statistics();

    in this function(sm_get_class_with_statistics), we can get real statistic from real class.
    The the qo_get_index_info() can use the real statistic for genarate query plan.

    Thanks a lot,

     

Log in to post a comment.