Re: Temporary space needed to create a constraint

From: Jonathan Lewis <>
Date: Wed, 11 Jul 2012 14:52:49 +0100
Message-ID: <C77358E5706049F58D63DAE217446B1C_at_Primary>

When in doubt, try it out.

Oracle's been doing this since at least

Looking at the SQL (which has improved a little since I think it's trying to collect all rows that break the constraint in anticipation of writing them into the exceptions table - should you choose to specify an exceptions table. The nasty bit happens even if you add with novalidate and then validate.

I think you could try capturing the SQL for the check, then creating an SQL Baseline for it that forces it to take a path which would basically be a nested loop on an index full scan. Ideally you do this with a sort group by clause first so that no data is ever found and the second step of the loop never happens. (That's based on a quick inspection of the code - I don't guaranteed at the moment that there is such a legal path.)


Jonathan Lewis

Author: Oracle Core (Apress 2011)

  • Original Message ----- From: "Jonathan Lewis" <> To: "oracle-l" <> Sent: Wednesday, July 11, 2012 12:39 PM Subject: Re: Temporary space needed to create a constraint

What's your code to define the constraint and the existing index, and what's the execution plan you're seeing in the trace file ? And is the original table a simple heap table, or is it partitioned, and if partitioned was the index local or global ?

-- Received on Wed Jul 11 2012 - 08:52:49 CDT

Original text of this message