SQL Performance (MOSC)

MOSC Banner

Performance issue due to index not being used

in SQL Performance (MOSC) 9 commentsAnswered ✓

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):

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center