<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Density nonsense in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936004#M805510</link>
    <description>Hello Jean-Luc,&lt;BR /&gt;&lt;BR /&gt;The table is compressed. In order to get the best compression we have to sort the staging table before making direct path insert. &lt;BR /&gt;Index maintenance is a cost I'm not willing to pay if it can be avoided (unusable + DBMS_PCLXUTIL is not an option).&lt;BR /&gt;&lt;BR /&gt;1) There 4 other indexes on table&lt;BR /&gt;2) One specific BUSINESS_UNIT represents 97% of the data ... and 97% of the query ;) So the index wouldn't be of much help here.&lt;BR /&gt;&lt;BR /&gt;--&amp;gt; how do you interpret the statistics ? That was my point.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Oct 2005 10:05:50 GMT</pubDate>
    <dc:creator>Nicolas Dumeige</dc:creator>
    <dc:date>2005-10-24T10:05:50Z</dc:date>
    <item>
      <title>Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936001#M805507</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;On DSS, large table 840 000 000 records.&lt;BR /&gt;&lt;BR /&gt;I know that there is 2 distinct value for the field BUSINESS_UNIT reparted on a 93% / 7% basis.&lt;BR /&gt;&lt;BR /&gt;Histograms have been calculated with &lt;BR /&gt;execute dbms_stats.gather_table_stats(&lt;BR /&gt; ownname =&amp;gt; user,&lt;BR /&gt; tabname =&amp;gt; 'T1', &lt;BR /&gt; granularity=&amp;gt;'GLOBAL', &lt;BR /&gt; estimate_percent =&amp;gt; 0.05,&lt;BR /&gt; block_sample =&amp;gt; TRUE,&lt;BR /&gt; method_opt =&amp;gt; 'FOR COLUMNS BUSINESS_UNIT SIZE 2', &lt;BR /&gt; degree =&amp;gt; 6);&lt;BR /&gt;&lt;BR /&gt;select TABLE_NAME,COLUMN_NAME,DENSITY &lt;BR /&gt;from USER_TAB_COL_STATISTICS &lt;BR /&gt;where table_name='T1' &lt;BR /&gt;and column_name='BUSINESS_UNIT';&lt;BR /&gt;&lt;BR /&gt;TA COLUMN_NAME                                           DENSITY&lt;BR /&gt;-- ------------------------------ ------------------------------&lt;BR /&gt;T1 BUSINESS_UNIT                       .000000000616598840794179&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; density *  num_rows&lt;BR /&gt;SQL&amp;gt; select 6.1660E-10 * 842276500 from dual;&lt;BR /&gt;&lt;BR /&gt;     6.1660E-10*842276500&lt;BR /&gt;-------------------------&lt;BR /&gt;              .5193476899&lt;BR /&gt;&lt;BR /&gt;Metalink :&lt;BR /&gt;The density is expressed as a decimal number between 0 and 1. &lt;BR /&gt;Values close to 1 indicate that this column is unselective &lt;BR /&gt;Values close to 0 indicate that this column is highly selective &lt;BR /&gt;The more selective a column, the less rows are likely to be returned by a query referencing this column in its predicate list.&lt;BR /&gt;&lt;BR /&gt;I don't get it ?!? &lt;BR /&gt;The field seems to be very selective according to this statistic, but in fact, it is not. Giving a certain value, user get 97% of all records !&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select * &lt;BR /&gt;from user_tab_histograms &lt;BR /&gt;where table_name='T1' &lt;BR /&gt;and column_name='BUSINESS_UNIT';&lt;BR /&gt;&lt;BR /&gt;TABLE_NAME                     COLUMN_NAME     ENDPOINT_NUMBER ENDPOINT_VALUE ENDPOINT_ACTUAL_VALU&lt;BR /&gt;------------------------------ --------------- --------------- -------------- --------------------&lt;BR /&gt;T1                        BUSINESS_UNIT              7269     3.6963E+35&lt;BR /&gt;TMEURST                        BUSINESS_UNIT              8109     3.8002E+35&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any insight, guess, idea welcomed.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Mon, 24 Oct 2005 09:31:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936001#M805507</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T09:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936002#M805508</link>
      <description>And this is related to HPUX forum how?&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Mon, 24 Oct 2005 09:38:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936002#M805508</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-10-24T09:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936003#M805509</link>
      <description>Hi Nicolas&lt;BR /&gt;&lt;BR /&gt;Welcome back !&lt;BR /&gt;&lt;BR /&gt;As you only have 2 values, why not using bitmap index ?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Mon, 24 Oct 2005 09:44:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936003#M805509</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-10-24T09:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936004#M805510</link>
      <description>Hello Jean-Luc,&lt;BR /&gt;&lt;BR /&gt;The table is compressed. In order to get the best compression we have to sort the staging table before making direct path insert. &lt;BR /&gt;Index maintenance is a cost I'm not willing to pay if it can be avoided (unusable + DBMS_PCLXUTIL is not an option).&lt;BR /&gt;&lt;BR /&gt;1) There 4 other indexes on table&lt;BR /&gt;2) One specific BUSINESS_UNIT represents 97% of the data ... and 97% of the query ;) So the index wouldn't be of much help here.&lt;BR /&gt;&lt;BR /&gt;--&amp;gt; how do you interpret the statistics ? That was my point.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 10:05:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936004#M805510</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T10:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936005#M805511</link>
      <description>Rodney,&lt;BR /&gt;&lt;BR /&gt;This is a database question in a the "Databases category" thread ... so what's with you ???</description>
      <pubDate>Mon, 24 Oct 2005 10:09:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936005#M805511</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T10:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936006#M805512</link>
      <description>Hi Nicolas,&lt;BR /&gt;&lt;BR /&gt;"I know that there is 2 distinct value for the field BUSINESS_UNIT reparted on a 93% / 7% basis."&lt;BR /&gt;&lt;BR /&gt;So you have 840,000,000 * 0.93 = 781,200,000 rows with one value and 840,000,000 * 0.07 = 58,800,000 rows with another value?&lt;BR /&gt;&lt;BR /&gt;Maybe you should consider creating another table (MT1?) only with those 2 rows that would be referenced by by a table T1 Foreign Key:&lt;BR /&gt;&lt;BR /&gt;create table MT1 (&lt;BR /&gt;MT1_ID NUMBER NOT NULL,&lt;BR /&gt;BUSINESS_UNIT ...)&lt;BR /&gt;&lt;BR /&gt;You'll need to recreate table T1 (saving all rows to a T1_TEMP temporary table, re-creating T1 and re-loading records from T1_TEMP with MT1_ID but without the BUSINESS_UNIT)...&lt;BR /&gt;&lt;BR /&gt;That's just an ideia...&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Mon, 24 Oct 2005 10:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936006#M805512</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-10-24T10:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936007#M805513</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;Thanks for you proposition but I fail to understand the point a rebuild the table ... beside loosing a saturday ;)&lt;BR /&gt;&lt;BR /&gt;Again, my question is a on the interpretation of the Oracle stat.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 10:26:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936007#M805513</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T10:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936008#M805514</link>
      <description>Nicolas,&lt;BR /&gt;&lt;BR /&gt;My point is the same as Oracle point when they created those 2 tables (for example) for Inventory:&lt;BR /&gt;&lt;BR /&gt;MTL_MATERIAL_TRANSACTIONS&lt;BR /&gt;MTL_SECONDARY_INVENTORIES&lt;BR /&gt;&lt;BR /&gt;When I want to know all the transactions of one particular inventory it is much more easy and responsive than if I hadn't the MTL_SECONDARY_INVENTORIES table and respective indexes...&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Mon, 24 Oct 2005 10:43:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936008#M805514</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-10-24T10:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936009#M805515</link>
      <description>Nicolas,&lt;BR /&gt;&lt;BR /&gt;Regarding the sample (0.05%) would you really expect getting relevant information back from Oracle ?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Mon, 24 Oct 2005 10:52:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936009#M805515</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-10-24T10:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936010#M805516</link>
      <description>Jean-Luc,&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select blocks * 0.05 from tabs where table_name='T1';&lt;BR /&gt;&lt;BR /&gt;BLOCKS*0.05&lt;BR /&gt;-----------&lt;BR /&gt;    2657667&lt;BR /&gt;&lt;BR /&gt;This is 20 GB sample, not so bad ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 11:01:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936010#M805516</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T11:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936011#M805517</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;During batch, the FK would be most painful, and again, what could possibly be the gain ? &lt;BR /&gt;&lt;BR /&gt;Referencial constraint serve no purpose here.&lt;BR /&gt;The index on a 2 value table neither.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help anyway.</description>
      <pubDate>Mon, 24 Oct 2005 11:14:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936011#M805517</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-24T11:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936012#M805518</link>
      <description>In Absolute , not so bad&lt;BR /&gt;But compared to the overall size of your table, you wonder about the density "nonsense", I would think that the sample size speaks for itself.&lt;BR /&gt;&lt;BR /&gt;The overall distribution is 93% / 7% for 840M records. But 420,000 would you expect this distribution to be uniform ?&lt;BR /&gt;&lt;BR /&gt;From the overview on histograms :&lt;BR /&gt;When to Not Use Histograms  &lt;BR /&gt;--------------------------  &lt;BR /&gt;  &lt;BR /&gt;Also, be aware that histograms, as well as all optimizer statistics, are &lt;BR /&gt;static. If the data distribution of a column changes frequently, it is &lt;BR /&gt;necessary to recompute the histogram for a given column. Histograms are not &lt;BR /&gt;useful for columns with the following characteristics:  &lt;BR /&gt;  &lt;BR /&gt;  o all predicates on the column use bind variables  &lt;BR /&gt;  o the column data is uniformly distributed  &lt;BR /&gt;  o the column is not used in WHERE clauses of queries  &lt;BR /&gt;  o the column is unique and is used only with equality predicates  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2005 11:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936012#M805518</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-10-24T11:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Density nonsense</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936013#M805519</link>
      <description>FYI : all conditions are met.&lt;BR /&gt;&lt;BR /&gt;For what I read in the statistics in 20 GB data sample, Oracle have found 0.51 record with a specific value and that is a nonesense. &lt;BR /&gt;And the histograms is studpid as weel with value of a such magnitude 10E35 !&lt;BR /&gt;&lt;BR /&gt;Furthermore, I have 4 others columns with the same kind of crap ...&lt;BR /&gt;&lt;BR /&gt;Thanks all for your post.</description>
      <pubDate>Tue, 25 Oct 2005 02:40:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/density-nonsense/m-p/4936013#M805519</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2005-10-25T02:40:30Z</dc:date>
    </item>
  </channel>
</rss>

