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

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_r73245549
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLschema.cpp ---
    @@ -971,6 +972,251 @@ void 
CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
     
     // 
*****************************************************************************
     // *                                                                       
    *
    +// * Function: CmpSeabaseDDL::alterSeabaseSchema                           
     *
    +// *                                                                       
    *
    +// *    Implements the ALTER SCHEMA command.                               
     *
    +// *                                                                       
    *
    +// 
*****************************************************************************
    +// *                                                                       
    *
    +// *  Parameters:                                                          
    *
    +// *                                                                       
    *
    +// *  <alterSchemaNode>                StmtDDLAlterSchema *             In 
      *
    +// *    is a pointer to a create schema parser node.                       
    *
    +// *                                                                       
    *
    +// 
*****************************************************************************
    +void CmpSeabaseDDL::alterSeabaseSchema(StmtDDLAlterSchema * 
alterSchemaNode)
    +   
    +{
    +   Lng32 cliRC = 0;
    +
    +   ComSchemaName schemaName(alterSchemaNode->getSchemaName());
    +   NAString catName = schemaName.getCatalogNamePartAsAnsiString();
    +   ComAnsiNamePart schNameAsComAnsi = schemaName.getSchemaNamePart();
    +   NAString schName = schNameAsComAnsi.getInternalName();
    +   ComObjectName 
objName(catName,schName,NAString("dummy"),COM_TABLE_NAME,TRUE);
    +
    +   ExeCliInterface cliInterface(STMTHEAP, NULL, NULL, 
    +                                
CmpCommon::context()->sqlSession()->getParentQid());
    +   Int32 objectOwnerID = 0;
    +   Int32 schemaOwnerID = 0;
    +   ComObjectType objectType;
    +
    +   bool isVolatile = 
(memcmp(schName.data(),"VOLATILE_SCHEMA",strlen("VOLATILE_SCHEMA")) == 0);
    +   int32_t length = 0;
    +   int32_t rowCount = 0;
    +   bool someObjectsCouldNotBeAltered = false;
    +   char errorObjs[1010];
    +   Queue * objectsQueue = NULL;
    +   Queue * otherObjectsQueue = NULL;
    +
    +   NABoolean dirtiedMetadata = FALSE;
    +   Int32 checkErr = 0;
    +
    +   StmtDDLAlterTableStoredDesc::AlterStoredDescType sdo = 
    +     alterSchemaNode->getStoredDescOperation();
    +
    +   errorObjs[0] = 0;
    +
    +   Int64 schemaUID = 
getObjectTypeandOwner(&cliInterface,catName.data(),schName.data(),
    +                               
SEABASE_SCHEMA_OBJECTNAME,objectType,schemaOwnerID);
    +   
    +   // if schemaUID == -1, then either the schema does not exist or an 
unexpected error occurred
    +   if (schemaUID == -1)
    +   {
    +      // If an error occurred, return
    +      if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_) > 0)
    +          goto label_error;
    + 
    +      // A Trafodion schema does not exist if the schema object row is not
    +      // present: CATALOG-NAME.SCHEMA-NAME.__SCHEMA__.
    +      *CmpCommon::diags() << DgSqlCode(-CAT_SCHEMA_DOES_NOT_EXIST_ERROR)
    +                          << 
DgSchemaName(schemaName.getExternalName().data());
    +      goto label_error;
    +   }
    +
    +   if (!isDDLOperationAuthorized(SQLOperation::DROP_SCHEMA,
    --- End diff --
    
    Is there an ADD_SCHEMA privilege? Just curious: Why did we pick DROP_SCHEMA 
privilege for an alter schema operation?


> 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