Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1 (pre-incubation)
-
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.)