[
https://issues.apache.org/jira/browse/TRAFODION-2137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405133#comment-15405133
]
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_r73267154
--- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---
@@ -6019,6 +6181,93 @@ short CmpSeabaseDDL::updateTextTable(ExeCliInterface
*cliInterface,
return 0;
}
+short CmpSeabaseDDL::updateTextTableWithBinaryData
+(ExeCliInterface *cliInterface,
+ Int64 objUID,
+ ComTextType textType,
+ Lng32 subID,
+ char * inputData,
+ Int32 inputDataLen,
+ NABoolean withDelete)
+{
+ Lng32 cliRC = 0;
+ if (withDelete)
+ {
+ // Note: It might be tempting to try an upsert instead of a
+ // delete followed by an insert, but this won't work. It is
+ // possible that the metadata text could shrink and take fewer
+ // rows in its new form than the old. So we do the simple thing
+ // to avoid such complications.
+ cliRC = deleteFromTextTable(cliInterface, objUID, textType, subID);
+ if (cliRC < 0)
+ {
+ return -1;
+ }
+ }
+
+ // convert input data to utf8 first.
+ ComDiagsArea * diagsArea = CmpCommon::diags();
+ char * inputDataUTF8 = new(STMTHEAP) char[inputDataLen*4];
+ Lng32 inputDataLenUTF8 = 0;
+ ex_expr::exp_return_type rc =
+ convDoIt(inputData,
--- End diff --
Treating the binary data as ISO8859-1 and converting that to UTF-8 is one
way, but it is not very efficient and it results in unprintable characters.
Another option would be to use 64 printable characters like '0' (zero) to 'o'
(lower case O) and chop the binary data up into 6 bit pieces and encode each
one into one of these characters. The overhead would be 33%. The ISO88591
method uses somewhere between 0 and 100% overhead, probably less than 50% in
typical cases. It may not be worth it from the point of saving space, but it
would avoid the unprintable characters.
Of course you can blame me for suggesting the ISO88591 method in the first
place, so I guess I shouldn't complain about it now :-)
> 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)