<?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: index statistic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755977#M327503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Index is not generated automatically in SAP. If you have created the Index you need to generate/populate them. Try populating the Index and it will pick up the first index for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Guru&lt;/P&gt;&lt;P&gt;Reward points for helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Dec 2006 18:23:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-12T18:23:12Z</dc:date>
    <item>
      <title>index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755976#M327502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use SAP on Oracle an i got a problem with an index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Table looks like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MANDT		CLNT(3)   Primary Key
Gsber		CHAR(4)   Primary Key
ItemID 		CHAR(38)  Primary Key
OrderID		NUMC(38)
Timestamp    	NUMC(14)
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a few indexes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index1 - ( Mandt Gsber OrderID )&lt;/P&gt;&lt;P&gt;Index2 - ( Mandt Gsber Timestamp )&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now whenever i do a select like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM mytable WHERE gsber = xx AND orderid = yy AND timestamp = zz&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the index2 is taken, ignoring that index1 is much faster beacuse for any orderid there are max 4 entrys but for for any timestamp there are really lot of...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i had a look for the statistics and found this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    NONUNIQUE  Index1          
    Column Name                     #Distinct       
    MANDT                                          2
    GSBER                                         29
    ORDERID                                        3
                                                                                NONUNIQUE  Index2                
    Column Name                     #Distinct       
    MANDT                                          2
    GSBER                                         29
    TIMESTAMP                                 39.394
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand distinct means diffrent rows...?!&lt;/P&gt;&lt;P&gt;So first index statistics are wrong, because i have much more distinct entrys.&lt;/P&gt;&lt;P&gt;I started table anlyse but same values still...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want to use HINT in my select statements!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea why statistics are wrong?&lt;/P&gt;&lt;P&gt;Maybe problem with numc(38) in index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replies and ideas!&lt;/P&gt;&lt;P&gt;Benjamin Garn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 15:50:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755976#M327502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T15:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755977#M327503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Index is not generated automatically in SAP. If you have created the Index you need to generate/populate them. Try populating the Index and it will pick up the first index for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Guru&lt;/P&gt;&lt;P&gt;Reward points for helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 18:23:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755977#M327503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-12T18:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755978#M327504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run report RSANAORA to regenerate index.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2006 18:54:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755978#M327504</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-12-12T18:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755979#M327505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is transaction DB20, where you can see last run of statistics update (for a specific table) and trigger a new run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 13:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755979#M327505</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2006-12-13T13:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755980#M327506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for answers, but as i told u: Rebuild of statistics dont help. There is still the same wrong value in it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 15:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755980#M327506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T15:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755981#M327507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might get some ideas from SAP note 588668.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 16:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755981#M327507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T16:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: index statistic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755982#M327508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this note contained a link to note 365480 which pointed out my problem.&lt;/P&gt;&lt;P&gt;That's what i needed!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Col was N(38) --&amp;gt; Varchar2(38) on Oracle.&lt;/P&gt;&lt;P&gt;Only first 32 characters are used for statistic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 08:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index-statistic/m-p/1755982#M327508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T08:25:12Z</dc:date>
    </item>
  </channel>
</rss>

