zOs/SQL/CATIXLAS
select max(r.lastUsed), count(*)
, substr(strip(i.creator) || '.' || i.name, 1, 30)
, max(i.createdTS) "created", max(r.updateStatsTime) "stats"
from sysibm.sysIndexes i
left join sysibm.sysIndexSpaceStats r
on i.creator = r.creator and i.name = r.name
where i.dbName = 'WI02A1P'
group by i.creator, i.name
order by case when max(r.lastUsed) is not null then max(r.lastUsed)
else '01.01.0001' end
;x;
select value(i.creator, r.creator) || '.'
|| value(i.name, r.name)
, i.name, r.name
from sysibm.sysIndexes i
full join sysibm.sysIndexSpaceStats r
on i.creator = r.creator and i.name = r.name
where i.name is null or r.name is null
;x;
from sysibm.sysIndexes i
full join sysibm.sysIndexSpaceStats r
on i.creator = r.creator and i.name = r.name
where i.dbName = 'WI02A1P'
group by i.creator, i.name
order by 1 desc