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

ASF GitHub Bot commented on TRAFODION-2137:
-------------------------------------------

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

    https://github.com/apache/incubator-trafodion/pull/634#discussion_r73241487
  
    --- Diff: core/sql/arkcmp/CmpStoredProc.cpp ---
    @@ -273,77 +273,75 @@ NABoolean CmpSPOutputFormat::SetFormat(Lng32 nCols,
       nCols_ = nCols;
       // set up tableDesc_, allocate the storage from allocate routine,
       // so the delete of the tableDesc_ could be done correctly. 
    -  // As in sqlcat/desc.h readtabledef_allocate_desc(), allocate routine 
gets 
    +  // As in sqlcat/desc.h TrafAllocateDDLdesc(), allocate routine gets 
       // the storage from HEAP ( i.e. CmpCommon::statementHeap() ). 
       // Likewise, copyString should be the same implementation as in 
       // readRealArk.cpp. It was externalized originally, but being put as
       // static function by someone. Currently the code copyString is cloned
       // in the beginning of the file. ( which will allocate the memory from
       // statementHeap ).
     
    -  desc_struct* table_desc = readtabledef_allocate_desc(DESC_TABLE_TYPE);
    +  TrafDesc* table_desc = TrafAllocateDDLdesc(DESC_TABLE_TYPE, NULL);
       tableDesc_ = table_desc;
     
       char* objName = copyString(NAString(tableName));
    -  table_desc->body.table_desc.tablename = objName;
    +  table_desc->tableDesc()->tablename = objName;
     
    -  table_desc->body.table_desc.record_length = 0; // to be set later in 
generator.
    -  table_desc->body.table_desc.colcount = (Int32)nCols;
    +  table_desc->tableDesc()->record_length = 0; // to be set later in 
generator.
    +  table_desc->tableDesc()->colcount = (Int32)nCols;
     
    -  desc_struct * files_desc = readtabledef_allocate_desc(DESC_FILES_TYPE);
    -  table_desc->body.table_desc.files_desc = files_desc;
    -  files_desc->body.files_desc.fileorganization = KEY_SEQUENCED_FILE;
    +  TrafDesc * files_desc = TrafAllocateDDLdesc(DESC_FILES_TYPE, NULL);
    +  table_desc->tableDesc()->files_desc = files_desc;
       
    -  // populate the columns_desc_struct
    -  desc_struct* prev_col_desc = 0;
    -  desc_struct* first_col_desc =  0;
    +  // populate the TrafColumnsDesc
    +  TrafDesc* prev_col_desc = 0;
    +  TrafDesc* first_col_desc =  0;
       for ( Int32 i=0; i < nCols; i++ )
         {
    -      desc_struct* column_desc = 
readtabledef_allocate_desc(DESC_COLUMNS_TYPE);
    +      TrafDesc* column_desc = TrafAllocateDDLdesc(DESC_COLUMNS_TYPE, NULL);
           if (prev_col_desc)
    -    prev_col_desc->header.next = column_desc;
    +    prev_col_desc->next = column_desc;
           else
         first_col_desc = column_desc;
           prev_col_desc = column_desc;
    -      if ( !getColumnDesc( &(fields[i]), &(column_desc->body.columns_desc) 
) ) 
    +      if ( !getColumnDesc( &(fields[i]), (column_desc->columnsDesc())))
        {
          *(context_->diags()) << DgSqlCode(arkcmpErrorISPFieldDef);
          tableDesc_ = 0; // since HEAP is from statement heap, it will
          // be removed automatically at the end of statement.
          return FALSE;
             }
    -      column_desc->body.columns_desc.colnumber = i;      
    +      column_desc->columnsDesc()->colnumber = i;      
         }
     
    -  table_desc->body.table_desc.columns_desc = first_col_desc;
    +  table_desc->tableDesc()->columns_desc = first_col_desc;
     
       // populate index_desc and key_desc
    -  desc_struct* keys_desc = 0;
    +  TrafDesc* keys_desc = 0;
       if ( !getKeysDesc( nKeys, keys, keys_desc) )
          {
            *(context_->diags()) << DgSqlCode(arkcmpErrorISPFieldDef);
            tableDesc_ = 0;
            return FALSE;
          }
     
    -  desc_struct * index_desc = readtabledef_allocate_desc(DESC_INDEXES_TYPE);
    -  index_desc->body.indexes_desc.tablename = objName;
    -  index_desc->body.indexes_desc.indexname = objName;
    -  index_desc->body.indexes_desc.keytag = 0; // primary index
    -  index_desc->body.indexes_desc.record_length = 
    -    table_desc->body.table_desc.record_length;
    -  index_desc->body.indexes_desc.colcount =
    -    table_desc->body.table_desc.colcount;
    -  index_desc->body.indexes_desc.blocksize = 4096; // anything > 0
    +  TrafDesc * index_desc = TrafAllocateDDLdesc(DESC_INDEXES_TYPE, NULL);
    --- End diff --
    
    TrafIndexesDesc * perhaps?


> Improve metadata access time during query compilation
> -----------------------------------------------------
>
>                 Key: TRAFODION-2137
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2137
>             Project: Apache Trafodion
>          Issue Type: Improvement
>            Reporter: Anoop Sharma
>            Assignee: Anoop Sharma
>
> When a trafodion object is accessed for the first time in a session, 
> information about it is read from metadata.
> Multiple metadata tables are read to retrieve information about the
> objects being used in the query.
> Once metadata info is read about a table, it is cached in compiler memory. 
> Another query accessing the same object gets it from compiler metadata
> cache.
> This results in the first query compile performance to be slower than the
> subsequent queries accessing the same objects.
> This JIRA is to improve performance of first access of an object in
> a query.



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

Reply via email to