During MView Refresh, the Hint "HASH_SJ" Prevents MView Indexes from Being Used for Delete Statement and Causing Poor Performance
Last updated on MAY 12, 2017
Applies to:Oracle Database - Enterprise Edition - Version 22.214.171.124 and later
Information in this document applies to any platform.
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.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms