Update Stats fails on empty table using internal sort

Bug #1393930 reported by Barry Fritchman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
New
Low
Barry Fritchman

Bug 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;

Tags: sql-cmp
Changed in trafodion:
milestone: none → r2.0
tags: added: sql-cmp
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.