In 11g, I think there are two other ways to get
statistics collected for indexed expressions:
1) Collect
extended statistics directly on the expression. So for
instance, if we had a function SALES_CATEGORY, we might do this:
DBMS_STATS.gather_table_stats
(ownname => USER,
tabname => ‘SALES’,
method_opt => ‘FOR ALL COLUMNS FOR COLUMNS
(sale_category(amount_sold))’
);
2) Create a virtual
column on the expression, then index that column.
So for the same example as above we might create the following virtual
column, then index the column and collect stats as usual:
ALTER TABLE
SALES
ADD
sales_category
GENERATED ALWAYS AS
(sale_category(amount_sold));
I think I like the first method
better, because the statistics will still exist even if the index is
dropped and – unlike the second approach – it doesn’t change the logical
structure of the table.