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

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

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

    https://github.com/apache/incubator-trafodion/pull/634#discussion_r73265197
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---
    @@ -5322,19 +5395,74 @@ short CmpSeabaseDDL::updateObjectRedefTime(
       NAString quotedObjName;
       ToQuotedString(quotedObjName, NAString(objName), FALSE);
     
    -  str_sprintf(buf, "update %s.\"%s\".%s set redef_time = %Ld where 
catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and 
object_type = '%s' ",
    -              getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
    -              redefTime,
    -              catName.data(), quotedSchName.data(), quotedObjName.data(),
    -              objType);
    +  Int64 flags = 0;
    +  if (((CmpCommon::getDefault(TRAF_STORE_OBJECT_DESC) == DF_ON) ||
    +       (force)) &&
    +      (objUID > 0) &&
    +      (NOT isSeabaseReservedSchema(catName, schName)) &&
    +      ((strcmp(objType, COM_BASE_TABLE_OBJECT_LIT) == 0) ||
    +       (strcmp(objType, COM_VIEW_OBJECT_LIT) == 0)))
    +    {
    +      Int32 ctlFlags = GEN_PACKED_DESC | GET_SNAPSHOTS;
    +      Int32 packedDescLen = 0;
    +      TrafDesc * ds = 
    +        getSeabaseUserTableDesc(catName, schName, objName,
    +                                (strcmp(objType, 
COM_BASE_TABLE_OBJECT_LIT) == 0
    +                                 ? COM_BASE_TABLE_OBJECT : 
COM_VIEW_OBJECT),
    +                                FALSE, ctlFlags, packedDescLen);
    +      if (! ds)
    +        {
    +          processReturn();
    +          return -1;
    +        }
    +
    +      cliRC = updateTextTableWithBinaryData
    --- End diff --
    
    We update the stored descriptor here if TRAF_STORE_OBJECT_DESC is set to 
ON. What about the case when a table already has a stored object descriptor and 
TRAF_STORE_OBJECT_DESC is OFF? Should we at least delete the outdated stored 
descriptor? Sorry, I didn't check the details, probably this situation can 
never happen?


> 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