My Oracle Support Banner

During MView Refresh, the Hint "HASH_SJ" Prevents MView Indexes from Being Used for Delete Statement and Causing Poor Performance (Doc ID 1949537.1)

Last updated on OCTOBER 21, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

During the Refresh, the recursive DELETE statement is not using the MVIEW INDEXES. Hence, it always accesses the MVIEW with FULL SCAN for deleting the rows.
You may see a statement like below:

/* MV_REFRESH (DEL) */ DELETE FROM <mview> SNA$ WHERE <column_name> IN (SELECT /*+ HASH_SJ */ * FROM (SELECT M_ROW$$ RID$ FROM MLOG$_<master> MAS$ WHERE SNAPTIME$$ > :B_ST0) AS OF SNAPSHOT(:B_SCN) MAS$)

The above statement uses "HASH_SJ" hint which enables Optimizer to use "MAT_VIEW ACCESS FULL" rather than the Index created for the DELETE.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.