At 12:57 PM 6/29/2006, Laimutis Nedzinskas wrote:
>From: Wolfgang Breitling [mailto:breitliw@xxxxxxxxxxxxx] >This is probably your problem right there. Earlier you were claiming that you had a histogram on the type (status?) column. Your above gather_table_stats call does not create a histogram on any columns of TEST_CBO. "FOR ALL COLUMNS SIZE AUTO" creates histograms ONLY on columns that have been used in a predicate. Since this is a brand new table none of the columns have of course been used in a predicate yet, so no histograms are created.
This is exactly what I noticed before: plan may change just like that w/o no reason. It's enough just to issue explain plan several times. Is 2 a magic number? May be.