<?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: Virtual columns revisited</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Virtual Columns &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-32805</link>
		<dc:creator><![CDATA[Virtual Columns &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Thu, 16 Apr 2009 19:26:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-32805</guid>
		<description><![CDATA[[...] **1: In fact, you can collect statistics on &#8220;virtual columns&#8221; pre-11g by creating function-based indexes in an unusable state. The method works, but it&#8217;s not really a good [...]]]></description>
		<content:encoded><![CDATA[<p>[...] **1: In fact, you can collect statistics on &#8220;virtual columns&#8221; pre-11g by creating function-based indexes in an unusable state. The method works, but it&#8217;s not really a good [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shakespeare</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-19917</link>
		<dc:creator><![CDATA[Shakespeare]]></dc:creator>
		<pubDate>Thu, 30 Aug 2007 15:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-19917</guid>
		<description><![CDATA[Indeed, virtual columns are in 11g now!]]></description>
		<content:encoded><![CDATA[<p>Indeed, virtual columns are in 11g now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mirjana</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-7456</link>
		<dc:creator><![CDATA[Mirjana]]></dc:creator>
		<pubDate>Fri, 04 May 2007 07:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-7456</guid>
		<description><![CDATA[Excellent!!!
(Few months too late... but just what I need right now :-)]]></description>
		<content:encoded><![CDATA[<p>Excellent!!!<br />
(Few months too late&#8230; but just what I need right now :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Connor</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-65</link>
		<dc:creator><![CDATA[Connor]]></dc:creator>
		<pubDate>Sat, 04 Nov 2006 02:35:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-65</guid>
		<description><![CDATA[Can&#039;t remember which version it came into, but you can also directly reference hidden column names, eg &quot;for column SYS_... size 10&quot; etc]]></description>
		<content:encoded><![CDATA[<p>Can&#8217;t remember which version it came into, but you can also directly reference hidden column names, eg &#8220;for column SYS_&#8230; size 10&#8243; etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-54</link>
		<dc:creator><![CDATA[Jeff Moss]]></dc:creator>
		<pubDate>Fri, 03 Nov 2006 07:53:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-54</guid>
		<description><![CDATA[...I knew about method_opt for getting the histograms - I&#039;ve worked out now that when I was looking for the histogram I was using a little script of mine to give me lots of optimiser stats for the table in question...unfortunately, as I alluded to in the last post, I found that my script happened to be using the DBA_TAB_COLUMNS view rather than the DBA_TAB_COLS view...which meant I couldn&#039;t actually see the virtual column at all let alone whether there was a histogram on it...after fixing my script and retesting all this I find it&#039;s exactly as you say, the histogram can be created and it does help with getting the correct cardinality for a query with a predicate on a column with skewed data in it. 

Now our problem is that the value we are testing for BETWEEN the from_date AND NVL(to_date,TO_DATE(&#039;31-DEC-9999&#039;,&#039;DD-MON-YYYY&#039;)) comes from a scalar subquery select...so the optimiser doesn&#039;t know what value it is and can&#039;t get the right cardinality - with a literal date value it works fine...more of an architectural approach issue now I guess.]]></description>
		<content:encoded><![CDATA[<p>&#8230;I knew about method_opt for getting the histograms &#8211; I&#8217;ve worked out now that when I was looking for the histogram I was using a little script of mine to give me lots of optimiser stats for the table in question&#8230;unfortunately, as I alluded to in the last post, I found that my script happened to be using the DBA_TAB_COLUMNS view rather than the DBA_TAB_COLS view&#8230;which meant I couldn&#8217;t actually see the virtual column at all let alone whether there was a histogram on it&#8230;after fixing my script and retesting all this I find it&#8217;s exactly as you say, the histogram can be created and it does help with getting the correct cardinality for a query with a predicate on a column with skewed data in it. </p>
<p>Now our problem is that the value we are testing for BETWEEN the from_date AND NVL(to_date,TO_DATE(&#8217;31-DEC-9999&#8242;,&#8217;DD-MON-YYYY&#8217;)) comes from a scalar subquery select&#8230;so the optimiser doesn&#8217;t know what value it is and can&#8217;t get the right cardinality &#8211; with a literal date value it works fine&#8230;more of an architectural approach issue now I guess.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-40</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 02 Nov 2006 16:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-40</guid>
		<description><![CDATA[Jeff, There is a &lt;strong&gt;method_opt&lt;/strong&gt; for &lt;strong&gt;gather_table_stats&lt;/strong&gt; which does the job. Try &lt;em&gt;&#039;for all &lt;strong&gt;hidden&lt;/strong&gt; columns size NNN&#039;&lt;/em&gt;. This is available from 9.2 if not earlier.]]></description>
		<content:encoded><![CDATA[<p>Jeff, There is a <strong>method_opt</strong> for <strong>gather_table_stats</strong> which does the job. Try <em>&#8216;for all <strong>hidden</strong> columns size NNN&#8217;</em>. This is available from 9.2 if not earlier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-38</link>
		<dc:creator><![CDATA[Jeff Moss]]></dc:creator>
		<pubDate>Thu, 02 Nov 2006 15:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/10/31/virtual-columns-revisited/#comment-38</guid>
		<description><![CDATA[I&#039;m playing with it...but our scenario is a bit different...no time to explain in depth, but our functional column involves an NVL on a NULLable column to the max date of 31-DEC-9999(&quot;Bad Defaults Affect Cardinality&quot; is the slide you present I believe) - our problem is that we can get the virtual column index but can&#039;t get a histogram on it so can&#039;t see the skew we have on the column in order to assist the CBO to get the cardinalty right.

One thing I have just seen though, is that you obtain the column low/high values from USER_TAB_COLS. I tried doing the same select, not realising I&#039;d mistakenly typed USER_TAB_COLUMNS and I couldn&#039;t see the SYS virtual column...on realising my typo and switching back to USER_TAB_COLS it appears...which I thought was an interesting little gotcha.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m playing with it&#8230;but our scenario is a bit different&#8230;no time to explain in depth, but our functional column involves an NVL on a NULLable column to the max date of 31-DEC-9999(&#8220;Bad Defaults Affect Cardinality&#8221; is the slide you present I believe) &#8211; our problem is that we can get the virtual column index but can&#8217;t get a histogram on it so can&#8217;t see the skew we have on the column in order to assist the CBO to get the cardinalty right.</p>
<p>One thing I have just seen though, is that you obtain the column low/high values from USER_TAB_COLS. I tried doing the same select, not realising I&#8217;d mistakenly typed USER_TAB_COLUMNS and I couldn&#8217;t see the SYS virtual column&#8230;on realising my typo and switching back to USER_TAB_COLS it appears&#8230;which I thought was an interesting little gotcha.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
