<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Quiz Night.</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Mon, 20 May 2013 17:10:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Hemant K Chitale</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37519</link>
		<dc:creator><![CDATA[Hemant K Chitale]]></dc:creator>
		<pubDate>Tue, 12 Oct 2010 14:29:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37519</guid>
		<description><![CDATA[Not commenting on the Quiz question but on the CHECK CONSTRAINT instead of a Column Definition to impose NOT NULL, Tom Kyte writes about the advantage of a NOT NULL definition over a Constraint : http://www.oracle.com/technetwork/issue-archive/2010/10-nov/o60asktom-176254.html

as the Optimizer can better use the Column definition.

Hemant K Chitale]]></description>
		<content:encoded><![CDATA[<p>Not commenting on the Quiz question but on the CHECK CONSTRAINT instead of a Column Definition to impose NOT NULL, Tom Kyte writes about the advantage of a NOT NULL definition over a Constraint : <a href="http://www.oracle.com/technetwork/issue-archive/2010/10-nov/o60asktom-176254.html" rel="nofollow">http://www.oracle.com/technetwork/issue-archive/2010/10-nov/o60asktom-176254.html</a></p>
<p>as the Optimizer can better use the Column definition.</p>
<p>Hemant K Chitale</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Not NULL &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37197</link>
		<dc:creator><![CDATA[Not NULL &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 05 Sep 2010 17:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37197</guid>
		<description><![CDATA[[...] may remember a short note I wrote a few days ago about adding a not null constraint to a table with 200 million rows without causing the system to stop for a few minutes. I did it with the intent of giving the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] may remember a short note I wrote a few days ago about adding a not null constraint to a table with 200 million rows without causing the system to stop for a few minutes. I did it with the intent of giving the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37100</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 09:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37100</guid>
		<description><![CDATA[Flado,

Good point. In fact, several good points at once about the benefits of isolating values to partitions and the effects of highwater marks on performance. (I was looking at a table recently that had a highwater mark at 438000 blocks and no data - it was a materialized view log table that had suffered an accident at some point in the past, and refreshes weren&#039;t going quite as fast as expected.)]]></description>
		<content:encoded><![CDATA[<p>Flado,</p>
<p>Good point. In fact, several good points at once about the benefits of isolating values to partitions and the effects of highwater marks on performance. (I was looking at a table recently that had a highwater mark at 438000 blocks and no data &#8211; it was a materialized view log table that had suffered an accident at some point in the past, and refreshes weren&#8217;t going quite as fast as expected.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flado</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37099</link>
		<dc:creator><![CDATA[Flado]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 09:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37099</guid>
		<description><![CDATA[Jonathan,
Just wanted to point out that it shouldn&#039;t be necessary to not have a partition that can accept NULLs - just a partition that only accepts NULLs, e.g. DEFAULT for list or MAXVALUE for range. The partition would be empty (if the constraint was satisfied) and a full scan would be very quick (assuming there have never been NULLs in that column, otherwise the HWM would have been bumped). Under 11g it might even be &quot;segmentless,&quot; making the performance identical to your case; under 10g and earlier, it would require just a single LIO for the segment header so it could still fit in your 0.15 seconds.
Cheers,

Flado]]></description>
		<content:encoded><![CDATA[<p>Jonathan,<br />
Just wanted to point out that it shouldn&#8217;t be necessary to not have a partition that can accept NULLs &#8211; just a partition that only accepts NULLs, e.g. DEFAULT for list or MAXVALUE for range. The partition would be empty (if the constraint was satisfied) and a full scan would be very quick (assuming there have never been NULLs in that column, otherwise the HWM would have been bumped). Under 11g it might even be &#8220;segmentless,&#8221; making the performance identical to your case; under 10g and earlier, it would require just a single LIO for the segment header so it could still fit in your 0.15 seconds.<br />
Cheers,</p>
<p>Flado</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37098</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 07:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37098</guid>
		<description><![CDATA[Robert,

The future&#039;s already here - Exadata with tens of gigabutes of SSD at the drive level. (But that wasn&#039;t it - but it probably could have been.)]]></description>
		<content:encoded><![CDATA[<p>Robert,</p>
<p>The future&#8217;s already here &#8211; Exadata with tens of gigabutes of SSD at the drive level. (But that wasn&#8217;t it &#8211; but it probably could have been.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37097</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 07:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37097</guid>
		<description><![CDATA[Andras,

In this case, Oracle wouldn&#039;t depend on &lt;em&gt;&lt;strong&gt;num_nulls&lt;/strong&gt;&lt;/em&gt; being zero.  Statisitics are always treated as estimates and potentially out of date -  even the microsecond after a 100% compute.

I haven&#039;t tested the effects of &lt;em&gt;&lt;strong&gt;ddl_lock_timeout&lt;/strong&gt;&lt;/em&gt;. It isn&#039;t really possible to guess from the description whether or not it should have an effect in this case. Perhaps some other reader has already experimented with it - or can point to a decent blog item about it.]]></description>
		<content:encoded><![CDATA[<p>Andras,</p>
<p>In this case, Oracle wouldn&#8217;t depend on <em><strong>num_nulls</strong></em> being zero.  Statisitics are always treated as estimates and potentially out of date &#8211;  even the microsecond after a 100% compute.</p>
<p>I haven&#8217;t tested the effects of <em><strong>ddl_lock_timeout</strong></em>. It isn&#8217;t really possible to guess from the description whether or not it should have an effect in this case. Perhaps some other reader has already experimented with it &#8211; or can point to a decent blog item about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andras Gabor</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37093</link>
		<dc:creator><![CDATA[Andras Gabor]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 05:24:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37093</guid>
		<description><![CDATA[My guess: DBA_TAB_COL_STATISTICS has the column NUM_NULLS. Can the system use a zero value from here, knowing it is up2date (not stale) ? 

For 200M rows we can also think of a possible partitioning in place, where partition-wise statistics or local indexes might be present. So if not the stats the parallel processing of partitions can also make things like this faster.

Btw when using 11g do you still need the pl/sql and the loop? Would &quot;ALTER SESSION SET ddl_lock_timeout=...&quot; work here or it does not apply?]]></description>
		<content:encoded><![CDATA[<p>My guess: DBA_TAB_COL_STATISTICS has the column NUM_NULLS. Can the system use a zero value from here, knowing it is up2date (not stale) ? </p>
<p>For 200M rows we can also think of a possible partitioning in place, where partition-wise statistics or local indexes might be present. So if not the stats the parallel processing of partitions can also make things like this faster.</p>
<p>Btw when using 11g do you still need the pl/sql and the loop? Would &#8220;ALTER SESSION SET ddl_lock_timeout=&#8230;&#8221; work here or it does not apply?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jgarry</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37091</link>
		<dc:creator><![CDATA[jgarry]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 23:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37091</guid>
		<description><![CDATA[I note in the docs:

&lt;i&gt;...validating a constraint that is already enabled does not require any DML locks during validation (unlike validating a previously disabled constraint). Enforcement guarantees that no violations are introduced during the validation. Hence, enabling without validating enables you to reduce the downtime typically associated with enabling a constraint.
...

Some benefits of using constraints in this order are:
...
      No locks are held.
      All constraints can go to enable state concurrently.
      Constraint enabling is done in parallel.
&lt;/i&gt;

So maybe you have a highly parallel system.  And maybe some quantity of the rows were added while you had the enable novalidate on.]]></description>
		<content:encoded><![CDATA[<p>I note in the docs:</p>
<p><i>&#8230;validating a constraint that is already enabled does not require any DML locks during validation (unlike validating a previously disabled constraint). Enforcement guarantees that no violations are introduced during the validation. Hence, enabling without validating enables you to reduce the downtime typically associated with enabling a constraint.<br />
&#8230;</p>
<p>Some benefits of using constraints in this order are:<br />
&#8230;<br />
      No locks are held.<br />
      All constraints can go to enable state concurrently.<br />
      Constraint enabling is done in parallel.<br />
</i></p>
<p>So maybe you have a highly parallel system.  And maybe some quantity of the rows were added while you had the enable novalidate on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flado</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37090</link>
		<dc:creator><![CDATA[Flado]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 22:56:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37090</guid>
		<description><![CDATA[The table was partitioned (list or range) on this column?]]></description>
		<content:encoded><![CDATA[<p>The table was partitioned (list or range) on this column?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert V</title>
		<link>http://jonathanlewis.wordpress.com/2010/08/27/quiz-night-8/#comment-37088</link>
		<dc:creator><![CDATA[Robert V]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 21:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=4350#comment-37088</guid>
		<description><![CDATA[Maybe because your stopwatch broke.  Or maybe you were in a jet going so fast that time slowed.  Perhaps your server is from the future when there&#039;s processing power is an order faster. Maybe you ran it on a table where the constraint had already been validated.  Wow I can think of lots of reasons.]]></description>
		<content:encoded><![CDATA[<p>Maybe because your stopwatch broke.  Or maybe you were in a jet going so fast that time slowed.  Perhaps your server is from the future when there&#8217;s processing power is an order faster. Maybe you ran it on a table where the constraint had already been validated.  Wow I can think of lots of reasons.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
