SQL Performance (MOSC)

MOSC Banner

Execution plan changes to HA join from NL after sub-partitioning

edited Jun 18, 2015 10:01AM in SQL Performance (MOSC) 2 commentsAnswered

Hello,

I have a partitioned table with 771 partitions(daily) that is joined with a WITH clause query.

WITH DTES1 AS

        (SELECT   (TRUNC (SYSDATE) - 1) - 7 * LEVEL + 7   AS DTE1,

                CASE (-7 * LEVEL + 7) WHEN 0 THEN 'Today'

                WHEN -7 THEN '1WeekAgo'

                WHEN -14 THEN '2WeeksAgo'

                WHEN -21 THEN '3WeeksAgo'

                WHEN -28 THEN '4WeeksAgo'

                END AS DTE_DSC

           FROM DUAL

         CONNECT BY LEVEL <= 5)

SELECT 

B3.*

  FROM B3 , DTES1 D where B3.part_date=D.DTE1

;

B3 will be replaced by PART_TAB or SUB_PART_TAB. when it is only a partitioned table I get a NL plan that does pruning. The moment it is replaced with sub-partitioned table the plan goes to HA and no pruning.

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