Performance issue due to index not being used
Hi,
Me again with another cardinality issue it seems. My DB version is 19.21.
I'm trying to understand why Oracle isn't using an index for a query with a WHERE clause whose criteria contain indexed columns. The query is as follows:
select * from kcm_grp_contributions grp
where pol_linked_policy_id = 0
and status = 6
and data_type = 2;
I'm expecting the following index to be used:
KEY004KCM_GRP_CONTRIBUTIONS(POL_LINKED_POLICY_ID, STATUS, DATA_TYPE, POLICY_ID);
But Oracle does a FULL SCAN :
The cardinality here is wrong, there are only 3360 rows to be retrieved:
And the COUNT(*) uses the index (with wrong cardinality):