running update statistics and select statements from the same session results in card mismatch

Bug #1343455 reported by Ravisha Neelakanthappa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
In Progress
Low
taoufik ben abdellatif

Bug Description

This problem is probably related to query caching and should be fixed otherwise we can't really test cardinality related probelms in our regression suites.

How to reproduce:
>>create table T011T2 (a int not null, b char(500),
+> c int not null, primary key(a))
+>salt using 4 partitions;

--- SQL operation complete.
>>
>>insert into T011T2 values (1, 'a', 11), (2, 'b', 22), (3, 'c', 33);

--- 3 row(s) inserted.
>>insert into T011T2 values (10, 'aa', 110), (20, 'bb', 220), (30, 'cc', 330);

--- 3 row(s) inserted.
>>insert into T011T2 values (11, 'aaa', 111), (22, 'bbb', 222), (33, 'ccc', 333);

--- 3 row(s) inserted.
>>update statistics for table T011T2 on every column;

--- SQL operation complete.
>>
>>-- should get serial plans
>>explain options 'f'
+>select b, c
+>from T011T2
+>where a = ?;

LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- -------------------- ---------

1 . 2 root o 5.00E+001
. . 1 trafodion_scan T011T2 5.00E+001

--- SQL operation complete.
>>

The correct cardinality estimation for T011T2 should be 1.

if you run the same select from a new sqlci session, you would see correct cardinality of 1 row as shown below:

>>set schema trafodion.sch;

--- SQL operation complete.
>>explain options 'f'
+>select b, c from T011T2
+>where a = ?;

LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- -------------------- ---------

1 . 2 root o 1.00E+000
. . 1 trafodion_scan T011T2 1.00E+000

--- SQL operation complete.
>>

Our regressions tests run both update stat and queries in the same sqlci session.

Tags: sql-cmp
Changed in trafodion:
status: New → In Progress
Revision history for this message
taoufik ben abdellatif (taoufik-abdellatif) wrote :

The fix to this issue requires metadata support (redef timestamp) that we currently don't have.

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.