let 's see :
if something is using index CHREMPL3, matchcols=1 and index CHREMPL3 has columns(ColA,ColB,ColC) which columns do you think are used ?
So that's one way to find out.
The best one is to use some tool like OSC to visual explain your query.
The geeky way is to have a full set of explain tables (not just plan_table) and start looking in dsn_filter_table and dsn_predicat_table.
next query will give you more lines, listing all predicats used in that "step', and how (MATCHING,SCREENING,STAGE1,STAGE2)
select
l.PROGNAME
, l.version
, l.bind_time
, l."QUERYNO"
, strip(char(l.qblockno)) || ',' || strip(char( l.planno)) || ',' || strip(char(l.mixopseq)) as StepNo
,case when l.creator > '' then strip(l.creator) !! '.' !! strip(l.tname) else '' end as "Table"
,case l.method when 0 then ' '
when 1 then ' Nested Loop '
when 2 then ' Merge Scan '
when 3 then ' Sort '
when 4 then ' Hybrid Join '
else ' ' end !!
case l.accesstype when 'I' then strip(l.accessname) !!
case l.matchcols when 0 then ' Non-matching'
else '(MatchCols=' !! strip(char(l.matchcols)) !! ')' end
when 'I1' then 'One-fetch IX ' !! strip(l.accessname)
when 'R' then 'Tablespace scan ' !! strip(l.tname)
when 'N' then 'IN-list ' !! strip(l.accessname) !! '(MatchCols=' !! strip(char(l.matchcols)) !! ')'
when 'M' then 'Multiple Ix (+ by MU,MI,MX) '
when 'MU' then 'Union of RIDs due to OR '
when 'MI' then 'Intersection RIDs due to AND '
when 'MX' then 'RIDs collection ' !! strip(l.accessname) !! '(MatchCols=' !! strip(char(l.matchcols)) !! ')'
when 'P' then 'Dynamic Index anding ' !! strip(l.accessname)
when 'T' then 'Sparse Index ' !! strip(l.accessname)
else ' ' end !!
case l.prefetch when 'L' then ' List prefetch'
when 'S' then ' Seq. prefetch'
else ' ' end
as step
, f.stage
, p.text
, char(decimal (p.filter_factor * 100,9,6)) !! '%'
from plan_table l
left join DSN_FILTER_TABLE F
on F.collid = l.collid
and f.progname =l.progname
and f.queryno = l.queryno
and f.qblockno = l.qblockno
and f.planno = l.planno
and f.mixopseqno = l.mixopseq
and f.explain_time = l.bind_time
left join DSN_PREDICAT_TABLE P
on P.progname = F.progname
and p.explain_time = f.explain_time
and p.queryno = f.queryno
and p.qblockno = f.qblockno
and p.predno = f.predno
where l.collid = &collid
and l.progname = &progname
and l.queryno = &queryno
order by l.version,l.queryno,l.qblockno,l.planno,l.mixopseq,l.bind_time,f.stage
I can explain it to you, but i can not understand it for you.