trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #811: [TRAFODION-2322] Improve UPDATE STATS...
Date Thu, 03 Nov 2016 20:21:50 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/811#discussion_r86434531
  
    --- Diff: core/sql/ustat/hs_cli.cpp ---
    @@ -5442,12 +5427,17 @@ NAString HSSample::getTempTablePartitionInfo(NABoolean unpartitionedSample,
     //
     void HSSample::addTruncatedSelectList(NAString & qry)
       {
    +    bool first = true;
         for (Lng32 i = 0; i < objDef->getNumCols(); i++)
           {
    -        if (i)
    -          qry += ", ";
    +        if (!ComTrafReservedColName(*objDef->getColInfo(i).colname))
    --- End diff --
    
    This is doable, but with some significant work. UPDATE STATS today gets its column information
by doing a prepare of SELECT [SYSKEY,] * FROM table_name, then doing a CLI describe of that.
The CLI doesn't tell us today whether a column is a system column or not. And we probably
don't want to go to that trouble, since that would involve enhancing the compiler to produce
another synthesized attribute in the compiled plan. Instead, I'd propose replacing this prepare/describe
scheme with a query to the metadata COLUMNS table. I think we already have the object UID
so a single-table query of COLUMNS should be possible. We should be able to then easily get
all the information we get today along with "user vs. system" column state. Alternatively
we may be able to get the column information from the NATableDB cache. Either way, I think
these solutions are likely to be more efficient than the existing logic, so that would be
an added bonus of such redesign. I will consider this for follow-
 on work.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message