The problem is listed as resolved in 9.7.1, but the same one exists in all recent 11.5 and 11.1 versions.
IC62904: ISSUE EXP0059W FOR STATVIEWS WITH SELECT DISTINCT.
Still the same EXP0059W in the access plan.
The steps to reproduce:
connect to mydb;
create table ta (a1 int);
create table tb (b1 int);
create view sv as (select * from ta where a1 in (select b1 from tb));
alter view sv enable query optimization;
explain all with snapshot for
select * from ta where a1 in (select b1 from tb);
!db2exfmt -d mydb -1 -o sv.plan;
The access plan contains the following message similar to the one described at the link:
Diagnostic Details: EXP0059W The following MQT or statistical view was
not eligible because of one or more of the
following reasons: (1) the MQT had extra table
joins or GROUP BY columns that were not present in
the query, or (2) the query had an SQL construct
such as ORDER BY, FETCH FIRST n ROWS, DISTINCT, or
had a subquery that could not be matched:
"DB2ADMIN"."SV".
I can't open a Case with IBM support.
The question is: does somebody know how to resolve the problem with, say, some registry variable setting or with other facilities?