<?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: Index naming</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/02/06/index-naming/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-45443</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 12:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-45443</guid>
		<description><![CDATA[Flado,

I also thought that object names were restricted to ASCII (7-bit) - but all I could find in the manuals was advice to stick to ASCII because that gives maximum transportability. There were also the comments about names being stored in uppercase only in the data dictionary unless quoted - so the introduces a few more restrictions on how easily you can use them.  Perhaps the naming has to be restricting to the single byte characters of the database character set.

Your example is quite entertaining as a demo, because the order of output changes if you do:
[sourcecode]
alter session set nls_comp=linguistic;
alter session set nls_sort = binary_ci;
[/sourcecode]
This sort of thing could make a real mess of peoples&#039; favourite admin scripts.]]></description>
		<content:encoded><![CDATA[<p>Flado,</p>
<p>I also thought that object names were restricted to ASCII (7-bit) &#8211; but all I could find in the manuals was advice to stick to ASCII because that gives maximum transportability. There were also the comments about names being stored in uppercase only in the data dictionary unless quoted &#8211; so the introduces a few more restrictions on how easily you can use them.  Perhaps the naming has to be restricting to the single byte characters of the database character set.</p>
<p>Your example is quite entertaining as a demo, because the order of output changes if you do:</p>
<pre class="brush: plain; title: ; notranslate">
alter session set nls_comp=linguistic;
alter session set nls_sort = binary_ci;
</pre>
<p>This sort of thing could make a real mess of peoples&#8217; favourite admin scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flado</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-45239</link>
		<dc:creator><![CDATA[Flado]]></dc:creator>
		<pubDate>Fri, 02 Mar 2012 16:48:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-45239</guid>
		<description><![CDATA[&gt; US7ASCII...

Are you sure? This works :-) 

[sourcecode]
create table t(id int,i1 int);
create index &quot;Ä&quot; on t(i1);
create index &quot;ä&quot; on t(id);
create index &quot;a&quot; on t(i1,id);
create index &quot;A&quot; on t(id,i1);
select index_name from user_indexes where table_name=&#039;T&#039; order by index_name;
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>&gt; US7ASCII&#8230;</p>
<p>Are you sure? This works :-) </p>
<pre class="brush: plain; title: ; notranslate">
create table t(id int,i1 int);
create index &quot;Ä&quot; on t(i1);
create index &quot;ä&quot; on t(id);
create index &quot;a&quot; on t(i1,id);
create index &quot;A&quot; on t(id,i1);
select index_name from user_indexes where table_name='T' order by index_name;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Babel</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44966</link>
		<dc:creator><![CDATA[Pavol Babel]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 23:17:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44966</guid>
		<description><![CDATA[US7ASCII...]]></description>
		<content:encoded><![CDATA[<p>US7ASCII&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Babel</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44965</link>
		<dc:creator><![CDATA[Pavol Babel]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 22:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44965</guid>
		<description><![CDATA[The basic formula for index range scan is OK. It goes like BLEVEL + ceiling(selectivity * leaf_blocks) . However, in Jonathan&#039;s example the selectivity for product_id is approximately 1/500000. So CBO predicts only 3 LIO for both access paths (to change it, we would have to set leaf_blocks statistic for T1_I1 to at least 500 001 ).
It is not very common to have two indexes with same prefixed columns (especially such a selective one), but sometimes there could be reason for that.

Regards
Pavol Babel]]></description>
		<content:encoded><![CDATA[<p>The basic formula for index range scan is OK. It goes like BLEVEL + ceiling(selectivity * leaf_blocks) . However, in Jonathan&#8217;s example the selectivity for product_id is approximately 1/500000. So CBO predicts only 3 LIO for both access paths (to change it, we would have to set leaf_blocks statistic for T1_I1 to at least 500 001 ).<br />
It is not very common to have two indexes with same prefixed columns (especially such a selective one), but sometimes there could be reason for that.</p>
<p>Regards<br />
Pavol Babel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lascoltodelvenerdi</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44964</link>
		<dc:creator><![CDATA[lascoltodelvenerdi]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 22:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44964</guid>
		<description><![CDATA[&quot;Because when you sort the index names alphabetically&quot;

Uhm... does the NL parameters play a role here or not? (i.e.: different language settings = different sorting)
Or Oracle internally always use an &quot;English sort&quot;?]]></description>
		<content:encoded><![CDATA[<p>&#8220;Because when you sort the index names alphabetically&#8221;</p>
<p>Uhm&#8230; does the NL parameters play a role here or not? (i.e.: different language settings = different sorting)<br />
Or Oracle internally always use an &#8220;English sort&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AMC</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44957</link>
		<dc:creator><![CDATA[AMC]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 14:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44957</guid>
		<description><![CDATA[This is the MOS note
Handling of equally ranked (RBO) or costed (CBO) indexes (Doc ID 73167.1)]]></description>
		<content:encoded><![CDATA[<p>This is the MOS note<br />
Handling of equally ranked (RBO) or costed (CBO) indexes (Doc ID 73167.1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44956</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 09:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44956</guid>
		<description><![CDATA[&lt;i&gt;The two indexes produce the same cost&lt;/i&gt;
Does this not mean the costing itself has an issue here ? Should the cost of accessing index with larger width (due to more number of columns) be more than accessing index with smaller width, especially when both are being probed with range scans ?]]></description>
		<content:encoded><![CDATA[<p><i>The two indexes produce the same cost</i><br />
Does this not mean the costing itself has an issue here ? Should the cost of accessing index with larger width (due to more number of columns) be more than accessing index with smaller width, especially when both are being probed with range scans ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mauro</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44954</link>
		<dc:creator><![CDATA[Mauro]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 04:12:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44954</guid>
		<description><![CDATA[Hi Jonathan,

do you mean Doc ID 73167.1?

Regards,
Mauro]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>do you mean Doc ID 73167.1?</p>
<p>Regards,<br />
Mauro</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Babel</title>
		<link>http://jonathanlewis.wordpress.com/2012/02/06/index-naming/#comment-44952</link>
		<dc:creator><![CDATA[Pavol Babel]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 02:02:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8191#comment-44952</guid>
		<description><![CDATA[Jonathan,

it is too late so unless I&#039;m mistaken it seems simple increasing of BLEVEL statistic by one for T1_I1 worked on my site (11.2.0.1 DB). The cost for T1_I1 index has been increased from 3 to 4, which makes sense to my mind. As you suggested, we would have to increase leaf_blocks statistic dramatically to make T1_I1 expensive enough. However, fine blevel hacking could be smart solution (especially in 10g where SQL baselines can&#039;t be used)
This tie-break situation is quite rare, but I have faced it several times, too. Oracle should fix the code, the alphabetical sort rule should be really used as the last resort (which obviously is not in this situation)

Regards
Pavol Babel]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>it is too late so unless I&#8217;m mistaken it seems simple increasing of BLEVEL statistic by one for T1_I1 worked on my site (11.2.0.1 DB). The cost for T1_I1 index has been increased from 3 to 4, which makes sense to my mind. As you suggested, we would have to increase leaf_blocks statistic dramatically to make T1_I1 expensive enough. However, fine blevel hacking could be smart solution (especially in 10g where SQL baselines can&#8217;t be used)<br />
This tie-break situation is quite rare, but I have faced it several times, too. Oracle should fix the code, the alphabetical sort rule should be really used as the last resort (which obviously is not in this situation)</p>
<p>Regards<br />
Pavol Babel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
