You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "David Wayne Birdsall (JIRA)" <ji...@apache.org> on 2015/09/18 22:41:04 UTC

[jira] [Created] (TRAFODION-1494) UPDATE STATS sample table population query gets serial plan

David Wayne Birdsall created TRAFODION-1494:
-----------------------------------------------

             Summary: UPDATE STATS sample table population query gets serial plan
                 Key: TRAFODION-1494
                 URL: https://issues.apache.org/jira/browse/TRAFODION-1494
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
    Affects Versions: 1.1 (pre-incubation)
         Environment: All
            Reporter: David Wayne Birdsall
            Assignee: David Wayne Birdsall
             Fix For: 2.0-incubating


If a table is large enough so that sample data does not fit in memory, UPDATE STATS will create a table and use an UPSERT or LOAD statement to load it with a sample of the table of interest. The query plan being generated for this UPSERT/LOAD is a serial plan which is quite slow. It should generate a parallel plan.

The problem is in CmpSeabaseDDL::restoreAllControlsAndFlags. We set a bunch of CQDs for metadata queries so their plans are not affected by any user CQDs. The procedure CmpSeabaseDDL::restoreAllControlsAndFlags is in charge of restoring the CQDs afterward, but fails to.

One of the CQDs that fails to get reset is "attempt_esp_parallelism". It is turned OFF for the metadata queries. Since it does not get reset, all plans afterward (including sample table population) are serial.

The bug is in the following statement in CmpSeabaseDDL::restoreAllControlsAndFlags:

  if (CmpCommon::context()->getCntlCount() > 0 &&
      CmpCommon::context()->getCntlCount() < CQD_SENT_MAX)

The "<" should be a "<=". (Off-by-one bug.)



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