Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-1494

UPDATE STATS sample table population query gets serial plan

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1 (pre-incubation)
    • 1.2-incubating
    • sql-cmp
    • None
    • All

    Description

      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.)

      Attachments

        Activity

          People

            dbirdsall Dave Birdsall
            dbirdsall Dave Birdsall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified