<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1546952687504887828</id><updated>2024-10-25T01:46:04.498-07:00</updated><category term="Complex Databases"/><category term="Data Integration Testing"/><category term="Database view"/><category term="Mobile testing"/><category term="SOA Testing"/><category term="TWPortalPost"/><category term="Test Automation"/><category term="Test Automation Tool"/><title type='text'>Next generation strategy and solutions</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-7611520961615394467</id><published>2011-06-02T04:02:00.000-07:00</published><updated>2011-06-02T04:02:19.017-07:00</updated><title type='text'>SQL Server Indexes – An Insider Look - Part 3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;h1 style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776693&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294706955&quot;&gt;&lt;span style=&quot;mso-bookmark: _Toc294776693;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt; line-height: 150%;&quot;&gt;Non-Clustered Index&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt; line-height: 150%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;What we saw till now is a very ideal situtation where we have a well defined key and can go ahead to create a clustered index. But what if the data is not so organized but we still need to have an index on the column. Enter the world of Non-Clustered Index. Where actually the data is not organized or ordered in any pre-existing condition, but still satisfy the purposes. The major difference is leaf level does not contain data. It includes pointers to the relevant data and the pointer is a simple RID column. RID columns include the information on extent, page and row offset. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Using this RID column it will go and fetch the data from different pages. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Another issue with with non-clustered index is it behaves differently for heap and clustered table. Here again we will see two scenarios. One Non-clustered index created on a heap and then created on a clustered table. &lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776694&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;Scenario 3: Non-Clustered Index on Heap Table&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Let us create a table called PRODUCTS as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE TABLE PRODUCTS (PRODUCTNUMBER NUMERIC(6), PRODUCTNAME VARCHAR(30), PRODUCTDESCRIPTION VARCHAR(50), PRODUCTTYPE VARCHAR(1))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now let us create a non-clustered index as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE NONCLUSTERED INDEX PRODIDX ON PRODUCTS(PRODUCTNUMBER, PRODUCTNAME)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 8.0pt; mso-no-proof: yes;&quot;&gt;The following script will insert the data into this table.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SET @COUNTER=1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 50000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO PRODUCTS VALUES &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(CAST(@COUNTER AS VARCHAR), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;PRODUCTS &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;DESCRIPTION &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(case (@COUNTER % 2) when 1 then &#39;I&#39; when 0 then &#39;R&#39; else NULL end))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SET @COUNTER=@COUNTER+1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;END&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now let us use a simple select clause and observe the execution plan.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT * FROM PRODUCTS WHERE PRODUCTNUMBER=2089&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-jnSjCOy1Dts/TedtIYSLJKI/AAAAAAAAADQ/qsEChNOZ4qo/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure11.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; src=&quot;http://2.bp.blogspot.com/-jnSjCOy1Dts/TedtIYSLJKI/AAAAAAAAADQ/qsEChNOZ4qo/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure11.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;If you see this execution plan carefully, the following can be observed:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;a)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Since we do not have clustered index in this table, it has used RID lookup to retrieve other two columns PRODUCTDESCRIPTION and PRODUCTTYPE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;b)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;It has used Index Seek to retrieve indexed columns PRODUCTNUMBER and PRODUCTNAME&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;c)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Internally what happens is the optimizer uses NESTED LOOPS to join the data from the results of the two operations viz Index Seek and RID Lookup. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Is this kind of execution plan is bad? Depends on the business needs and execution time. The above query took couple of seconds to execute. Let us now select only the indexed columns and see what is the execution plan for the same query.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT PRODUCTNUMBER, PRODUCTNAME FROM PRODUCTS WHERE PRODUCTNUMBER=2089&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-nH1QDrV9zoo/TedtTN6bIqI/AAAAAAAAADU/v7_MO9iabEo/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure12.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;http://1.bp.blogspot.com/-nH1QDrV9zoo/TedtTN6bIqI/AAAAAAAAADU/v7_MO9iabEo/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure12.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now the execution plan is changed, no RID lookup because we have selected only the indexed columns. What if we wanted to avoid RID lookup and at the same time most of the columns in the table to be selected? Use Include option along with the definition of the index creation as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 1.0pt 1.0pt 1.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 1.0pt 1.0pt 1.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DROP INDEX PRODUCTS.PRODIDX&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 1.0pt 1.0pt 1.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE NONCLUSTERED INDEX PRODIDX ON PRODUCTS(PRODUCTNUMBER, PRODUCTNAME) INCLUDE PRODUCTDESCRIPTION, PRODUCTTYPE&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The following select statement provides an execution plan &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;SELECT PRODUCTNUMBER, PRODUCTNAME FROM PRODUCTS WHERE PRODUCTNUMBER=2089&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-24JYcyPuXUA/TedtdQ49xxI/AAAAAAAAADY/R_-N-TGFamE/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure13.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://2.bp.blogspot.com/-24JYcyPuXUA/TedtdQ49xxI/AAAAAAAAADY/R_-N-TGFamE/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure13.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Please note that we did not get RID lookup, which is because of the columns included in the index creation. However, please be careful with INCLUDE column option. Please do benchmark before using it as it occupies more space in LEAF level and there on reducing the number of rows and increasing the number of IOs.&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776695&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;Scenario 4: Non-Clustered Index on Clustered Table&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now, in the same PRODUCTS table I have dropped the indexes and created two indexes as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DROP INDEX PRODUCTS.PRODIDX&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE CLUSTERED INDEX PRODCLUSTIDX ON PRODUCTS(PRODUCTNUMBER)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE NONCLUSTERED INDEX PRODIDX ON PRODUCTS(PRODUCTNAME)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Again we have the same number of records viz 50,000 records in the table. The following select statement produces the below execution plan:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Select * from products where productname=’PRODUCTS 9201’&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-41PNH1sYOc8/Tedtn2rU1yI/AAAAAAAAADc/pVtZck4kF3Y/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure14.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;181&quot; src=&quot;http://1.bp.blogspot.com/-41PNH1sYOc8/Tedtn2rU1yI/AAAAAAAAADc/pVtZck4kF3Y/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure14.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;http://img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt; &lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;If you read the execution plan, the following can be observed:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;a)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Since we have clustered index in this table, it has used Key Lookup to retrieve other two columns PRODUCTDESCRIPTION and PRODUCTTYPE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;b)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;It has used Index Seek to retrieve indexed columns PRODUCTNUMBER and PRODUCTNAME&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;c)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Internally what happens is the optimizer uses NESTED LOOPS to join the data from the results of the two operations viz Index Seek and Key Lookup. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Further please note that in case if the KEY LOOKUP is to be avoided, use INCLUDE option while creating the index.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Non-Clustered index can be used as part of heap table or as part of clustered table. There is no hard and fast rule that it has to be used only with heap or clustered table. Before using the same we need to benchmark and test it completely. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-insideh: .5pt solid black; mso-border-insidev: .5pt solid black; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;border: solid black 1.0pt; mso-border-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 99.9pt;&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpFirst&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-add-space: auto; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Further Reading&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-left: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 378.9pt;&quot; valign=&quot;top&quot; width=&quot;505&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt; mso-add-space: auto; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Please don’t   forget to visit this site to read my next articles on&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-add-space: auto; mso-list: l1 level1 lfo2; text-align: justify; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;Ø&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Joins and Sets&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpLast&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-add-space: auto; mso-list: l1 level1 lfo2; text-align: justify; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;Ø&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Hierarchical   Queries&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/7611520961615394467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/7611520961615394467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/7611520961615394467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/7611520961615394467'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/06/sql-server-indexes-insider-look-part-3.html' title='SQL Server Indexes – An Insider Look - Part 3'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-jnSjCOy1Dts/TedtIYSLJKI/AAAAAAAAADQ/qsEChNOZ4qo/s72-c/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure11.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-5772302053504390232</id><published>2011-06-02T03:57:00.000-07:00</published><updated>2011-06-02T03:57:52.163-07:00</updated><title type='text'>SQL Server Indexes – An Insider Look - Part 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now let us start loading the data using the following script.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=300000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 500000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;begin&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO ACCOUNTS VALUES (@COUNTER, (&#39;ACCOUNT &#39; + CAST(@COUNTER AS VARCHAR)), (&#39;ACCOUNT DESC &#39; + CAST(@COUNTER AS VARCHAR)), (CASE (CAST(@COUNTER AS VARCHAR) % 4) WHEN 1 THEN &#39;A&#39; WHEN 2 THEN &#39;L&#39; WHEN 3 THEN &#39;E&#39; WHEN 4 THEN &#39;I&#39; ELSE NULL END))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set @COUNTER=@COUNTER+1&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;It took 1 minute to execute the above script and Page Splits per second increased from 18,562 to 19,604. It took just 1042 page splits per second to load 150,000 records. Fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-_cgU5hrwd4w/Tedpl2nSQtI/AAAAAAAAACw/iecGBTliJNw/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;68&quot; src=&quot;http://3.bp.blogspot.com/-_cgU5hrwd4w/Tedpl2nSQtI/AAAAAAAAACw/iecGBTliJNw/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure3.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now let us start working on the second set of data and observe the page splits and fragmentation.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=300000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 500000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;begin&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO ACCOUNTS VALUES (@COUNTER, (&#39;ACCOUNT &#39; + CAST(@COUNTER AS VARCHAR)), (&#39;ACCOUNT DESC &#39; + CAST(@COUNTER AS VARCHAR)), (CASE (CAST(@COUNTER AS VARCHAR) % 4) WHEN 1 THEN &#39;A&#39; WHEN 2 THEN &#39;L&#39; WHEN 3 THEN &#39;E&#39; WHEN 4 THEN &#39;I&#39; ELSE NULL END))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set @COUNTER=@COUNTER+1&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;It took 1 minute and 39 seconds to execute the above script and Page Splits per second increased from 19,604 to 21,030. It took just 1426 page splits per second to load 200,000 records. Fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-JXPsO3xwQog/TedqRIRkbdI/AAAAAAAAAC0/4pfDEdxvF4o/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;67&quot; src=&quot;http://1.bp.blogspot.com/-JXPsO3xwQog/TedqRIRkbdI/AAAAAAAAAC0/4pfDEdxvF4o/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure4.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The most interesting part is the third set, which actually inserts the data in between the existing data. This will increase the page splits further and cause the cascading effects on the remaining data as well. This should not cause any problem if the clustering key is defined properly. Let us execute the following script to insert the missing data.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=150001&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 299999)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;begin&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO ACCOUNTS VALUES (@COUNTER, (&#39;ACCOUNT &#39; + CAST(@COUNTER AS VARCHAR)), (&#39;ACCOUNT DESC &#39; + CAST(@COUNTER AS VARCHAR)), (CASE (CAST(@COUNTER AS VARCHAR) % 4) WHEN 1 THEN &#39;A&#39; WHEN 2 THEN &#39;L&#39; WHEN 3 THEN &#39;E&#39; WHEN 4 THEN &#39;I&#39; ELSE NULL END))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set @COUNTER=@COUNTER+1&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;It took 1 minute to execute the above script and Page Splits per second increased from 21,030 to 22,099. It took just 1069 page splits per second to load 150,000 records. Fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-4TOTt0a-QEA/Tedq4RTo3zI/AAAAAAAAAC4/XQG9Ffye4PY/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;66&quot; src=&quot;http://2.bp.blogspot.com/-4TOTt0a-QEA/Tedq4RTo3zI/AAAAAAAAAC4/XQG9Ffye4PY/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure5.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776692&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;Scenario 2: Not So Well Defined Clustered Key&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now let us change the scenario and use a calculated column and index the same. By calculated column, I mean a column that is derived from another column or a combination of values that can be put in one column. For this, I will create another table called PurchaseMaster as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE TABLE [dbo].[purchasemaster](&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[purchasenumber] [varchar](20) NULL,&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[purchasedescription] [varchar](30) NULL,&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[vendorcode] [varchar](15) NULL,&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[dateofpurchase] [datetime] NULL&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;A clustered index was also created on the column purchasenumber as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE CLUSTERED INDEX PURCHASEMASTERIDX ON PURCHASEMASTER(PURCHASENUMBER)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The column PURCHASENUMBER is derived on the basis of date of purchase. For example, the following is the sample data available in the PURCHASENUMBER column. &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;purchasenumber&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;10\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;100\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1000\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;101\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;102\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;103\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;104\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;105\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;106\2011-2012&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Please note that each purchase number is appended with the financial year. The purchase number 100 has the financial year 2011-2012 and the same for the other purchase numbers. As soon as the person who is raising the purchase order looks at this, the person will know the financial year details. This is indeed very useful and infact very handy as well. Also, when we issue the following statement, we did not see any anomaly.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SELECT * FROM PURCHASEMASTER WHERE PURCHASENUMBER=&#39;1000\2011-2012&#39; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The execution plan for the above select statement is provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-egY7O0n6ss0/TedrNwubarI/AAAAAAAAAC8/XLNcJBiegRo/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;213&quot; src=&quot;http://4.bp.blogspot.com/-egY7O0n6ss0/TedrNwubarI/AAAAAAAAAC8/XLNcJBiegRo/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure6.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now, if we see a range filter based query as follows, the results were not proper.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SELECT * FROM PURCHASEMASTER WHERE PURCHASENUMBER&amp;gt;&#39;1\2011-2012&#39; AND PURCHASENUMBER &amp;lt;&#39;101\2011-2012&#39;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;purchasenumber&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;purchasedescription&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;vendorcode&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;dateofpurchase&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;10\2011-2012&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Purchase 10&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Vendor 10&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2011-05-30 19:08:48.653&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;100\2011-2012&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp; &lt;/span&gt;Purchase 100&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Vendor 100&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2011-05-30 19:08:48.687&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1000\2011-2012&lt;span style=&quot;mso-tab-count: 1;&quot;&gt; &lt;/span&gt;Purchase 1000&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Vendor 1000&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2011-05-30 19:08:49.217&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now there are no records in the table and entire data was truncated. We will now study the page splits and the fragmentation details for this clustered index. Initially the page splits is calculated using the following query and was observed to be 9325.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SELECT * FROM SYS.SYSPERFINFO WHERE COUNTER_NAME = &#39;PAGE SPLITS/SEC&#39; AND OBJECT_NAME LIKE &#39;%ACCESS METHODS%&#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Also, the fragmentation details for this table and index is illustrated below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-ZwOv9JpLiCc/Tedrae3BlZI/AAAAAAAAADA/g_X_H12pmoY/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure7.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;61&quot; src=&quot;http://4.bp.blogspot.com/-ZwOv9JpLiCc/Tedrae3BlZI/AAAAAAAAADA/g_X_H12pmoY/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure7.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now we will insert two sets of data, purchase number from 1 to 150,000 and from 300,000 to 500,000 with a gap of 150,000 between the sets of data. After inserting every set of data, we will observe the corresponding page splits and fragment.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The following script will be used to generate these sets of data. &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 150000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO PURCHASEMASTER VALUES &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(CAST(@COUNTER AS VARCHAR) + &#39;\&#39; + cast(YEAR(GETDATE()) as varchar) + &#39;-&#39; + cast(YEAR(GETDATE())+1 as varchar), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;PURCHASE &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;VENDOR &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GETDATE())&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SET @COUNTER=@COUNTER+1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;END&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Inserting 150,000 records took just 1 minute and 3 seconds. The page splits/second and fragmentation after this are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;From 9325, page splits/second has increased to 11523 which caused 2198 page splits per second during this insert operation.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Also the fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-wOMcv1s7WRc/TedrqVq8rTI/AAAAAAAAADE/s-IkpisvA2M/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure8.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;68&quot; src=&quot;http://3.bp.blogspot.com/-wOMcv1s7WRc/TedrqVq8rTI/AAAAAAAAADE/s-IkpisvA2M/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure8.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Please note that the fragmentaion is observed to be high in this case. Now, let us consider the next set, which is inserting next set of 200,000 records from 300,000 to 500,000.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=300000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 500000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO PURCHASEMASTER VALUES &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(CAST(@COUNTER AS VARCHAR) + &#39;\&#39; + cast(YEAR(GETDATE()) as varchar) + &#39;-&#39; + cast(YEAR(GETDATE())+1 as varchar), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;PURCHASE &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;VENDOR &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GETDATE())&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SET @COUNTER=@COUNTER+1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;END&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Inserting 200,000 records took just 1 minute and 18 seconds. The page splits/second and fragmentation after this are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;From 11,523, page splits/second has increased to 14,947 which caused 3,424 page splits per second during this insert operation.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: Batang; mso-fareast-language: KO; mso-no-proof: yes;&quot;&gt; Also the fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-gVS8gT_ZqmY/TedsRhUp-II/AAAAAAAAADI/zlB-z9KrkDU/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure9.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;66&quot; src=&quot;http://3.bp.blogspot.com/-gVS8gT_ZqmY/TedsRhUp-II/AAAAAAAAADI/zlB-z9KrkDU/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure9.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Wow, that is a great increase in fragmentation.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now the final is what more important to observe both Page Splits and Fragmentation. We are now going to insert the missing records between 150,000 and 300,000 and observe the page splits. I will also explain diagramatically how this would happen. Now let us execute the same script by changing the values.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=150001&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 299999)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO PURCHASEMASTER VALUES &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(CAST(@COUNTER AS VARCHAR) + &#39;\&#39; + cast(YEAR(GETDATE()) as varchar) + &#39;-&#39; + cast(YEAR(GETDATE())+1 as varchar), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;PURCHASE &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39;VENDOR &#39; + CAST(@COUNTER AS VARCHAR),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GETDATE())&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SET @COUNTER=@COUNTER+1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;END&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The third batch took just 57 seconds to complete. Page Splits per second was observed to be 17,520 which caused 2,573 page splits per second during this insert operation. Also the fragment details are provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-AuM6oTqOk4U/TedshTny8kI/AAAAAAAAADM/OgjFcTNGX2M/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure10.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;67&quot; src=&quot;http://3.bp.blogspot.com/-AuM6oTqOk4U/TedshTny8kI/AAAAAAAAADM/OgjFcTNGX2M/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure10.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
table.MsoTableGrid
 {mso-style-name:&quot;Table Grid&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 border:solid windowtext 1.0pt;
 mso-border-alt:solid windowtext .5pt;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-border-insideh:.5pt solid windowtext;
 mso-border-insidev:.5pt solid windowtext;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now having said this on page splits and fragmentation, how do we know if this is good or bad? Let us compare the scenario 1 and 2 in the following table and observe the results.&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480; width: 100.0%;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td colspan=&quot;2&quot; style=&quot;background: #99CCFF; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 167.4pt;&quot; width=&quot;223&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: center; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;background: #99CCFF; border-left: none; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: center; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Execution Time (mm:ss)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;background: #99CCFF; border-left: none; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: center; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Page Splits&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;background: #99CCFF; border-left: none; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: center; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Fragmentation (AVG_FRAGMENTATION_ IN_PERCENT&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: center; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;FOR INDEX_LEVEL=0)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 1;&quot;&gt;   &lt;td rowspan=&quot;3&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 78.75pt;&quot; width=&quot;105&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Scenario 1&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1-150,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;01:00&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1,042&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;0.68&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;300,000-500,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;01:39&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1,426&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;0.57&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;150,001-299,999&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;01:00&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1,069&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;0.62&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 4;&quot;&gt;   &lt;td rowspan=&quot;3&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 78.75pt;&quot; width=&quot;105&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Scenario 2&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;1-150,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;01:03&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;2,198&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;35.21&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;300,000-500,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;01:18&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;3,424&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;41.87&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: .25in; mso-yfti-irow: 6; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 88.65pt;&quot; width=&quot;118&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;150,001-299,999&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 79.65pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;00:57&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 83.4pt;&quot; width=&quot;111&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: red; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;2,573&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: .25in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 112.35pt;&quot; width=&quot;150&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-align: right; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: red; font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;43.36&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;This shows in Scenario 2, as the cluster key is not well defined, the inserts to fill the missing gap (150,001 to 299,999) is observed to be high. Also, the fragmentation and Page Splits are quite high since the cluster key is not well defined. Whenever we need to define a clustered index on a key, please make sure the following:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;a)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Key should be well defined, satisfying the business requirements and as well as the providing a greater selectivity.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;b)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Key should not be defined on derived table and calculated column&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 6.0pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-align: justify; text-autospace: none; text-indent: -.25in; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;c)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Other columns in the table should be completely dependent on the cluster key &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;            &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/5772302053504390232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/5772302053504390232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5772302053504390232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5772302053504390232'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/06/sql-server-indexes-insider-look-part-2.html' title='SQL Server Indexes – An Insider Look - Part 2'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-_cgU5hrwd4w/Tedpl2nSQtI/AAAAAAAAACw/iecGBTliJNw/s72-c/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure3.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-1415947739469402823</id><published>2011-06-02T03:43:00.000-07:00</published><updated>2011-06-02T03:43:21.396-07:00</updated><title type='text'>SQL Server Indexes – An Insider Look - Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
table.MsoTableGrid
 {mso-style-name:&quot;Table Grid&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 border:solid windowtext 1.0pt;
 mso-border-alt:solid windowtext .5pt;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-border-insideh:.5pt solid windowtext;
 mso-border-insidev:.5pt solid windowtext;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;h1 style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776688&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294706952&quot;&gt;&lt;span style=&quot;mso-bookmark: _Toc294776688;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt; line-height: 150%;&quot;&gt;Introduction&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: _Toc294776688;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: _Toc294706952;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-weight: normal; line-height: 150%; mso-bidi-font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;There was a time where many have not realized the importance of indexes in database world. Indexes were predominantly used to decrease the execution time of a query without understanding the side effects it would cause on DML statements. However, in this contemporary world where lots and lots of information are available in the net, many have realized that indexes are to be used carefully and used only when a need arises. This article even though provides information on the basics, we will also delve into the internals on how these indexes react under the cover. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;People who travel to the world of SQL Server from other databases will obviously have to confine themselves with only two types of indexes viz Clustered Indexes and Non-Clustered indexes. The design and architecture of SQL Server allows the user to play with these indexes alone (even though SQL Server 2008 has provided a new feature called FILTERED INDEXES, which we will see in next article). We will work on the different scenarios, observe the results and provide a logical conclusion towards the end. Please note that this is not a universal conclusion and results may vary depending on the data size, underlying OS, hardware configuration, number of concurrent users etc.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;I will be using SQL Server 2008 on Windows XP. As and when needed, I will also provide the information on the data size and other variable factors.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-weight: bold; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US; mso-font-kerning: 16.0pt;&quot;&gt;&lt;br clear=&quot;all&quot; style=&quot;page-break-before: always;&quot; /&gt; &lt;/span&gt;  &lt;h1 style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776689&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294706953&quot;&gt;&lt;span style=&quot;mso-bookmark: _Toc294776689;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt; line-height: 150%;&quot;&gt;Definitions&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: _Toc294776689;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: _Toc294706953;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-weight: normal; line-height: 150%; mso-bidi-font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Before we dive deep into this article, it would be better if we understand the terminologies and their definitions as it would be easy to understand the contents in this article.&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Fragmentation&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;A process by which the spaces occur due to frequent   updates and deletes in the page. More this fragmentation more the performance   issues or maintenance will be.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Index Level&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;This value provides the number of levels from the   bottom up of an index. Please note that Leaf Node will always have 0.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Clustered Index Seek&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Index seek uses a clustered index to look up the   rows to be returned directly&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Index Depth&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Number of levels we need to pass to get into the   index.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 4;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Record Count&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Number of records available in the page. In general   this value at index level 0 will be the number of records in the table. But   in case of any forwarding count, then there will be some differences&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Extent&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Palatino-Roman;&quot;&gt;An &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Palatino-Italic; mso-bidi-font-style: italic;&quot;&gt;extent&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Palatino-Roman;&quot;&gt;is   the basic unit of storage used to allocate space for tables and indexes   within a given data file. It is made up of eight contiguous 64KB data &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Palatino-Italic;&quot;&gt;pages&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: Palatino-Roman;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 6;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Page&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;A page is the unit of allocation within a specific   extent. There are eight pages in every extent. Please note that a page is the   last level you reach before hitting at the actual data row.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 7;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Page Splits&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Whenever a page becomes full, half of the data is   shifted to the newly created page and pointers are kept in the old page   pointing to the new location of the data. This is called Page Split. In case   of a clustered index the inserted row which does not have enough space alone   is shifted to the newly created page.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 8;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Row Offset&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;For every row that we insert into the database, SQL   Server will place the “Row Offset” located at the end of the page, to   actually indicate where in that page the row data starts. Indirectly it tells   us how many spaces we need to leave to read the data from the top.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 9;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Index Seek&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Index seek uses a non-clustered index to look up   the rows to be returned directly&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 10;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Nested Loops&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Takes the inputs from two data sets and performs   the scanning of the outer set for each inner set. Very efficient operation if   the data sets are small.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 11;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;RID Lookup&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;The query optimizer performs a RID LookUp, a type   of bookmark lookup that occurs on a heap table and uses a row identifier to   find the rows to return.&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 12;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Key Lookup&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;A Key Lookup is a bookmark lookup on a clustered   table and which essentially means that the optimizer cannot retrieve the rows   in a single operation, and has to use a clustered key to return the   corresponding rows from a clustered index (or from the table itself).&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 13; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;AVERAGE_FRAGMENTATION_ IN_PERCENT&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 311.4pt;&quot; valign=&quot;top&quot; width=&quot;415&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;The degree of fragmentation in the index tree which   is based on pages or extents that are not in sync or out of order (i.e.) the   pointer to the logical next page is not the same as the physical next page.   Please note that we need to be looking for a low number here, though how low   depends on the the scenario and requirements&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;&lt;/span&gt;&lt;br clear=&quot;all&quot; style=&quot;page-break-before: always;&quot; /&gt; &lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-weight: bold; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US; mso-font-kerning: 16.0pt;&quot;&gt;&lt;/span&gt;&lt;h1 style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 6.0pt;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294706954&quot;&gt;&lt;span style=&quot;mso-bookmark: _Toc294776690;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12.0pt; line-height: 150%;&quot;&gt;Clustered Index&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;mso-bookmark: _Toc294776690;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: _Toc294706954;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-weight: normal; line-height: 150%; mso-bidi-font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Clustered index, as the name suggests, the indexes are clustered in one place with the data. The major advantage (in some cases disadvantage) with clustered index is the arrangement of data in one particular order. Since the data is arranged in one order, we can have only one clustered index in a table. By default, as soon as a primary key for a table is created, internally SQL Server creates a clustered index. However, when we create a unique key, we can specify either clustered or non-clustered index. Creating a clustered index is a time consuming task and in case if this is not defined properly then it may lead to lot of performance issues. In this section, we will see where this can be a gain and where this can lead to performance issues.&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;&quot; name=&quot;_Toc294776691&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;Scenario 1: Well defined Cluster Key&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; font-style: normal; mso-bidi-font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%;&quot;&gt;Let us create a table called “Accounts” having information related to a company accounts as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE TABLE ACCOUNTS (ACCOUNTNUMBER NUMBER(6), ACCOUNTNAME VARCHAR(50), ACCOUNTDESCRIPTION VARCHAR(50), ACCOUNT_TYPE VARCHAR(1))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%;&quot;&gt;Let us now create a clustered index on this table on the column ACCOUNTNUMBER.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; line-height: 150%; margin-top: 6.0pt; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;CREATE CLUSTERED INDEX ACCNTCLUSTIDX ON ACCOUNTS(ACCOUNTNUMBER);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;In order to test various scenarios, let me load 50,000 records into this table using the following script:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;DECLARE @COUNTER AS INT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SET @COUNTER=1&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;WHILE (@COUNTER &amp;lt;= 50000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO ACCOUNTS VALUES (@COUNTER, (&#39;ACCOUNT &#39; + CAST(@COUNTER AS VARCHAR)), (&#39;ACCOUNT DESC &#39; + CAST(@COUNTER AS VARCHAR)), (CASE (CAST(@COUNTER AS VARCHAR) % 4) WHEN 1 THEN &#39;A&#39; WHEN 2 THEN &#39;L&#39; WHEN 3 THEN &#39;E&#39; WHEN 4 THEN &#39;I&#39; ELSE NULL END))&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-alt: solid windowtext .5pt; mso-layout-grid-align: none; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; padding: 0in; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;We have four different types through which we classify the account as Asset (A), Liability (L), Expense (E) and Income (I).&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now to insert these many records using SQL Server Management Studio (SSMS), it took around 23 seconds. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The following query is a simple select statement filtering the data on accountnumber.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SELECT * FROM ACCOUNTS WHERE ACCOUNTNUMBER &amp;lt; 1000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-nhlmB3FJbKo/Tedo7MzJvsI/AAAAAAAAACo/6QV6K5VbR7k/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; src=&quot;http://3.bp.blogspot.com/-nhlmB3FJbKo/Tedo7MzJvsI/AAAAAAAAACo/6QV6K5VbR7k/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;The above query got executed in no time and returned the 999 rows. The actual execution plan showed that the query took the CLUSTERED INDEX SEEK plan, which actually used the index and other parameters (or some authors term as attributes) are also well within the bounds. Please also note that since the key what we have chosen to index is well organized, whatever be the filter on the clustered key it would use the index. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Since this clustered key is well organized, even the page splits and fragmentation should be well within the limits. We can look at this in three different angles. First let us truncate the existing records in this table and load the table with three sets of data. First data will be from 1 to 150,000. Second will be from 300,000 and 500,000. And final set will be between 150,000 and 300,000. At the initial stage before starting this experiment the page splits per second is 18,562 as calculated through the following query:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;SELECT * FROM SYS.SYSPERFINFO WHERE COUNTER_NAME = &#39;PAGE SPLITS/SEC&#39; AND OBJECT_NAME LIKE &#39;%ACCESS METHODS%&#39;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6.0pt; mso-layout-grid-align: none; text-align: justify; text-autospace: none; text-justify: inter-ideograph;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt; line-height: 150%; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes;&quot;&gt;Now the fragmentation for the index on this table is provided below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-Zvq5gPzAq5A/TedpIgFuWjI/AAAAAAAAACs/i3RRtZNEEQc/s1600/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;57&quot; src=&quot;http://3.bp.blogspot.com/-Zvq5gPzAq5A/TedpIgFuWjI/AAAAAAAAACs/i3RRtZNEEQc/s320/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure2.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-top: 6pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/1415947739469402823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/1415947739469402823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/1415947739469402823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/1415947739469402823'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/06/sql-server-indexes-insider-look-part-1.html' title='SQL Server Indexes – An Insider Look - Part 1'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-nhlmB3FJbKo/Tedo7MzJvsI/AAAAAAAAACo/6QV6K5VbR7k/s72-c/SQL+Server+Indexes+%25E2%2580%2593+An+Insider+Look-Figure1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-2507401673690718109</id><published>2011-04-14T05:23:00.000-07:00</published><updated>2011-04-14T05:23:11.236-07:00</updated><title type='text'>Index Organized Tables (IOT) - Part 3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;http://img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt; &lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Now, we will try to retrieve more records from the table and analyze the results.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; SELECT * FROM IOT_TABLE WHERE IOTNUMBER &amp;gt; 2000;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;98000 ROWS SELECTED.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;EXECUTION PLAN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PLAN HASH VALUE: 451903227&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;| ID&lt;span&gt;&amp;nbsp; &lt;/span&gt;| OPERATION&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| NAME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ROWS&lt;span&gt;&amp;nbsp; &lt;/span&gt;| BYTES | COST (%CPU)| TIME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 | SELECT STATEMENT |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|*&lt;span&gt;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;INDEX RANGE SCAN| SYS_IOT_TOP_232322 |&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PREDICATE INFORMATION (IDENTIFIED BY OPERATION ID):&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 - ACCESS(&quot;IOTNUMBER&quot;&amp;gt;2000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;STATISTICS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;1&lt;span&gt;&amp;nbsp; &lt;/span&gt;RECURSIVE CALLS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;DB BLOCK GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;6885&lt;span&gt;&amp;nbsp; &lt;/span&gt;CONSISTENT GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;PHYSICAL READS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;REDO SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3098440&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES SENT VIA SQL*NET TO CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;72239&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES RECEIVED VIA SQL*NET FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;6535&lt;span&gt;&amp;nbsp; &lt;/span&gt;SQL*NET ROUNDTRIPS TO/FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (MEMORY)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (DISK)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;98000&lt;span&gt;&amp;nbsp; &lt;/span&gt;ROWS PROCESSED&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; SELECT * FROM NON_IOT_TABLE WHERE NON_IOTNUMBER &amp;gt; 2000;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;98000 ROWS SELECTED.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;EXECUTION PLAN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PLAN HASH VALUE: 1269025442&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;| ID&lt;span&gt;&amp;nbsp; &lt;/span&gt;| OPERATION&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| NAME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ROWS&lt;span&gt;&amp;nbsp; &lt;/span&gt;| BYTES | COST (%CPU)| TIME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 | SELECT STATEMENT&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;TABLE ACCESS BY INDEX ROWID| NON_IOT_TABLE |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|*&lt;span&gt;&amp;nbsp; &lt;/span&gt;2 |&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INDEX RANGE SCAN&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| SYS_C00104050 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PREDICATE INFORMATION (IDENTIFIED BY OPERATION ID):&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;---------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2 - ACCESS(&quot;NON_IOTNUMBER&quot;&amp;gt;2000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;STATISTICS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;1&lt;span&gt;&amp;nbsp; &lt;/span&gt;RECURSIVE CALLS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;DB BLOCK GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;13643&lt;span&gt;&amp;nbsp; &lt;/span&gt;CONSISTENT GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;PHYSICAL READS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;REDO SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3098452&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES SENT VIA SQL*NET TO CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;72239&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES RECEIVED VIA SQL*NET FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;6535&lt;span&gt;&amp;nbsp; &lt;/span&gt;SQL*NET ROUNDTRIPS TO/FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (MEMORY)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (DISK)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;98000&lt;span&gt;&amp;nbsp; &lt;/span&gt;ROWS PROCESSED&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;As the number of records increased, the difference in accessing the data using IOT and regular tables are also increased. Wherever IOT is beneficial, regular tables are proved to be non-beneficial.&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;&quot; name=&quot;_Toc285564552&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Effect of DMLs on IOT&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;I was actually very curious to check on this because everything seems to be positive for IOT and was wondering why IOT was not used in place of regular tables. In order to test the effect of DMLs on IOT, I took two cases viz. Bulk Insert and Serial Insert. By Serial Insert I mean inserting records one by one in a loop. I have used the same table, IOT_TABLE and issued the following insert statement.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; INSERT INTO IOT_TABLE SELECT (IOTNUMBER+100000), IOTNAME, IOTDETAILS FROM IOT_TABLE;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;100000 rows created.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Execution Plan&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Plan hash value: 3323075685&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;| Id&lt;span&gt;&amp;nbsp; &lt;/span&gt;| Operation&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Name&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Rows&lt;span&gt;&amp;nbsp; &lt;/span&gt;| Bytes | Cost (%CPU)| Time&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 | INSERT STATEMENT&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|100K|&lt;span&gt;&amp;nbsp; &lt;/span&gt;2343K|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;90&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(2)| 00:00:02 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;INDEX FAST FULL SCAN| SYS_IOT_TOP_232322 |&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;100K|&lt;span&gt;&amp;nbsp; &lt;/span&gt;2343K|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;90&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(2)| 00:00:02 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Statistics&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1055 recursive calls&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;536919 db block gets&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;17450 consistent gets&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;445 physical reads&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;81962588 redo size&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;549 bytes sent via SQL*Net to client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;612 bytes received via SQL*Net from client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4 SQL*Net roundtrips to/from client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9 sorts (memory)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 sorts (disk)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;100000 rows processed&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;What a pleasant surprise!! it takes 17,450 consistent gets and 445 physical reads to insert 100,000 records. But how much cost it would have for a regular table? Below is the next set of statement&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; INSERT INTO NON_IOT_TABLE SELECT (NON_IOTNUMBER+100000), NON_IOTNAME, NON_IOTDETAILS FROM NON_IOT_TABLE;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;100000 rows created.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Execution Plan&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Plan hash value: 277682176&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-----------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;| Id&lt;span&gt;&amp;nbsp; &lt;/span&gt;| Operation&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;| Name&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| Rows&lt;span&gt;&amp;nbsp; &lt;/span&gt;| Bytes | Cost (%CPU)| Time&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-----------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 | INSERT STATEMENT&lt;span&gt;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;100K|&lt;span&gt;&amp;nbsp; &lt;/span&gt;2343K|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;111&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(1)| 00:00:02 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;TABLE ACCESS FULL| NON_IOT_TABLE |&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;100K|&lt;span&gt;&amp;nbsp; &lt;/span&gt;2343K|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;111&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(1)| 00:00:02 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;-----------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Statistics&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;238 recursive calls&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;12235 db block gets&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2963 consistent gets&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;42 physical reads&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;12218160 redo size&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;558 bytes sent via SQL*Net to client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;632 bytes received via SQL*Net from client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4 SQL*Net roundtrips to/from client&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2 sorts (memory)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;0 sorts (disk)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;100000 rows processed&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;That’s a huge difference. Almost 6x difference between the insert on regular table and IOT. Is this the same for update and delete? When I checked on update and delete, I found another set of interesting facts.&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;right&quot;&gt;  &lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: medium none; width: 100%;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0.25in;&quot;&gt;   &lt;td style=&quot;border: 1pt solid black; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;No of Records&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Consistent Gets&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Physical Reads&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 0.25in;&quot;&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Bulk Update IOT&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;90,978&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;27,634&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;110&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 0.25in;&quot;&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Bulk Update   Regular&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;90,978&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;2282&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 0.25in;&quot;&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Bulk Delete IOT&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;90,978&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;977&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 0.25in;&quot;&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Bulk Delete   Regular&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;90,978&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;877&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; height: 0.25in; padding: 0in 5.4pt; width: 119.7pt;&quot; width=&quot;160&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Instead of bulk insert, I tried single insert (record by record in a loop with a final commit outside the loop) in both IOT and regular tables and obtained the following results:&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid black; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;No of Records&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CPU&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Elapsed Time&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Physical Reads&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOs&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Insert – Regular   Tables&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;100,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;9.79&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;10.52&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;9&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;312,262&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Insert - IOT&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;100,000&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;8.46&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;10.62&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.8pt;&quot; width=&quot;106&quot;&gt;   &lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: right;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;211,301&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h1&gt;&lt;a href=&quot;&quot; name=&quot;_Toc285564553&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Benefits of IOT&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;The structure of an index-organized table provides the following benefits:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpFirst&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Fast random access on the primary key because an index-only scan is sufficient. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;There is no separate table storage area, hence changes to the table data result only in updating the index structure.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Fast range access on the primary key because the rows are clustered in primary key order.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpLast&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Lower storage requirements because duplication of primary keys is avoided.&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;&quot; name=&quot;_Toc285564554&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;ListParagraphCxSpFirst&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;From the above article, the following can be observed:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;IOT is not recommended to be used for bulk processing&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;In case of OLTP transactions, IOT can be used&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Query retrieval is faster compared to the regular tables&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Using COMPRESS option, (even otherwise as well), storage can be saved phenomenally&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Please do understand that these are not thumb rules to work on. Please do benchmark the usage of IOT before using the same.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid black; padding: 0in 5.4pt; width: 99.9pt;&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Further Reading&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 378.9pt;&quot; valign=&quot;top&quot; width=&quot;505&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Please don’t   forget to visit this site to read my next articles on&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Joins and   Access Methods&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpLast&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Oracle Indexes&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 99.9pt;&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpFirst&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;References&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 378.9pt;&quot; valign=&quot;top&quot; width=&quot;505&quot;&gt;   &lt;div class=&quot;ListParagraphCxSpLast&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Expert Oracle   Database Architecture 9i and 10g Programming Techniques and Solutions By &lt;b&gt;Thomas Kyte&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/2507401673690718109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/2507401673690718109' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2507401673690718109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2507401673690718109'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/04/index-organized-tables-iot-part-3.html' title='Index Organized Tables (IOT) - Part 3'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-4146964870987641103</id><published>2011-04-14T05:21:00.000-07:00</published><updated>2011-04-14T05:21:00.980-07:00</updated><title type='text'>Index Organized Tables (IOT) - Part 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;http://img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt; &lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Now, comes an important decision on from which column or value of the column should be moved on to the overflow segment. This is optionally specified by INCLUDING clause. All the columns specified after the name in this clause will be moved to OVERFLOW segment. In this example, AGE_PHOBIA and AGE_IDEAS will be stored in a separate overflow segment. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Another interesting factor when we include OVERFLOW clause is as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; SELECT DBMS_METADATA.GET_DDL(&#39;TABLE&#39;,&#39;AGEING_DEFECTS&#39;) FROM DUAL;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;DBMS_METADATA.GET_DDL(&#39;TABLE&#39;,&#39;AGEING_DEFECTS&#39;)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE TABLE &quot;INXQA&quot;.&quot;AGEING_DEFECTS&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;(&quot;NORMAL_HUMAN_AGE&quot; VARCHAR2(10),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&quot;AGE_ISSUES&quot; VARCHAR2(30),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&quot;AGE_PHOBIA&quot; VARCHAR2(30),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&quot;AGE_IDEAS&quot; VARCHAR2(10),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PRIMARY KEY (&quot;NORMAL_HUMAN_AGE&quot;) ENABLE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;) ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;TABLESPACE &quot;PORT_DATA&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PCTTHRESHOLD 20 INCLUDING &quot;AGE_ISSUES&quot; OVERFLOW&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE &quot;PORT_DATA&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Please note that the above options include PCTUSED with 40% as its value. This is because OVERFLOW segment is a separate segment, which has all the features and options of regular segments and hence we have PCTUSED.&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;&quot; name=&quot;_Toc285564550&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;NOCOMPRESS and COMPRESS options&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;When we uncompress the data, the primary key (or key columns) are repeated in the block along with the non-key columns. When we compress the index, based on the number of columns we specify, the indexes will be compressed (i.e.) the key columns will not be repeated. Please note that for the compress option to work, you need to have composite primary key. Otherwise, you will get the following error:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; ALTER TABLE IOT_TABLE MOVE COMPRESS;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ALTER TABLE IOT_TABLE MOVE COMPRESS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;*&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ERROR AT LINE 1:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ORA-25193: CANNOT USE COMPRESS OPTION FOR A SINGLE COLUMN KEY&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;In order to show the COMPRESS option, let us create another table as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE TABLE IOT_TABLES &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;(IOT1 VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOT2 VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOT3 VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOT4 VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOT5 VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PRIMARY KEY(IOT1,IOT2,IOT3)) &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ORGANIZATION INDEX;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Assume that we have a primary key on three columns with the following distribution of data in NOCOMPRESS option:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,4,1,5,6&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,4,2,5,7&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,4,3,5,8&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,4,0,5,9&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,4,9,6,0&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,5,4,1,2&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,5,5,1,3&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,5,6,1,4&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,5,7,1,5&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9,5,8,1,6&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;If we compress as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ALTER TABLE IOT_TABLES MOVE COMPRESS 2;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;9,4 and 9,5 are stored only once along with the data.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;The main advantage of using COMPRESS technique is to save usage space.&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;&quot; name=&quot;_Toc285564551&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Comparing the performance between Regular tables and IOT&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Now, we will compare the results obtained from regular tables and IOT. Let us create two tables viz NON_IOT_TABLE and IOT_TABLE as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE TABLE NON_IOT_TABLE &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;(NON_IOTNUMBER NUMBER, &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;NON_IOTNAME VARCHAR2(20), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;NON_IOTDETAILS VARCHAR2(20), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PRIMARY KEY(NON_IOTNUMBER));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Now, let us create a small procedure to insert equal number of rows into these tables and see the results. &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE OR REPLACE PROCEDURE IOTINSERT AS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;INTERNALCOUNTER NUMBER;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;INTERNALCOUNTER := 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;WHILE INTERNALCOUNTER &amp;lt;= 100000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;LOOP&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO IOT_TABLE VALUES (INTERNALCOUNTER, &#39;AA&#39; || INTERNALCOUNTER, &#39;AABBCC&#39; || INTERNALCOUNTER);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INSERT INTO NON_IOT_TABLE VALUES (INTERNALCOUNTER, &#39;AA&#39; || INTERNALCOUNTER, &#39;AABBCC&#39; || INTERNALCOUNTER);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INTERNALCOUNTER := INTERNALCOUNTER + 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;END LOOP;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;COMMIT;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;END;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt;&quot;&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SQL&amp;gt; SELECT * FROM IOT_TABLE WHERE IOTNUMBER &amp;lt; 2000;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1999 ROWS SELECTED.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EXECUTION PLAN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;PLAN HASH VALUE: 451903227&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ID&lt;span&gt;&amp;nbsp; &lt;/span&gt;| OPERATION&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| NAME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ROWS&lt;span&gt;&amp;nbsp; &lt;/span&gt;| BYTES | COST (%CPU)| TIME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0 | SELECT STATEMENT |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|*&lt;span&gt;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;INDEX RANGE SCAN| SYS_IOT_TOP_232322 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;PREDICATE INFORMATION (IDENTIFIED BY OPERATION ID):&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 - ACCESS(&quot;IOTNUMBER&quot;&amp;lt;2000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;STATISTICS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;1&lt;span&gt;&amp;nbsp; &lt;/span&gt;RECURSIVE CALLS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;DB BLOCK GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;143&lt;span&gt;&amp;nbsp; &lt;/span&gt;CONSISTENT GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;PHYSICAL READS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;124&lt;span&gt;&amp;nbsp; &lt;/span&gt;REDO SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;55870&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES SENT VIA SQL*NET TO CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1839&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES RECEIVED VIA SQL*NET FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;135&lt;span&gt;&amp;nbsp; &lt;/span&gt;SQL*NET ROUNDTRIPS TO/FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (MEMORY)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (DISK)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1999&lt;span&gt;&amp;nbsp; &lt;/span&gt;ROWS PROCESSED&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SQL&amp;gt; SELECT * FROM NON_IOT_TABLE WHERE NON_IOTNUMBER &amp;lt; 2000;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1999 ROWS SELECTED.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EXECUTION PLAN&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;PLAN HASH VALUE: 1269025442&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ID&lt;span&gt;&amp;nbsp; &lt;/span&gt;| OPERATION&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| NAME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| ROWS&lt;span&gt;&amp;nbsp; &lt;/span&gt;| BYTES | COST (%CPU)| TIME&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;0 | SELECT STATEMENT&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp; &lt;/span&gt;TABLE ACCESS BY INDEX ROWID| NON_IOT_TABLE |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;37 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|*&lt;span&gt;&amp;nbsp; &lt;/span&gt;2 |&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;INDEX RANGE SCAN&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;| SYS_C00104050 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 |&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;|&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(0)| 00:00:01 |&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;PREDICATE INFORMATION (IDENTIFIED BY OPERATION ID):&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;---------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2 - ACCESS(&quot;NON_IOTNUMBER&quot;&amp;lt;2000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;STATISTICS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;----------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;1&lt;span&gt;&amp;nbsp; &lt;/span&gt;RECURSIVE CALLS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;DB BLOCK GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;283&lt;span&gt;&amp;nbsp; &lt;/span&gt;CONSISTENT GETS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;PHYSICAL READS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;124&lt;span&gt;&amp;nbsp; &lt;/span&gt;REDO SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;55882&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES SENT VIA SQL*NET TO CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1839&lt;span&gt;&amp;nbsp; &lt;/span&gt;BYTES RECEIVED VIA SQL*NET FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;135&lt;span&gt;&amp;nbsp; &lt;/span&gt;SQL*NET ROUNDTRIPS TO/FROM CLIENT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (MEMORY)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;0&lt;span&gt;&amp;nbsp; &lt;/span&gt;SORTS (DISK)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1999&lt;span&gt;&amp;nbsp; &lt;/span&gt;ROWS PROCESSED&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;If we see the execution plan for both the select statements, we observe that &quot;Consistent Gets&quot; are more in NON_IOT_TABLE. This is very much true because the index will be searched first and then the data will be retrieved from the respective table. However, in case if IOT_TABLE table, the index and data resides in the same place and hence the &quot;Consistent Gets&quot; remains less.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The same reason is provided for the 3 steps execution plan v/s 2 step execution plan, provided above.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/4146964870987641103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/4146964870987641103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/4146964870987641103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/4146964870987641103'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/04/index-organized-tables-iot-part-2.html' title='Index Organized Tables (IOT) - Part 2'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-5830473080119878425</id><published>2011-04-14T05:12:00.000-07:00</published><updated>2011-04-14T05:14:36.353-07:00</updated><title type='text'>Index Organized Tables (IOT) - Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 150%;&quot;&gt;Index Organized Tables&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=1546952687504887828&amp;amp;postID=5830473080119878425&quot; name=&quot;_Toc285564547&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Introduction&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Index Organized Tables (IOT) are tables where data is stored in form of index structure. In IOT, the data is co-located and sorted by primary key. Each leaf block in the index structure contains both Key and Non-Key Columns. Overhead on storing the data along with index is absolutely nothing. This article demonstrates the concept behind IOT, usage of IOT and compares the performance with the regular tables.&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid black; padding: 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Audience&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: black black black -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 347.4pt;&quot; valign=&quot;top&quot; width=&quot;463&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Intermediate Oracle Developers, who wanted to have   a clear understanding on IOT&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Pre-Requisite   Understanding&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 347.4pt;&quot; valign=&quot;top&quot; width=&quot;463&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Audience of this article should possess knowledge   on Explain Plan and Usage of Package&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 131.4pt;&quot; valign=&quot;top&quot; width=&quot;175&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Some   history/version info&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 347.4pt;&quot; valign=&quot;top&quot; width=&quot;463&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;Oracle 9i/10g&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h1&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=1546952687504887828&amp;amp;postID=5830473080119878425&quot; name=&quot;_Toc285564548&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;IOT Creation&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;When we create an IOT, we specify the clause ORGANIZATION INDEX along with Create table statement and it’s mandatory to provide a primary key (either single or composite). Syntax for this is given below:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE TABLE IOT_TABLE &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;(IOTNUMBER NUMBER, &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOTNAME VARCHAR2(20), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;IOTDETAILS VARCHAR2(20), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PRIMARY KEY(IOTNUMBER)) &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ORGANIZATION INDEX;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Now, let us check the options available with IOT. For this, we use DBMS_METADATA package provided by Oracle as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; SELECT DBMS_METADATA.GET_DDL(&#39;TABLE&#39;,&#39;IOT_TABLE&#39;) FROM DUAL;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;DBMS_METADATA.GET_DDL(&#39;TABLE&#39;,&#39;IOT_TABLE&#39;)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;CREATE TABLE &quot;HARI&quot;.&quot;IOT_TABLE&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;(&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;IOTNUMBER&quot; NUMBER, &quot;IOTNAME&quot; VARCHAR2(20),&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&quot;IOTDETAILS&quot; VARCHAR2(2), PRIMARY KEY (&quot;IOTNUMBER&quot;) ENABLE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; ) ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 LOGGING&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; TABLESPACE &quot;USERS&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PCTTHRESHOLD 50&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Note: To view the complete resultset of this command you will need to set the LONG SIZE for your session to 15000 as follows:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&amp;gt; set long 15000&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Couple of interesting parameters to note in options available for IOT&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;a) There is no PCTUSED. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;b) NOCOMPRESS is available in IOT, which by default will not compress the index created&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;PCTUSED is not available in case of HEAP table, as the data is scattered throughout and we specify PCTUSED to identify the used percentage in each block. However in the case of IOT, data has to be co-located and sorted and hence data will go to the block where it has to go. The behavior of the remaining parameters is the same as it is for the regular tables. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;We also have the option of NOCOMPRESS, where in the indexes remain uncompressed (i.e.) in IOT, the index and data are stored together and hence when we create a primary key, the index will be repeated along with the data in every block. NOCOMPRESS is default option.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;We can also use OVERFLOW and INCLUDING clause along with the create table statement for IOT. The detailed explanation on these parameters is provided in the following section of this article.&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=1546952687504887828&amp;amp;postID=5830473080119878425&quot; name=&quot;_Toc285564549&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;Overflow, PCTThreshold and Including&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;In order to explain the concepts behind these terms, let us create a table and using the table I will try to explain the concept.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;CREATE TABLE AGEING_DEFECTS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;(NORMAL_HUMAN_AGE VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;AGE_ISSUES VARCHAR2(30), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;AGE_PHOBIA VARCHAR2(30), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;AGE_IDEAS VARCHAR2(10), &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;PRIMARY KEY(NORMAL_HUMAN_AGE)) &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;ORGANIZATION INDEX PCTTHRESHOLD 20 OVERFLOW INCLUDING AGE_ISSUES;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;According to the oracle manual, these three concepts are defined as follows. These three terms are intertwined and one cannot be explained without reference to another.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpFirst&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;An OVERFLOW clause, which preserves dense clustering of the B-tree index by storing the row column values exceeding a specified threshold in a separate overflow data segment.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpMiddle&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;A PCTTHRESHOLD value, which defines the percentage of space reserved in the index block for an index-organized table. Any portion of the row that exceeds the specified threshold is stored in the overflow segment. In other words, the row is broken at a column boundary into two pieces, a head piece and tail piece. The head piece fits in the specified threshold and is stored along with the key in the index leaf block. The tail piece is stored in the overflow area as one or more row pieces. Thus, the index entry contains the key value, the non-key column values that fit the specified threshold, and a pointer to the rest of the row. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;ListParagraphCxSpLast&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt 0.25in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 10pt; line-height: 150%;&quot;&gt;Ø&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;An INCLUDING clause, which can be used to specify non-key columns that are to be stored in the overflow data segment.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;The overflow data segment can be in the same tablespace or it can be in different tablespace. To explain this, let me illustrate with an example.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin: 6pt 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt; line-height: 150%;&quot;&gt;Assume that the data block size is 2KB. Roughly, each row in the table will hold 80 characters (blindly adding the size of each column in the table). Let us assume that this will occupy approximately 100 bytes. Now, each block will hold 2048 bytes, which means each block can roughly hold 20 rows. Now, after inserting 7000 records into this table, we decide to increase the column length for AGE_PHOBIA and AGE_IDEAS (as provided below). Suppose we insert more records, the complete record may not get accommodated in the same block. Oracle allows the data to get OVERFLOWED to the OVERFLOW SEGMENT. How does it know when to overflow? This is done by PCTTHRESHOLD. If any of the nonkey columns of rows exceed 20% of the block size, they are placed in the overflow data segment in the same tablespace. The key columns should fit the specified threshold. Here Key column is NORMAL_HUMAN_AGE and Non Key Columns are AGE_ISSUES, AGE_PHOBIA and AGE_IDEAS.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border: 1pt solid windowtext; padding: 1pt 4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; ALTER TABLE AGEING_DEFECTS MODIFY AGE_PHOBIA VARCHAR2(40);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;TABLE ALTERED.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 150%;&quot;&gt;SQL&amp;gt; ALTER TABLE AGEING_DEFECTS MODIFY AGE_IDEAS VARCHAR2(20);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; line-height: 150%; margin: 6pt 0in 0.0001pt; padding: 0in; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 115%;&quot;&gt;TABLE ALTERED.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/5830473080119878425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/5830473080119878425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5830473080119878425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5830473080119878425'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2011/04/index-organized-tables-iot-part-1.html' title='Index Organized Tables (IOT) - Part 1'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-6101786895147376341</id><published>2010-12-07T03:26:00.000-08:00</published><updated>2010-12-07T03:26:33.424-08:00</updated><title type='text'>Difference Between In and Exists - Part 2</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from smalltable1 where data1 in (select data5 from largetable);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YIx_KRII/AAAAAAAAABc/cbt3nHoKqgc/s1600/InAndExists-fig3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;215&quot; src=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YIx_KRII/AAAAAAAAABc/cbt3nHoKqgc/s320/InAndExists-fig3.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from smalltable1 st where exists (select 1 from largetable lt where st.data1=lt.data5);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP4YXZbQmGI/AAAAAAAAABg/k4CrBOQp4qU/s1600/InAndExists-fig4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;215&quot; src=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP4YXZbQmGI/AAAAAAAAABg/k4CrBOQp4qU/s320/InAndExists-fig4.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from largetable lt where data5 in (select data1 from smalltable1 st);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YnMGZefI/AAAAAAAAABk/Di8AIXKf5rU/s1600/InAndExists-fig5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YnMGZefI/AAAAAAAAABk/Di8AIXKf5rU/s320/InAndExists-fig5.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from largetable lt where exists (select 1 from smalltable1 st where st.data1=lt.data5);&lt;/span&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YuALe0iI/AAAAAAAAABo/wKtVLlm5sIU/s1600/InAndExists-fig6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YuALe0iI/AAAAAAAAABo/wKtVLlm5sIU/s320/InAndExists-fig6.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Inference&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;From the preceding example, it can be inferred that usage of IN and EXISTS provided us with the same results for both Small table to large table and large table to small table.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Scenario 3: Large table to Large table&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now, the last scenario is to compare large table with another large table and observe the results. Let us create another table largetable2 and compare the results.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from largetable where data5 in (select data5 from largetable2);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100000 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP4Y-SzGXpI/AAAAAAAAABs/CBFLSai93ZM/s1600/InAndExists-fig7.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; src=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP4Y-SzGXpI/AAAAAAAAABs/CBFLSai93ZM/s320/InAndExists-fig7.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from largetable lt where exists (select 1 from largetable2 lt2 where lt.data5=lt2.data5);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100000 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP4ZRPzwjEI/AAAAAAAAABw/SP2rLC4aj-M/s1600/InAndExists-fig8.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; src=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP4ZRPzwjEI/AAAAAAAAABw/SP2rLC4aj-M/s320/InAndExists-fig8.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;To Conclude:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;In all the three scenarios, except for the negligible difference in statistics, it can be observed that both IN and EXISTS behave equally.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/6101786895147376341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/6101786895147376341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/6101786895147376341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/6101786895147376341'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/12/difference-between-in-and-exists-part-2.html' title='Difference Between In and Exists - Part 2'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/__bEVdIi1ONo/TP4YIx_KRII/AAAAAAAAABc/cbt3nHoKqgc/s72-c/InAndExists-fig3.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-2847539692478015244</id><published>2010-12-07T01:13:00.000-08:00</published><updated>2010-12-07T09:18:45.260-08:00</updated><title type='text'>Difference Between In and Exists</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Database Version: Oracle 10g&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Operating System: Windows XP&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;I was actually under the impression that there is actually a good difference between IN and EXISTS. But to my surprise, I found something interesting and further digged into the details and found some good facts. I had a wrong conception, which got cleared after the experiment. I actually wanted to share the same with you.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Till Oracle 8i, IN and Exists were processed in different way by Oracle. However from Oracle 9i, predominantly in Oracle 10g they are much processed on the same way, thanks to CBO intelligent optimizer.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;For the illustration purpose I have created four tables, two small and two big as follows. Now I will compare small to small, small to big, big to big using both IN and EXISTS and see what are the results.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Scenario 1: Small table to Small table&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Table&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table smalltable1 (data1 number(3), data2 varchar2(10), data3 varchar2(10), data4 varchar2(10));&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Procedure&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create or replace procedure smalltableproc is&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter number(3);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter := 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (counter &amp;lt;= 100)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into smalltable1 values (counter,&#39;aa&#39; || counter,&#39;bb&#39; || counter, &#39;cc&#39; || counter);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter := counter + 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end loop;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commit;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Index&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create index smalltable1data1idx on smalltable1(data1);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Procedure Execution&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec smalltableproc;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now, I will create the second small table from the first small table as follows:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table smalltable2 as select * from smalltable1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create index smalltabled2ata1idx on smalltable2(data1);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Before comparing the results, in general I used to update the statistics for both indexes and tables. Even though, creating the indexes will actually build the statistics, I always make it a point to do this.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; exec DBMS_STATS.gather_table_stats(&#39;INXQA&#39;,&#39;SMALLTABLE1&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;PL/SQL procedure successfully completed.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; exec DBMS_STATS.gather_table_stats(&#39;INXQA&#39;,&#39;SMALLTABLE2&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;PL/SQL procedure successfully completed.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now let us see the results between the usage of IN and EXISTS&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from smalltable1 where data1 in (select data1 from smalltable2);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP36me9nsgI/AAAAAAAAABU/fq_a53umhlQ/s1600/InAndExists-fig1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP36me9nsgI/AAAAAAAAABU/fq_a53umhlQ/s320/InAndExists-fig1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from smalltable1 ss where exists (select 1 from smalltable2 st where ss.data1=st.data1);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;100 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP36tVEWaXI/AAAAAAAAABY/xQumyVbXjas/s1600/InAndExists-fig2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP36tVEWaXI/AAAAAAAAABY/xQumyVbXjas/s320/InAndExists-fig2.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Inference&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;It can be inferred from the above example that both IN and EXISTS provided us with the same results for the smaller tables. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now, let us take the next comparison of Small table to Big Table and Vice versa.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Scenario 2: Small table to Large table and Large Table to Small Table&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Table&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table largetable (data5 number(6), data6 varchar2(10), data7 varchar2(10), data8 varchar2(10));&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Procedure&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create or replace procedure largetableproc is&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter number(6);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter := 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (counter &amp;lt;= 100000)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into largetable values (counter,&#39;aa&#39; || counter,&#39;bb&#39; || counter, &#39;cc&#39; || counter);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter := counter + 1;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end loop;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commit;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Index&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create index largetabledata5idx on largetable(data5);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Procedure Execution&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&amp;gt; exec largetableproc&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PL/SQL procedure successfully completed.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Statistics&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&amp;gt; exec DBMS_STATS.gather_table_stats(&#39;HARI&#39;,&#39;LARGETABLE&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PL/SQL procedure successfully completed.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/2847539692478015244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/2847539692478015244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2847539692478015244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2847539692478015244'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/12/difference-between-in-and-exists.html' title='Difference Between In and Exists'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/__bEVdIi1ONo/TP36me9nsgI/AAAAAAAAABU/fq_a53umhlQ/s72-c/InAndExists-fig1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-530543907277071616</id><published>2010-11-28T04:23:00.000-08:00</published><updated>2010-12-06T22:29:30.176-08:00</updated><title type='text'>Bitmap Indexes - Part 2</title><content type='html'>&lt;!--[if !mso]&gt; &lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-fareast-font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Case 1: Using BITMAP for BULK Load.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;To illustrate this, I have created a table called bitmapdemotable as provided below:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table bitmapdemotable (runnumber number(6), runname varchar2(15), runtype number(2));&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;I have also created a procedure to populate this table. Please note that I am using a &quot;While Loop&quot; here to simulate row-by-row insert operation.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create or replace procedure bitmapproc(noofrecords in number) is&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter number;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; counter := 1;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (counter &amp;lt;= noofrecords)&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; loop&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; insert into bitmapdemotable values (counter, &#39;a&#39; || counter,mod(counter,2));&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; counter := counter + 1;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; end loop;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; commit;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Next, I have created an index on this table for the column &quot;runtype&quot; which actually holds either 0 or 1.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create bitmap index bitmapidx on bitmapdemotable(runtype);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;In order to study the behaviour, we need to use TKPROF. For this we need to change the configuration settings of TIMED_STATISTICS and SQL_TRACE&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alter session set timed_statistics=true;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alter session set sql_trace=true;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now, I am executing the procedure by passing the value as 50000. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec bitmapproc(50000)&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;When we see the trace file (after extracting the contents of the trace file into a local text file using TKPROF), it looks like the following figure:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP0Uuh-Qy1I/AAAAAAAAAAM/ElVBQSwJvoI/s1600/bitmapindex-fig1.JPG&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;file:///C:/DOCUME%7E1/Hari/LOCALS%7E1/Temp/msohtml1/01/clip_image001.jpg&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;The initial is for the procedure as a whole (does not include the data for the insert statement as it is separately captured) and the second is for the insert statement. Please note that the insert statement took more CPU, elapsed time and logical I/Os (both query and current). Now, please also note that ELAPSED is greater than CPU, which may be due to some wait events.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Now, instead of row-by-row insert we have captured the statistics for the bulk load and the result is shown in the following figure:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;separator&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP0W17yeHOI/AAAAAAAAAAU/9sIOgo-ysew/s1600/bitmapindex-fig2.JPG&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span&gt;&lt;img border=&quot;0&quot; height=&quot;175&quot; src=&quot;file:///C:/DOCUME%7E1/Hari/LOCALS%7E1/Temp/msohtml1/01/clip_image002.jpg&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;As expected, the SELECT statement, led to FULL TABLE SCAN. But, when we look at the&amp;nbsp; statistics, we can observe vast difference between the row-by-row and BULK load. The reason being, when we do a row-by-row insert, the B-tree is used to locate the leaf nodes that contain bitmap segments for a given value of the key. Start ROWID and the bitmap segments are used to locate the rows that contain the key value. When changes are made to the key column in the table, bitmaps must be modified. This results in the locking of the relevant bitmap segments. Because locks are acquired on the whole bitmap segment, a row that is covered by the bitmap cannot be updated by other transactions until the first transaction ends. Oracle server should repeat this for every row that gets either inserted or updated. Hence row by row manipulation on the rows consists of bitmap index is costly.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/530543907277071616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/530543907277071616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/530543907277071616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/530543907277071616'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-2_918.html' title='Bitmap Indexes - Part 2'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-6601579792783933130</id><published>2010-11-28T03:54:00.000-08:00</published><updated>2010-12-07T00:37:57.150-08:00</updated><title type='text'>Bitmap Indexes - Part 4</title><content type='html'>&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from bitmapdemotable where runtype=1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;125000 rows selected.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP3xYOM2_kI/AAAAAAAAAA8/YFZO1LvW83k/s1600/bitmapindex-fig6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP3xYOM2_kI/AAAAAAAAAA8/YFZO1LvW83k/s320/bitmapindex-fig6.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 8pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; SQL&amp;gt; select * from btreedemotable where runtype=1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;125000 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP3x48K5rCI/AAAAAAAAABA/n6diOhaMmcg/s1600/bitmapindex-fig7.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP3x48K5rCI/AAAAAAAAABA/n6diOhaMmcg/s320/bitmapindex-fig7.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; This states that as far as the query is concerned, there is no difference between the query results on the tables that actually uses btree index and bitmap index. We have considered the scenario where we have two distinct values for run type. Now, let us create the similar type of indexes in another column in the same table and check. Also, we will drop the existing indexes on the runtype column.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
drop index btreeidx;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;drop index bitmapidx;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
To create the indexes on runname column:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
create index runnamebtree on btreedemotable(runname);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;create bitmap index runnamebitmap on bitmapdemotable(runname);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
exec DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;RUNNAMEBTREE&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;exec DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;RUNNAMEBITMAP&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
SQL&amp;gt; select * from bitmapdemotable where runname=&#39;a1000&#39;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP3yB-zfU2I/AAAAAAAAABE/_Kct50ACzsg/s1600/bitmapindex-fig8.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;194&quot; src=&quot;http://2.bp.blogspot.com/__bEVdIi1ONo/TP3yB-zfU2I/AAAAAAAAABE/_Kct50ACzsg/s320/bitmapindex-fig8.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; SQL&amp;gt; select * from btreedemotable where runname=&#39;a1000&#39;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP3yIGjj2FI/AAAAAAAAABI/V74jaXGbqIc/s1600/bitmapindex-fig9.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://4.bp.blogspot.com/__bEVdIi1ONo/TP3yIGjj2FI/AAAAAAAAABI/V74jaXGbqIc/s320/bitmapindex-fig9.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; I actually tried to insert into the tables (with index on runname) and found the following:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
SQL&amp;gt; insert into btreedemotable select * from btreedemotable;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;250000 rows created.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3yPXQtPTI/AAAAAAAAABM/-r2qt9BtlaY/s1600/bitmapindex-fig10.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;161&quot; src=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3yPXQtPTI/AAAAAAAAABM/-r2qt9BtlaY/s320/bitmapindex-fig10.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; SQL&amp;gt; insert into bitmapdemotable select * from bitmapdemotable;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;250000 rows created.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP3yU9MXwAI/AAAAAAAAABQ/WScR_x--CxA/s1600/bitmapindex-fig11.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;161&quot; src=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP3yU9MXwAI/AAAAAAAAABQ/WScR_x--CxA/s320/bitmapindex-fig11.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; Please notice the huge difference between the tables having different indexes on the similar column.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
To conclude:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;a)&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;There is no much difference between b*tree and bitmap as far as the query execution is concerned. Both are exhibiting similar statistics&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;b)&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;The difference comes when we try to perform DML operations on the indexes.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/6601579792783933130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/6601579792783933130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/6601579792783933130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/6601579792783933130'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-4.html' title='Bitmap Indexes - Part 4'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/__bEVdIi1ONo/TP3xYOM2_kI/AAAAAAAAAA8/YFZO1LvW83k/s72-c/bitmapindex-fig6.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-1558974218425461674</id><published>2010-11-28T03:52:00.000-08:00</published><updated>2010-12-06T23:30:54.560-08:00</updated><title type='text'>Bitmap Indexes - Part 3</title><content type='html'>&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Case 2: Comparison between B*Tree and Bitmap&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Let us illustrate this point by identifying when a B*Tree can be used and when we should use Bitmap. Let us consider the same example of what we have done it in case 1 and see if there is any difference when we use b*tree instead of bitmap&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Let us create a table for creating a b*tree index, as follows:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; create table btreedemotable as select * from bitmapdemotable where 1=0; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; create index btreeidx on btreedemotable(runtype);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Let us create the same procedure, but to populate btreedemotable.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
create or replace procedure btreeproc(noofrecords in number) is&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;counter number;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; counter := 1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (counter &amp;lt;= noofrecords)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;loop&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; insert into btreedemotable values (counter, &#39;a&#39; || counter,mod(counter,2));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; counter := counter + 1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; end loop;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; commit;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
alter session set timed_statistics=true;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;alter session set sql_trace=true;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3icqu0UTI/AAAAAAAAAAY/xkZFKQ3iE2M/s1600/bitmapindex-fig3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;295&quot; src=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3icqu0UTI/AAAAAAAAAAY/xkZFKQ3iE2M/s320/bitmapindex-fig3.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Please note that the row-by-row insert for a b*tree index based table works like a champ as compared to bitmap index based table. Now, we will try to select it from the table and see if there are any differences: &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;br /&gt;
SQL&amp;gt; select * from btreedemotable where runtype=1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;25000 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3ieZR_FII/AAAAAAAAAAc/IqSJT780JFU/s1600/bitmapindex-fig4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;http://3.bp.blogspot.com/__bEVdIi1ONo/TP3ieZR_FII/AAAAAAAAAAc/IqSJT780JFU/s320/bitmapindex-fig4.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;SQL&amp;gt; select * from bitmapdemotable where runtype=1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;25000 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP3igGY-6-I/AAAAAAAAAAg/2ZDFKDJj7WU/s1600/bitmapindex-fig5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;245&quot; src=&quot;http://1.bp.blogspot.com/__bEVdIi1ONo/TP3igGY-6-I/AAAAAAAAAAg/2ZDFKDJj7WU/s320/bitmapindex-fig5.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 10pt;&quot;&gt;Except for the minor changes in the statistics and cost, there seems to be no big difference between the two tables having different index types. Now, let us check for the query that returns 125,000 records.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/1558974218425461674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/1558974218425461674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/1558974218425461674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/1558974218425461674'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-3.html' title='Bitmap Indexes - Part 3'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/__bEVdIi1ONo/TP3icqu0UTI/AAAAAAAAAAY/xkZFKQ3iE2M/s72-c/bitmapindex-fig3.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-2144509240351600798</id><published>2010-11-28T03:37:00.000-08:00</published><updated>2010-12-07T09:17:02.975-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Complex Databases"/><title type='text'>Bitmap Indexes</title><content type='html'>&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Database Version: Oracle 10g &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Operating System: Windows XP &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;I was working on tuning a procedure in my current company, when I found something interesting with my colleague. He has created a table with a bitmap index for one of the columns. The insert into the table was found to be very slow and when I checked in the process, he is actually doing a single row operation (of around 50K every day) which is actually taking couple of minutes to insert. There was actually an argument with him and he claims that the slow in insert operation is not due to bitmap index and it is because of something else. Further he claimed that BITMAP index is similar in B*Tree index. Not only him, many could not understand when we should create BITMAP INDEX and what actually it is. &lt;br /&gt;
&lt;br /&gt;
In this article, I will explain what is BITMAP Index, their operational difference (or comparison) and when do we need to create BITMAP indexes. As always said, please do provide your comments.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is BITMAP index?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Oracle created BITMAP index to cater the need for data warehousing and adhoc query mechanism. In general, usage of bitmap index in OLTP is not a highly advisable solution. In a bitmap index, a bitmap for each key value replaces a list of rowids. Each bit in the bitmap corresponds to a possible rowid, and if the bit is set, it means that the row with the corresponding rowid contains the key value. Oracle has created a proprietary mapping function that converts the bit position to an actual rowid, so that the bitmap index provides the same functionality as a regular index. Bitmap indexes store the bitmaps in a compressed way.&lt;br /&gt;
&lt;br /&gt;
Bitmap indexes are most appropriate on low distinct cardinality data (i.e., data with relatively few discrete values when compared to the cardinality of the entire set. It is difficult to define what low distinct cardinality is?. This is data where the number of distinct items in the set of rows divided by the number of rows is a small number (near zero). For example, in a table of 10000 rows, 1 or 2 distinct valued column would be appropriate for a bitmap index. However, in a table of 1000000 rows, 100 or 200 distinct valued column would be appropriate for a bitmap index. I have seen people telling me that columns with more than 5 or 10 distinct columns cannot participate in a bitmap index, which is actually wrong.&lt;br /&gt;
&lt;br /&gt;
In general, when the data is packed for bitmap index, it is not packed like b*tree index. In case of b*tree index, the leaf node will have a list of rowids. In case of bitmap index, the leaf node contains bitmap, with the value set if the key value is available and not set if not. Each leaf node contains the entry header, key, start rowid, end rowid and bitmap segment. A bitmap segment consisting of a string of bits. The bit is set when the corresponding row contains the key value and is unset when the row does not contain the key value. Entry header, which contains the information on the number of columns and lock information. The Oracle server uses a patented compression technique to store bitmap segments and also bitmap Index uses restricted rowid format&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Difference between Bitmap and B*Tree Indexes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bitmap indexes actually store pointers to many rows with a single index key entry, as compared to a B*Tree. In B*Tree index, we will be able to pair the index keys and the corresponding rows in a table. In a bitmap index, there will be a very small number of index entries, each of which points to many rows. In a conventional B*Tree, one index entry points to a single row. &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
When do we need BITMAP index?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We need BITMAP index for data warehousing application, Adhoc Query Processing, and when the data load is quiet large(and we have bulk processing). We should never use a BITMAP index for OLTP processing. We shall consider couple of scenarios where in we check on the usage of BITMAP index and study the response. On the first case, I will show what happens if we use BITMAP index for row-by-row insert and on the second case, we shall see the operational difference between b*tree index and Bitmap Index.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;a href=&quot;http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-2.html&quot;&gt;Part 2&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-3.html&quot;&gt;Part 3&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://solutionpulse.blogspot.com/2010/11/bitmap-indexes-part-4.html&quot;&gt;Part 4&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/2144509240351600798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/2144509240351600798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2144509240351600798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2144509240351600798'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/11/bitmap-indexes.html' title='Bitmap Indexes'/><author><name>Hariharan</name><uri>http://www.blogger.com/profile/18170802613554837516</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-5488965213706934910</id><published>2010-10-08T04:59:00.000-07:00</published><updated>2010-10-08T05:22:48.433-07:00</updated><title type='text'>Facts on Indexes</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;author:&gt;Author:Hariharan T Sairam. My Best Friend :)&lt;/author:&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In a sequence of my learning and experiments, I found some interesting facts on Indexes, which I thought I can provide as an article. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Some of the most celebrated myths are:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;a)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Difference in creation of Indexes &lt;/div&gt;&lt;div&gt;b)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Full table scan is evil&lt;/div&gt;&lt;div&gt;c)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Rebuilding Index leads to faster retrieval of records&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Myth 1: Difference in creation of Indexes&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In this section, we shall consider two cases viz Indexes on individual columns and composite index.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Case 1: Indexes on individual columns&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Let us take an example to illustrate the creation of indexes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;We first create a table called GENERALWORKS, with the following columns:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;create table generalworks &lt;/div&gt;&lt;div&gt;(&lt;/div&gt;&lt;div&gt;GENNO NUMBER(7), &lt;/div&gt;&lt;div&gt;GENNAME VARCHAR2(40), &lt;/div&gt;&lt;div&gt;GENCATG VARCHAR2(2), &lt;/div&gt;&lt;div&gt;GENDESC VARCHAR2(3), &lt;/div&gt;&lt;div&gt;GENDETS VARCHAR2(6)&lt;/div&gt;&lt;div&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Also, for this table, let us create three indexes, one on each column as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;create index GENERALWORKSGENCATGIDX on generalworks(gencatg);&lt;/div&gt;&lt;div&gt;create index GENERALWORKSGENNMEIDX on generalworks(genname);&lt;/div&gt;&lt;div&gt;create index GENERALWORKSGENIDX on generalworks(genno);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Let me also insert 50,000 records into this table.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select count(*) from generalworks;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;COUNT(*)&lt;/div&gt;&lt;div&gt;----------&lt;/div&gt;&lt;div&gt;50000&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To be on the safer side, let me also gather the statistics for the table and indexes as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; EXEC DBMS_STATS.gather_table_stats(&#39;HARI&#39;, &#39;GENERALWORKS&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; exec DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;GENERALWORKSGENCATGIDX&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; exec DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;GENERALWORKSGENNMEIDX&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; exec DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;GENERALWORKSGENIDX&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 1:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;We will now retrieve the records based on the columns GENNAME and GENCATG&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genname=&#39;aaaabbbb&#39; and gencatg=&#39;ab&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 4242548220&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Name              &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT                 &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|   298 |  8046 |    99   (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID     &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;| GENERALWORKS  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|   298 |  8046 |    99   (2)| 00:00:02  |&lt;/div&gt;&lt;div&gt;|   2 |   BITMAP CONVERSION TO ROWIDS    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|         |  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;       |               |               |&lt;/div&gt;&lt;div&gt;|   3 |    BITMAP AND                    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|         |&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;       |               |               |&lt;/div&gt;&lt;div&gt;|   4 |     BITMAP CONVERSION FROM ROWIDS&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|         |&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;       |               |               |&lt;/div&gt;&lt;div&gt;|*  5 |      INDEX RANGE SCAN            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| GENERALWORKSGENCATGIDX |  3860 |      |    12   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   6 |     BITMAP CONVERSION FROM ROWIDS&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|         |  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;       |               |               |&lt;/div&gt;&lt;div&gt;|*  7 |      INDEX RANGE SCAN            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| GENERALWORKSGENNMEIDX  |  3860 |      |    16   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;5 - access(&quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;571  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;160080  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3847  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;From the above execution plan, it is quiet evident that the indexes are getting used and the cost is also less to retrieve 3,847 records. But, wait a minute, something different is seen in the plan. BITMAP? We have created only B*Tree indexes and we are seeing BITMAP in the plan? Reason being, in order to retrieve the data back faster, Oracle decided to implement the mechanism of creating a BITMAP INDEX on the fly. This is done only for certain types of query which will get benefited by this. Otherwise, No.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Also note that the execution plan shows 298 rows for the Step 1 and 0, but actual number processed was 3847. The reason being, execution plan is always an estimate and need not always be similar to the actual plan. Also, there are queries where the actual plan will never coincide with the estimated plan.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 2:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genname=&#39;aaaabbbb&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1336713796&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Name                  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;| Rows| Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|                       &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;|  3860 |   101K|245   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;|  3860 |   101K|245   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;| GENERALWORKSGENNMEIDX &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|  3860 |          | 16   (0) | 00:00:01 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;785  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;160080  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3847  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 3:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 10000 and genname=&#39;aaaabbbb&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3077 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1336713796&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;| Name                  &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; | Rows   |Bytes|Cost (%CPU)|Time     |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|                       &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;  |  3090 | 83430 |245   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS BY INDEX ROWID&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;| GENERALWORKS          &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;  |  3090 | 83430 |245   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| GENERALWORKSGENNMEIDX |  3860 |           | 16   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENNO&quot;&amp;gt;10000)&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;685  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;90912  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;2636  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;207  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3077  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 4:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 10000 and genname=&#39;aaaabbbb&#39; and gencatg=&#39;ab&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3077 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 4242548220&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Name                   | Rows  | Bytes | Cost (%CPU)| Time|&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT                 &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;    |                    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;    |   239 |  6453 |    99   (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS BY INDEX ROWID         | GENERALWORKS  |   239 |  6453 |    99   (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   2 |   BITMAP CONVERSION TO ROWIDS       |                    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;    |          |          |               |               |&lt;/div&gt;&lt;div&gt;|   3 |    BITMAP AND                    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;    |                         |         |&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; |               |               |&lt;/div&gt;&lt;div&gt;|   4 |     BITMAP CONVERSION FROM ROWIDS |                        |         |&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; |               |               |&lt;/div&gt;&lt;div&gt;|*  5 |      INDEX RANGE SCAN                        | GENERALWORKSGENCATGIDX |  3860 | 12   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   6 |     BITMAP CONVERSION FROM ROWIDS|                        |       |&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;  |            |          |&lt;/div&gt;&lt;div&gt;|*  7 |      INDEX RANGE SCAN            | GENERALWORKSGENNMEIDX  |  3860 ||    16   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENNO&quot;&amp;gt;10000)&lt;/div&gt;&lt;div&gt;5 - access(&quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;161  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;555  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;90912  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;2636  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;207  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;6  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3077  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here again, the BITMAP conversion is used with the number of rows not tallying with the actual processed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 5:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where  gencatg=&#39;ab&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 418290240&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Name                   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| Rows  | Bytes | Cost (%CPU)| Time  |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|                        &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;|  3906 |   102K| 239   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS           &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|  3906 |   102K| 239   (1)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;| GENERALWORKSGENCATGIDX &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;|  3906 |          |   8   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;203  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;773  consistent gets&lt;/div&gt;&lt;div&gt;12  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;160080  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;6  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3847  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 6:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 40000;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;10000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 2559079067&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;| Name                        | Rows  | Bytes | Cost(%CPU)| Time     |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;|                    &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;     |  9999 |   263K|    77   (2)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;| GENERALWORKS        |  9999 |   263K|    77   (2)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;| GENERALWORKSGENIDX |  9999 |       |    23   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;40000)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;1406  consistent gets&lt;/div&gt;&lt;div&gt;24  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;417145  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;7707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;10000  rows processed&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;   &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note:&lt;/div&gt;&lt;div&gt;If we replace the condition “genno &amp;gt; 40000” with “genno &amp;gt; 10000” we will incur FULL TABLE SCAN as the number of records to be selected is 40,000.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Case 2: Composite Indexes&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Instead of creating individual indexes for the 3 columns, let us drop the indexes and create a composite index (as below) and study its execution plan.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;create index genworkscompindx on generalworks(genno,genname,gencatg);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In this, first position is GENNO, 2nd position is GENNAME and 3rd is GENCATG. Reason for creating this composite index is to analyze and understand the difference in creating indexes in these two different forms. Now, we shall analyze all the scenarios that we have tested and study the implications&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genname=&#39;aaaabbbb&#39; and gencatg=&#39;ab&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 857713684&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |   298 |  8046 |   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS FULL| GENERALWORKS |   298 |  8046 |   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENNAME&quot;=&#39;aaaabbbb&#39; AND &quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1 recursive calls&lt;/div&gt;&lt;div&gt;0 db block gets&lt;/div&gt;&lt;div&gt;1514 consistent gets&lt;/div&gt;&lt;div&gt;0 physical reads&lt;/div&gt;&lt;div&gt;0 redo size&lt;/div&gt;&lt;div&gt;112736 bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197 bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258 SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0 sorts (memory)&lt;/div&gt;&lt;div&gt;0 sorts (disk)&lt;/div&gt;&lt;div&gt;3847 rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please note that the parameter “consistent gets” is high and this query is undergoing full table scan. Also, the select statement took two seconds more than the first statement. We now need to identify the reason for the table scan (even though table scan is not evil). On the surface level, we might say that the columns GENNAME and GENCATG are in positions 2 and 3 and hence the index is not been used properly. If we execute the following statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT INDEX_NAME, COLUMN_NAME, NUM_ROWS, BLEVEL, LEAF_BLOCKS, CLUSTERING_FACTOR FROM USER_INDEXES UI, USER_IND_COLUMNS UIC WHERE UI.INDEX_NAME=UIC.INDEX_NAME AND UI.TABLE_NAME=’GENERALWORKS’;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;We observe that the CLUSTERING_FACTOR to be 264 and LEAF_BLOCKS to be 194, which actually shows that the indexes will be used as the CLUSTERING_FACTOR is almost close to LEAF_BLOCKS. However, the index will be used only as a whole (i.e.) GENNO, GENNAME and GENCATG (any combination of this). If we carefully study the rest of the scenarios, most will lead to table scan. Indexes will be used when we use all the columns that are indexed in the where clause. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 2:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genname=&#39;aaaabbbb&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 857713684&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |  3860 |   101K|   279   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS FULL| GENERALWORKS |  3860 |   101K|   279   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;1514  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;112736  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3847  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please note that the value for consistent gets is high (almost doubled). Also we can observe that the query is undergoing table scan.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 3:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 10000 and genname=&#39;aaaabbbb&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3077 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1452202321&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            |                  |  3125 | 84375 |   176 (2)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS     |  3125 | 84375 |   176 (2)| 00:00:03 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          | GENWORKSCOMPINDX |  3125 |       |   159 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;10000 AND &quot;GENNAME&quot;=&#39;aaaabbbb&#39; AND &quot;GENNO&quot; IS NOT NULL)&lt;/div&gt;&lt;div&gt;filter(&quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;386  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;806  consistent gets&lt;/div&gt;&lt;div&gt;376  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;128826  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;2636  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;207  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;8  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3077  rows processed&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;   &lt;/div&gt;&lt;div&gt;There is something quite interesting happening in this query. Cost has come down from 245 to 176 for access by ROWID. However, the cost of the index range scan has increased drastically from 16 to 159. Here, the cost specified is for the whole index GENWORKSCOMPINDX, which comprises 3 columns and not a single column. Hence the cost is based on the whole index and not for an individual column. Now, if we drop this index and create an index for individual columns, the cost will be less as it will be based on a single column.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 4:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 10000 and genname=&#39;aaaabbbb&#39; and gencatg=&#39;ab&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3077 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1452202321&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            |                  |   244 |  6588 |   161 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS     |   244 |  6588 |   161 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          | GENWORKSCOMPINDX |   244 |       |   159 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;10000 AND &quot;GENNAME&quot;=&#39;aaaabbbb&#39; AND &quot;GENCATG&quot;=&#39;ab&#39; AND &quot;GEN&lt;/div&gt;&lt;div&gt;NO&quot; IS NOT NULL) filter(&quot;GENNAME&quot;=&#39;aaaabbbb&#39; AND &quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;141  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;769  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;128826  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;2636  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;207  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;6  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3077  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here again, we could see an increase in the cost for the range scan.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 5:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where  gencatg=&#39;ab&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3847 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 857713684&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |  3906 |   102K|   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS FULL| GENERALWORKS |  3906 |   102K|   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENCATG&quot;=&#39;ab&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;386  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;1577  consistent gets&lt;/div&gt;&lt;div&gt;1257  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;112736  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;3197  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;258  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;8  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3847  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here again, there is a huge increase in “Consistent Gets” and “Physical Reads” and the query is undergoing a table scan. This is because we have used a column in the where clause which is in the third position of the index and does not have statistics of its own. Hence, when this query is executed, the statistics by optimizer for this query will be of no use and is not used to arrive at the proper execution plan. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 6:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 40000;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;10000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1452202321&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            |                  |  9999 |   263K|    94 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS     |  9999 |   263K|    94 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          | GENWORKSCOMPINDX |  9999 |       |    40 (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;40000 AND &quot;GENNO&quot; IS NOT NULL)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;1421  consistent gets&lt;/div&gt;&lt;div&gt;41  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;417145  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;7707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;10000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Since the first column in the index is used in the where clause, the optimizer is able to arrive at the proper execution plan using the column. Hence index path is chosen to execute this query.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Scenario 7:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where gencatg=&#39;ab&#39; and genname=&#39;aaaabbbb&#39; and genno &amp;gt; 10000;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;3077 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1452202321&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            |                  |   244 |  6588 |   161 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS     |   244 |  6588 |   161 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          | GENWORKSCOMPINDX |   244 |       |   159 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;10000 AND &quot;GENNAME&quot;=&#39;aaaabbbb&#39; AND &quot;GENCATG&quot;=&#39;ab&#39; AND &quot;GENNO&quot; IS NOT NULL)&lt;/div&gt;&lt;div&gt;filter(&quot;GENCATG&quot;=&#39;ab&#39; AND &quot;GENNAME&quot;=&#39;aaaabbbb&#39;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;183  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;773  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;128826  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;2636  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;207  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;6  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3077  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The above scenario is provided to illustrate an important point. If an index is create on three columns viz Column a, Column b and Column c, then these three columns can be used in any order (i.e.) &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Where Column a = ‘’ or Column b=’’ and Column c=’’ &lt;/div&gt;&lt;div&gt;Where Column b = ‘’ or Column c=’’ and Column a=’’ &lt;/div&gt;&lt;div&gt;Where Column c = ‘’ or Column a=’’ and Column b=’’ &lt;/div&gt;&lt;div&gt;Where Column a = ‘’ or Column c=’’ and Column b=’’ &lt;/div&gt;&lt;div&gt;Where Column b = ‘’ or Column a=’’ and Column c=’’ &lt;/div&gt;&lt;div&gt;Where Column c = ‘’ or Column b=’’ and Column a=’’ &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;All the above combination will yield the index usage and should not create any major difference in the level of execution.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Conclusion:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If the columns are not always used together, please do create indexes on separate columns. If the columns are always used together, please do create composite indexes. Please also note that creation of index depends on the use case.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Myth 2: Full Table Scan is evil&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Many think that full table scan is evil and they try to create indexes or use hints to convert this full table scan into other types of scan where indexes can be used. However, it is not so. Full table scan is never an evil way of executing the query. The reason for the optimizer to decide on the full table scan is probably due to low execution cost. From Oracle documentation, the following on Cost Based Optimizer (CBO) is known:&lt;/div&gt;&lt;div&gt;The CBO determines which execution plan is most efficient by considering available access paths and by factoring in information based on statistics for the schema objects (tables or indexes) accessed by the SQL statement. The CBO performs the following steps:&lt;/div&gt;&lt;div&gt;1.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The optimizer generates a set of potential plans for the SQL statement based on available access paths and hints.&lt;/div&gt;&lt;div&gt;2.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The optimizer estimates the cost of each plan based on statistics in the data dictionary for the data distribution and storage characteristics of the tables, indexes, and partitions accessed by the statement. &lt;/div&gt;&lt;div&gt;3.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The optimizer compares the costs of the plans and chooses the one with the lowest cost.&lt;/div&gt;&lt;div&gt;Let us take the example using the tables created in Myth 1 and see what happens if we induce the index. The following statement is without using an index hint and hence it goes for the full table scan.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from generalworks where genno &amp;gt; 10000;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;40000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 857713684&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              | 40000 |  1054K|   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;|*  1 |  TABLE ACCESS FULL| GENERALWORKS | 40000 |  1054K|   280   (2)| 00:00:04 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;1 - filter(&quot;GENNO&quot;&amp;gt;10000)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;3913  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;1506899  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;29707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;2668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;40000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, we shall use the index hint so that the optimizer will use this index to execute the query.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select /*+ index(generalworks genworkscompindx) */  * from generalworks where genno &amp;gt; 10000;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;40000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 1452202321&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT            |                  | 40000 |  1054K|   372 (1)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS BY INDEX ROWID| GENERALWORKS     | 40000 |  1054K|   372 (1)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|*  2 |   INDEX RANGE SCAN          | GENWORKSCOMPINDX | 40000 |       |   159 (2)| 00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2 - access(&quot;GENNO&quot;&amp;gt;10000 AND &quot;GENNO&quot; IS NOT NULL)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;5685  consistent gets&lt;/div&gt;&lt;div&gt;117  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;1666842  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;29707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;2668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;40000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, we have successfully made this query to execute by using the index. However, the following is to be noted:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;a)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Cost is increased&lt;/div&gt;&lt;div&gt;b)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Consistent gets is increased&lt;/div&gt;&lt;div&gt;c)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Physical Reads increased&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Reason for this is, the optimizer when it compared the cost of executing the queries for various options, it found that using index for this is a costly affair. Hence it chose the full table scan. But when we induced the index usage, the execution plan is observed to be costly. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Having said this, the following are also to be noted:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;a)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;If the cost is less after inducing the index, it means that proper statistics is not fed into the optimizer. Please make sure that all necessary statistics are updated in the tables.&lt;/div&gt;&lt;div&gt;b)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Table scan in some occasions may prove to be an evil, if we do not perform the normal ground work like creating appropriate indexes, statistics collection and proper joins.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Myth 3: Rebuilding Index leads to faster retrieval of records.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Rebuilding an index would to some extent decrease the execution time of a select query, but increases the execution time of the DML operation. Please note that I said some extent and not to a greater extent. When we rebuild an index, it tightly compacts the index in such a way that most of the indexes almost lie near to each other there on the query operations completes a bit faster. However, this will also affect the involved DML operations. Let us illustrate this with an example.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Let me create a table, insert some data into it and study the corresponding statistics. After that we will rebuild the involved indexes and study the corresponding statistics and compare the same.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; create table rebuildcheck (firstcol number);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Table created.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; create index rebuildindex on rebuildcheck(firstcol);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Index created.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I created a small procedure to insert the data into this table as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;create or replace procedure rebuildproc as&lt;/div&gt;&lt;div&gt;begin&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for i in 1 .. 400000&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;loop&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;insert into rebuildcheck values (trunc(dbms_random.value(1,500000)));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;end loop;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;commit;&lt;/div&gt;&lt;div&gt;end;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In order to study the behaviour of this insert operation, I turned on the SQL trace as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; ALTER SYSTEM SET TIMED_STATISTICS = TRUE;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;System altered.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; alter session set sql_trace=true;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Session altered.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; exec rebuildproc&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; alter session set sql_trace=false;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Session altered.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now in my command prompt, I converted the generated trace file into a text file using TKPROF utility as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;tkprof D:\oracle\product\10.2.0\admin\orcl\udump\&lt;/div&gt;&lt;div&gt;orcl_ora_3820.trc d:\oracleexperiments\rebuildtrace.txt explain=hari/hari&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The result shows the execution details of this procedure as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;BEGIN rebuildproc; END;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;/div&gt;&lt;div&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;/div&gt;&lt;div&gt;Parse        1      0.01       0.00          0          0          0           0&lt;/div&gt;&lt;div&gt;Execute      1     48.17      51.25          0          0          0           1&lt;/div&gt;&lt;div&gt;Fetch        0      0.00       0.00          0          0          0           0&lt;/div&gt;&lt;div&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;/div&gt;&lt;div&gt;total        2     48.18      51.25          0          0          0           1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CPU is 48 seconds with the elapsed time of 51 seconds&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, let us also select from this table and see the execution plan&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from rebuildcheck;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;400000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3132651637&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |   378K|  4803K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS FULL| REBUILDCHECK |   378K|  4803K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;4  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;27359  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;7454987  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;293707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;26668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;400000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please note that even if we induce index the cost remains more or less the same as shown below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select /*+ index(rebuildcheck rebuildindex) */  * from rebuildcheck;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;400000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3132651637&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |   345K|  4384K|   148   (7)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS FULL| REBUILDCHECK |   345K|  4384K|   148   (7)| 00:00:02 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;205  recursive calls&lt;/div&gt;&lt;div&gt;1  db block gets&lt;/div&gt;&lt;div&gt;27392  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;176  redo size&lt;/div&gt;&lt;div&gt;5854855  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;293707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;26668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;5  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;400000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, let us rebuild the index and see what happens:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; alter index rebuildindex rebuild;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Index altered.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; EXEC DBMS_STATS.gather_table_stats(&#39;HARI&#39;, &#39;REBUILDCHECK&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; EXEC DBMS_STATS.gather_index_stats(&#39;HARI&#39;, &#39;REBUILDINDEX&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;PL/SQL procedure successfully completed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select * from rebuildcheck;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;400000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3132651637&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |   378K|  4803K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS FULL| REBUILDCHECK |   378K|  4803K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;50  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;27365  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;7454987  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;293707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;26668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;400000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; select /*+ index(rebuildcheck rebuildindex) */  * from rebuildcheck;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;400000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3132651637&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation         | Name         | Rows  | Bytes | Cost (%CPU)| Time |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT  |              |   400K|  1562K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|   1 |  TABLE ACCESS FULL| REBUILDCHECK |   400K|  1562K|   149   (8)| 00:00:02 |&lt;/div&gt;&lt;div&gt;----------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;27293  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;5854855  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;293707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;26668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;400000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;BEGIN rebuildproc; END;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;/div&gt;&lt;div&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;/div&gt;&lt;div&gt;Parse        2      0.03       0.00          0          0          0           0&lt;/div&gt;&lt;div&gt;Execute      2    101.79     108.58          0          0          0           2&lt;/div&gt;&lt;div&gt;Fetch        0      0.00       0.00          0          0          0           0&lt;/div&gt;&lt;div&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;/div&gt;&lt;div&gt;total        4    101.82     108.59          0          0          0           2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Misses in library cache during parse: 2&lt;/div&gt;&lt;div&gt;Optimizer mode: ALL_ROWS&lt;/div&gt;&lt;div&gt;Parsing user id: 62  (HARI)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please note that CPU is increased 102 seconds with the elapsed time of 109 seconds. Almost 54 seconds more than expected with 58 seconds more on elapsed time. Also, note that not much improvement is noticed on the query execution.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The argument on using the rebuild index option still continues in this database world. One side of experts advise not to use rebuild option at all while the other end of experts advise to use the same. If we use rebuild, the issue is on using the DML statements. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/5488965213706934910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/5488965213706934910' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5488965213706934910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5488965213706934910'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/10/facts-on-indexes.html' title='Facts on Indexes'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-3907560479387870282</id><published>2010-10-08T04:38:00.000-07:00</published><updated>2010-10-08T05:26:01.869-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Complex Databases"/><category scheme="http://www.blogger.com/atom/ns#" term="Database view"/><title type='text'>Database view is not an evil database object</title><content type='html'>&lt;author:&gt;&lt;/author:&gt;&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;author:&gt;Author&lt;hariharan&gt;:Hariharan T Sairam&amp;nbsp;&lt;/hariharan&gt;&lt;/author:&gt;&lt;br /&gt;
&lt;author:&gt;&lt;hariharan&gt;&lt;br /&gt;
&lt;/hariharan&gt;&lt;/author:&gt;&lt;/div&gt;&lt;div&gt;Many folks in IT industry think that using database view is an evil, degrade performance on usage and should never be used. This article provides substantial evidence that view never impacts performance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;By definition, a database view is a virtual query. It never exists as an object. If a view is slow in performance, it is not due to view and it is due to the underlying query. Many fail to understand this basic concept. In order to understand this, I have created the following tables with index on EMPNO and each table has 100,000 records.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EMPLOYEE&lt;/div&gt;&lt;div&gt;2.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EMPSALARY&lt;/div&gt;&lt;div&gt;3.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EMPADDRESS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To begin with, I have created a view called &quot;EMPVIEW&quot; joining the tables EMPLOYEE and EMPSALARY and its definition is given below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CREATE VIEW EMPVIEW AS SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SQL&amp;gt; SELECT * FROM EMPVIEW;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 820308138&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation          | Name      | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT   |           |     1 |    83 |     5 (20)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|* 1 | HASH JOIN         |           |     1 |    83 |     5 (20)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL| EMPLOYEE |     1 |    25 |     2   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   3 |   TABLE ACCESS FULL| EMPSALARY |     1 |    58 |     2   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access (&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;612 recursive calls&lt;/div&gt;&lt;div&gt;0 db block gets&lt;/div&gt;&lt;div&gt;7436 consistent gets&lt;/div&gt;&lt;div&gt;0 physical reads&lt;/div&gt;&lt;div&gt;0 redo size&lt;/div&gt;&lt;div&gt;3518422 bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707 bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668 SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;16 sorts (memory)&lt;/div&gt;&lt;div&gt;0 sorts (disk)&lt;/div&gt;&lt;div&gt;100000 rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, if we execute the underlying query of the view (which is given below), obviously we will come to know that the explain plan is same except for a very small difference in the statistics.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 820308138&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation          | Name      | Rows  | Bytes | Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT   |           |     1 |    83 |     5  (20)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN         |           |     1 |    83 |     5  (20)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL| EMPLOYEE  |     1 |    25 |     2   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   3 |   TABLE ACCESS FULL| EMPSALARY |     1 |    58 |     2   (0)| 00:00:01 |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;1  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;7343  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;3518422  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, I am joining all the three tables and the explain plan for the same is given below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPA.EMPADDR1, EMPA.EMPADDR2, EMPA.EMPADDR3, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV FROM EMPLOYEE EMP JOIN EMPADDRESS EMPA ON EMP.EMPNO=EMPA.EMPNO JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3201299630&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation           | Name       | Rows  | Bytes |TempSpc| Cost (%CPU)|Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT    |            |   100K| 4492K|       |   838   (4)|00:00:11 |&lt;/div&gt;&lt;div&gt;|* 1 | HASH JOIN          |            |   100K| 4492K| 3328K|   838   (4)|00:00:11 |&lt;/div&gt;&lt;div&gt;|* 2 |   HASH JOIN         |            |   100K| 2148K| 1960K|   398   (4)|00:00:05 |&lt;/div&gt;&lt;div&gt;|   3 |    TABLE ACCESS FULL| EMPLOYEE   |   100K|   781K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL| EMPADDRESS |   100K| 1367K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;|   5 |   TABLE ACCESS FULL | EMPSALARY |   100K| 2343K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;2 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPA&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;942 recursive calls&lt;/div&gt;&lt;div&gt;0 db block gets&lt;/div&gt;&lt;div&gt;7922 consistent gets&lt;/div&gt;&lt;div&gt;1130 physical reads&lt;/div&gt;&lt;div&gt;0 redo size&lt;/div&gt;&lt;div&gt;3618604 bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707 bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668 SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;18 sorts (memory)&lt;/div&gt;&lt;div&gt;0 sorts (disk)&lt;/div&gt;&lt;div&gt;100000 rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now let us join the view with the table “EMPADDRESS” and see the results:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT EMPV.EMPNO, EMPV.EMPNAME, EMPA.EMPADDR1, EMPA.EMPADDR2, EMPA.EMPADDR3, EMPV.EMPMONTH, EMPV.EMPBASIC, EMPV.EMPHRA, EMPV.EMPCONV FROM EMPVIEW EMPV JOIN EMPADDRESS EMPA ON EMPV.EMPNO=EMPA.EMPNO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3201299630&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation           | Name       | Rows  | Bytes |TempSpc| Cost (%CPU)|Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT    |            |   100K|  4492K|       |   838   (4)|00:00:11 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN          |            |   100K|  4492K|  3328K|   838   (4)|00:00:11 |&lt;/div&gt;&lt;div&gt;|*  2 |   HASH JOIN         |            |   100K|  2148K|  1960K|   398   (4)|00:00:05 |&lt;/div&gt;&lt;div&gt;|   3 |    TABLE ACCESS FULL| EMPLOYEE   |   100K|   781K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL| EMPADDRESS |   100K|  1367K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;|   5 |   TABLE ACCESS FULL | EMPSALARY  |   100K|  2343K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;2 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPA&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;588  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;7878  consistent gets&lt;/div&gt;&lt;div&gt;3  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;3618604  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;20  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This proves a point that the execution plan of a query with view is same as using the actual query. However, let us see what happens if we create a view on another view. For this let us create another table called &quot;EMPWORKS&quot; having 100,000 records&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Let us create a view called “EMPWORKVIEW” by joining the already created EMPVIEW with EMPWORKS table.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CREATE VIEW EMPWORKVIEW AS SELECT EMPV.EMPNO, EMPV.EMPNAME, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPV.EMPMONTH, EMPV.EMPBASIC, EMPV.EMPHRA, EMPV.EMPCONV FROM EMPVIEW EMPV JOIN EMPWORKS EMPW ON EMPV.EMPNO=EMPW.EMPNO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT * FROM EMPWORKVIEW&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 2018455878&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation           | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT    |           | 84747 |  5462K|       |   918   (3)| 00:00:12 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN          |           | 84747 |  5462K|  3808K|   918   (3)| 00:00:12 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL | EMPWORKS  | 84747 |  2813K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN         |           |   100K|  3125K|  1960K|   446   (4)| 00:00:06 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   5 |    TABLE ACCESS FULL| EMPSALARY |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access (&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access (&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;252 recursive calls&lt;/div&gt;&lt;div&gt;1 db block gets&lt;/div&gt;&lt;div&gt;7751 consistent gets&lt;/div&gt;&lt;div&gt;0 physical reads&lt;/div&gt;&lt;div&gt;176 redo size&lt;/div&gt;&lt;div&gt;4502964 bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707 bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668 SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;7 sorts (memory)&lt;/div&gt;&lt;div&gt;0 sorts (disk)&lt;/div&gt;&lt;div&gt;100000 rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, if we join the three tables EMPWORKS, EMPSALARY and EMPWORKS we can see that the execution plan remains the same, but with meager difference in the statistics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO JOIN EMPWORKS EMPW ON EMP.EMPNO=EMPW.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 2018455878&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation           | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT    |           | 84747 | 5462K|       |   918   (3)| 00:00:12 |&lt;/div&gt;&lt;div&gt;|* 1 | HASH JOIN          |           | 84747 | 5462K| 3808K|   918   (3)| 00:00:12 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL | EMPWORKS | 84747 | 2813K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|* 3 |   HASH JOIN         |           |   100K| 3125K| 1960K|   446   (4)| 00:00:06 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL| EMPLOYEE |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   5 |    TABLE ACCESS FULL| EMPSALARY |   100K| 2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access (&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access (&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;134 recursive calls&lt;/div&gt;&lt;div&gt;0 db block gets&lt;/div&gt;&lt;div&gt;7732 consistent gets&lt;/div&gt;&lt;div&gt;0 physical reads&lt;/div&gt;&lt;div&gt;0 redo size&lt;/div&gt;&lt;div&gt;4502964 bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707 bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668 SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;7 sorts (memory)&lt;/div&gt;&lt;div&gt;0 sorts (disk)&lt;/div&gt;&lt;div&gt;100000 rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now this proves a major point that a view created on a view is also same as the joins of the underlying tables. But, if we observe very closely, the cost is increased from 838 to 918. We also need to understand that the increase in cost is not because of the view, but because of the underlying query.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please also note that, we have indexes in all the tables for the EMPNO column. But the indexes are not used by the query. As a by product of this experiment, I also found that indexes will not be used in the query when we have only JOIN clause but no where clause. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To prove further on this line of thought, I created three more tables(EMPTYPES, EMPPHONES, AND EMPEMAIL) and created views and observed the following: &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The view is created with EMPTYPES table and EMPWORKVIEW.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CREATE VIEW EMPTYPEVIEW AS SELECT EMPW.EMPNO, EMPW.EMPNAME, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPW.EMPMONTH, EMPW.EMPBASIC, EMPW.EMPHRA, EMPW.EMPCONV, EMPT.EMPTYPE, EMPT.EMPTYPEDESC FROM EMPWORKVIEW EMPW JOIN EMPTYPES EMPT ON EMPW.EMPNO=EMPT.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT * FROM EMPTYPEVIEW;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3664500689&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation            | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)|Time     |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT     |           | 84748 |  7779K|       |  1492   (3)|00:00:18 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN           |           | 84748 |  7779K|  4032K|  1492   (3)|00:00:18 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL  | EMPTYPES  |   103K|  2817K|       |    59   (7)|00:00:01 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN          |           | 84747 |  5462K|  3808K|   918   (3)|00:00:12 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL | EMPWORKS  | 84747 |  2813K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN         |           |   100K|  3125K|  1960K|   446   (4)|00:00:06 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|   7 |     TABLE ACCESS FULL| EMPSALARY |   100K|  2343K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;-----------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;282  recursive calls&lt;/div&gt;&lt;div&gt;1  db block gets&lt;/div&gt;&lt;div&gt;8075  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;132  redo size&lt;/div&gt;&lt;div&gt;5148458  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;10  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPT.EMPTYPE, EMPT.EMPTYPEDESC FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO JOIN EMPWORKS EMPW ON EMP.EMPNO=EMPW.EMPNO JOIN EMPTYPES EMPT ON EMP.EMPNO=EMPT.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3664500689&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation            | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)|Time     |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT     |           | 84748 |  7779K|       |  1492   (3)|00:00:18 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN           |           | 84748 |  7779K|  4032K|  1492   (3)|00:00:18 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL  | EMPTYPES  |   103K|  2817K|       |    59   (7)|00:00:01 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN          |           | 84747 |  5462K|  3808K|   918   (3)|00:00:12 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL | EMPWORKS  | 84747 |  2813K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN         |           |   100K|  3125K|  1960K|   446   (4)|00:00:06 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)|00:00:01 |&lt;/div&gt;&lt;div&gt;|   7 |     TABLE ACCESS FULL| EMPSALARY |   100K|  2343K|       |   100   (4)|00:00:02 |&lt;/div&gt;&lt;div&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Note&lt;/div&gt;&lt;div&gt;-----&lt;/div&gt;&lt;div&gt;- dynamic sampling used for this statement&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;472  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;8096  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;5148458  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;22  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The next view is created between EMPTYPEVIEW and EMPTYPES table:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CREATE VIEW EMPPHONEVIEW AS SELECT EMPW.EMPNO, EMPW.EMPNAME, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPW.EMPMONTH, EMPW.EMPBASIC, EMPW.EMPHRA, EMPW.EMPCONV, EMPW.EMPTYPE, EMPW.EMPTYPEDESC, EMPP.EMPPHONENO, EMPP.EMPPHONETYPE FROM EMPTYPEVIEW EMPW JOIN EMPPHONES EMPP ON EMPW.EMPNO=EMPP.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT * FROM EMPPHONEVIEW;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3351495524&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation             | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT      |           |   100K|  6738K|       |  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN            |           |   100K|  6738K|  3520K|  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL   | EMPSALARY |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN           |           |   100K|  4394K|  2448K|  1094   (4)| 00:00:14 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL  | EMPPHONES |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN          |           |   100K|  3125K|  2448K|   688   (4)| 00:00:09 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL | EMPWORKS  |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  7 |     HASH JOIN         |           |   100K|  1855K|  1960K|   342   (5)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|   8 |      TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   9 |      TABLE ACCESS FULL| EMPTYPES  |   100K|  1074K|       |    59   (7)| 00:00:01 |&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPP&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;579  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;8318  consistent gets&lt;/div&gt;&lt;div&gt;1558  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;6049063  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;10  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPT.EMPTYPE, EMPT.EMPTYPEDESC,EMPP.EMPPHONENO, EMPP.EMPPHONETYPE FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO JOIN EMPWORKS EMPW ON EMP.EMPNO=EMPW.EMPNO JOIN EMPTYPES EMPT ON EMP.EMPNO=EMPT.EMPNO JOIN EMPPHONES EMPP ON EMP.EMPNO=EMPP.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 3351495524&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation             | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT      |           |   100K|  6738K|       |  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN            |           |   100K|  6738K|  3520K|  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL   | EMPSALARY |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN           |           |   100K|  4394K|  2448K|  1094   (4)| 00:00:14 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL  | EMPPHONES |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN          |           |   100K|  3125K|  2448K|   688   (4)| 00:00:09 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL | EMPWORKS  |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  7 |     HASH JOIN         |           |   100K|  1855K|  1960K|   342   (5)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|   8 |      TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|   9 |      TABLE ACCESS FULL| EMPTYPES  |   100K|  1074K|       |    59   (7)| 00:00:01 |&lt;/div&gt;&lt;div&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPP&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;208  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;8259  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;6049063  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;10  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The last view is created between EMPPHONEVIEW and EMPEMAIL table.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;CREATE VIEW EMPEMAILVIEW AS SELECT EMPW.EMPNO, EMPW.EMPNAME, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPW.EMPMONTH, EMPW.EMPBASIC, EMPW.EMPHRA, EMPW.EMPCONV, EMPW.EMPTYPE, EMPW.EMPTYPEDESC, EMPW.EMPPHONENO, EMPW.EMPPHONETYPE, EMPP.EMPEMAILADDR1, EMPP.EMPEMAILADDR2 FROM EMPPHONEVIEW EMPW JOIN EMPEMAIL EMPP ON EMPW.EMPNO=EMPP.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;SELECT * FROM EMPEMAILVIEW;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 775852864&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation              | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT       |           |   100K|  9082K|       |  2304   (3)| 00:00:28 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN             |           |   100K|  9082K|  3520K|  2304   (3)| 00:00:28 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL    | EMPEMAIL  |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN            |           |   100K|  6738K|  3520K|  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL   | EMPSALARY |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN           |           |   100K|  4394K|  2448K|  1094   (4)| 00:00:14 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL  | EMPPHONES |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  7 |     HASH JOIN          |           |   100K|  3125K|  2448K|   688   (4)| 00:00:09 |&lt;/div&gt;&lt;div&gt;|   8 |      TABLE ACCESS FULL | EMPWORKS  |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  9 |      HASH JOIN         |           |   100K|  1855K|  1960K|   342   (5)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|  10 |       TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|  11 |       TABLE ACCESS FULL| EMPTYPES  |   100K|  1074K|       |    59   (7)| 00:00:01 |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPP&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPP&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;9 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;685  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;8772  consistent gets&lt;/div&gt;&lt;div&gt;1991  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;8048509  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;12  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div&gt;SELECT EMP.EMPNO, EMP.EMPNAME, EMPS.EMPMONTH, EMPS.EMPBASIC, EMPS.EMPHRA, EMPS.EMPCONV, EMPW.EMPWRKAREA, EMPW.EMPWRKLOC, EMPW.EMPROLE, EMPT.EMPTYPE, EMPT.EMPTYPEDESC,EMPP.EMPPHONENO, EMPP.EMPPHONETYPE,EMPE.EMPEMAILADDR1, EMPE.EMPEMAILADDR2 FROM EMPLOYEE EMP JOIN EMPSALARY EMPS ON EMP.EMPNO=EMPS.EMPNO JOIN EMPWORKS EMPW ON EMP.EMPNO=EMPW.EMPNO JOIN EMPTYPES EMPT ON EMP.EMPNO=EMPT.EMPNO JOIN EMPPHONES EMPP ON EMP.EMPNO=EMPP.EMPNO JOIN EMPEMAIL EMPE ON EMP.EMPNO=EMPE.EMPNO;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;100000 rows selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;Plan hash value: 775852864&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;| Id  | Operation              | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;|   0 | SELECT STATEMENT       |           |   100K|  9082K|       |  2304   (3)| 00:00:28 |&lt;/div&gt;&lt;div&gt;|*  1 |  HASH JOIN             |           |   100K|  9082K|  3520K|  2304   (3)| 00:00:28 |&lt;/div&gt;&lt;div&gt;|   2 |   TABLE ACCESS FULL    | EMPEMAIL  |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  3 |   HASH JOIN            |           |   100K|  6738K|  3520K|  1642   (3)| 00:00:20 |&lt;/div&gt;&lt;div&gt;|   4 |    TABLE ACCESS FULL   | EMPSALARY |   100K|  2343K|       |   100   (4)| 00:00:02 |&lt;/div&gt;&lt;div&gt;|*  5 |    HASH JOIN           |           |   100K|  4394K|  2448K|  1094   (4)| 00:00:14 |&lt;/div&gt;&lt;div&gt;|   6 |     TABLE ACCESS FULL  | EMPPHONES |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  7 |     HASH JOIN          |           |   100K|  3125K|  2448K|   688   (4)| 00:00:09 |&lt;/div&gt;&lt;div&gt;|   8 |      TABLE ACCESS FULL | EMPWORKS  |   100K|  1269K|       |    73   (6)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|*  9 |      HASH JOIN         |           |   100K|  1855K|  1960K|   342   (5)| 00:00:05 |&lt;/div&gt;&lt;div&gt;|  10 |       TABLE ACCESS FULL| EMPLOYEE  |   100K|   781K|       |    72   (5)| 00:00:01 |&lt;/div&gt;&lt;div&gt;|  11 |       TABLE ACCESS FULL| EMPTYPES  |   100K|  1074K|       |    59   (7)| 00:00:01 |&lt;/div&gt;&lt;div&gt;--------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Predicate Information (identified by operation id):&lt;/div&gt;&lt;div&gt;---------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPE&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;3 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPS&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;5 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPP&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;7 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPW&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;9 - access(&quot;EMP&quot;.&quot;EMPNO&quot;=&quot;EMPT&quot;.&quot;EMPNO&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;909  recursive calls&lt;/div&gt;&lt;div&gt;0  db block gets&lt;/div&gt;&lt;div&gt;8777  consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;8048509  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;73707  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;6668  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;26  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;100000  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now, it is concretely observed that the increase in cost is not because of view, but the underlying query. Hence the prevailing thought that view is an evil is misconception.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please do send me your comments&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/3907560479387870282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/3907560479387870282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/3907560479387870282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/3907560479387870282'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2010/10/database-view-is-not-evil-database.html' title='Database view is not an evil database object'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-9124493197693809279</id><published>2008-09-29T23:24:00.000-07:00</published><updated>2008-09-29T23:42:11.487-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Test Automation Tool"/><title type='text'>ThoughtWorks announces Early Access of Twist, Automated Functional Testing platform</title><content type='html'>High-level overview about Twist:&lt;br /&gt;&lt;br /&gt;Twist enables business users and technical professionals to work together to create test suites of lasting business value and impact; Early Access offers progressive software teams a first glimpse of the next-generation of testing tools&lt;br /&gt;&lt;br /&gt;Twist drives the development of lasting and re-usable test suites that are easily maintainable throughout the software development lifecycle – allowing businesses to get the maximum return on the investment they make in building test suites. It enables business experts to define acceptance criteria in English-like language, increases tester productivity with a powerful editor and gives developers early feedback on product quality.&lt;br /&gt;&lt;br /&gt;Please write to me, if you need help using Twist and for feedback.&lt;br /&gt;&lt;br /&gt;Twist can be downloaded from the URL: &lt;span style=&quot;text-decoration: underline;&quot;&gt;www.thoughtworks.com/twist&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/9124493197693809279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/9124493197693809279' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/9124493197693809279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/9124493197693809279'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2008/09/thoughtworks-announces-early-access-of.html' title='ThoughtWorks announces Early Access of Twist, Automated Functional Testing platform'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-447922878613612109</id><published>2008-05-23T11:34:00.000-07:00</published><updated>2008-05-24T04:48:10.264-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SOA Testing"/><category scheme="http://www.blogger.com/atom/ns#" term="TWPortalPost"/><title type='text'>Traditional Vs SOA testing</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgrzIngE_0SOlYCJvP8k_dC6aOlrWgqDPsXEcVm1SgOr-Sn18HW_xbK2U2bEiATRzV2B36oYaqA2uesgSqb5YQc_Cm72RzkRWZlpfFmxN0udL6gwWEnPEK2r7nedpjTaPVxF7Td4sTxSY/s1600-h/traditonal+vs+soa.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5203909836736344050&quot; style=&quot;FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgrzIngE_0SOlYCJvP8k_dC6aOlrWgqDPsXEcVm1SgOr-Sn18HW_xbK2U2bEiATRzV2B36oYaqA2uesgSqb5YQc_Cm72RzkRWZlpfFmxN0udL6gwWEnPEK2r7nedpjTaPVxF7Td4sTxSY/s400/traditonal+vs+soa.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;SOA promises benefits to organizations by providing a framework for building applications through re-usable components. This helps organizations evolve their IT solutions over time, as well as avoid costly integration and re-engineering efforts. SOA enables this by using service, rather than technology, as the basis of applications.&lt;br /&gt;&lt;br /&gt;However, SOA based application development introduces new challenges in testing of applications built on top of them. By building applications based on loosely coupled services, the various phases of testing are required to address function as well as interaction complexities. Testers are required to wear additional hats, including the ability to bring in business analyst and system engineering into the testing process. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/447922878613612109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/447922878613612109' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/447922878613612109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/447922878613612109'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2008/05/traditional-vs-soa-testing.html' title='Traditional Vs SOA testing'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgrzIngE_0SOlYCJvP8k_dC6aOlrWgqDPsXEcVm1SgOr-Sn18HW_xbK2U2bEiATRzV2B36oYaqA2uesgSqb5YQc_Cm72RzkRWZlpfFmxN0udL6gwWEnPEK2r7nedpjTaPVxF7Td4sTxSY/s72-c/traditonal+vs+soa.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-5867446475614143112</id><published>2008-05-11T07:10:00.000-07:00</published><updated>2008-05-24T08:10:37.865-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mobile testing"/><title type='text'>Testing of mobile based applications ?</title><content type='html'>Currently in the testing industry, there are very less tools which are available in the industry for performing mobile based testing. Also, industry available tools works based on the simulator, Optical character recognition (OCR) and is not effective enough for today’s business applications. Looking at the current and future trend, we will have lot of applications which are customized to mobile based applications and would require an extensive testing.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Having this situation, there will be a great demand for mobile application testing tools, which can effectively recognize mobile based controls and perform validations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From my research i also understand that ,there are different kinds of python interpreters and libraries available which runs on different mobile platforms.Also there are python versions for different embedded devices, palm based devices and linux- arm based devices.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Have you ever experienced such a kind of tool, which can recognize mobile based controls and perform validations.?</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/5867446475614143112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/5867446475614143112' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5867446475614143112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/5867446475614143112'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2008/05/mobile-based-application-testing.html' title='Testing of mobile based applications ?'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1546952687504887828.post-2068620498948798551</id><published>2008-05-05T04:50:00.000-07:00</published><updated>2008-05-24T08:37:50.813-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Data Integration Testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Test Automation"/><title type='text'>SSIS - Data Integration Testing Tool</title><content type='html'>In today&#39;s corporate world, data is spread across multiple data sources (ex: DB2, Oracle, Sybase etc) and business users wish to generate types of business reports from a single source, no matter how the data is distributed. This scenario calls for data integration from multiple data sources and demands for new pertinent technical challenges:&lt;br /&gt;a) Data sources with different formats and organized in structured, semi-structured, and unstructured data.&lt;br /&gt;b) Huge data volumes and data populated from source systems arriving at different times.&lt;br /&gt;c) Data quality and transforming the data into a format that is meaningful to business analysts.&lt;br /&gt;&lt;br /&gt;Microsoft SQL Server Integration Services (SSIS) package enables developers to address the business users need. However testing of these packages introduces new challenges in testing. This scenario calls for the following needs:a) How do we validate complex sql queries?b) How do we ensure data workflow validation?c) How do we validate multiple data validation checkpoints?d) How do we ensure data correctness between the source and target, with millions of records?e) How do we approach continuous testing?&lt;br /&gt;&lt;br /&gt;Recommended validation focus areas for this includes :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Business rules validations and Data correctness &lt;/li&gt;&lt;li&gt;Validate containers and tasks inside the SSIS packages from a functional perspective&lt;/li&gt;&lt;li&gt;Validate usage of relevant field and table names, based on business rules&lt;/li&gt;&lt;li&gt;Validate relevant column mapping between the source and the target&lt;/li&gt;&lt;li&gt;Validate data truncation and data types between source and target&lt;/li&gt;&lt;li&gt;Check for duplicate records&lt;/li&gt;&lt;li&gt;Validate row count between the source and target&lt;/li&gt;&lt;li&gt;Validat data correctness between the source and target&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;From a testing perspective, we must be able act upon these focus areas using both manual and automated testing. &lt;/p&gt;&lt;p&gt;Manual Testing:&lt;/p&gt;&lt;p&gt;List of functional and business requirements for each individual task needs to be identified and listed. SQL scripts present in the individual task needs to be validated against the functional and business requirements. SQL queries validation for appropriate field name, appropriate joins, relevant column conversion, column type-casting and relevant table names. &lt;/p&gt;&lt;p&gt;Test Automation: &lt;/p&gt;&lt;p&gt;Using test libraries , we can validate the structure of the data and data correctness. Based on the needs , i have created a test automation tool named &quot;SSISTProbe&quot;. This tool works on the philosophy of XML tag based test automation approach. Some of key features of this tool is:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Built-in intelligence, which executes relevant test actions based on the user XML tags&lt;/li&gt;&lt;li&gt;COM based tasks and component execution , helps to execute tests in a non-UI environment&lt;/li&gt;&lt;li&gt;Listeners to handle extraction of huge amount of data&lt;/li&gt;&lt;li&gt;Data comparsion API&#39;s, to compare billions of records&lt;/li&gt;&lt;li&gt;Multiple execution checkpoint support, which helps in enabling checkpoints in packages, databases, logs etc&lt;/li&gt;&lt;/ul&gt;This tool is open-sourced and the hompage url is &lt;a href=&quot;http://www.codeplex.com/SSISTProbe&quot;&gt;http://www.codeplex.com/SSISTProbe&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://solutionpulse.blogspot.com/feeds/2068620498948798551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1546952687504887828/2068620498948798551' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2068620498948798551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1546952687504887828/posts/default/2068620498948798551'/><link rel='alternate' type='text/html' href='http://solutionpulse.blogspot.com/2008/05/ssis-data-integration-testing-tool.html' title='SSIS - Data Integration Testing Tool'/><author><name>Sathyan S Nair</name><uri>http://www.blogger.com/profile/16743116911867542224</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>