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

LP Bug: 1393930 - Update Stats fails on empty table using internal sort

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • 1.2-incubating
    • sql-cmp
    • None

    Description

      When an Update Statistics statement is executed on a table that is empty but previously contained one or more rows, if internal sort is used the statement fails with the following error:

          • ERROR[9207] The specified SAMPLE option generated an empty sample set. Modify the SAMPLE option and resubmit.

      The intended behavior is for the statement to succeed without generating any histograms. The error is particularly confusing because the ustat statement may not have even included the SAMPLE option.

      To reproduce this error, first create a simple table and populate it with at least one row:

      cqd MODE_SEABASE 'ON';

      create table tbl
      (
      a int not null primary key,
      b int,
      c int,
      d int
      );

      insert into tbl values (1,2,3,4);

      From this point, execute either of the following sequences to produce the error.
      Option 1:
      update statistics for table tbl on every column;
      delete from tbl;
      update statistics for table tbl on every column;

      Option 2:
      delete from tbl;
      cqd USTAT_USE_IS_WHEN_NO_STATS 'on';
      update statistics for table tbl on every column;

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: