<?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>Question Re: Statistics on index usage in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849070#M4879913</link>
    <description>&lt;P&gt;Why do you expect such information in system tables? - As SQL Anywhere does usually optimize statements when they are executed (and not beforehand, i.e. not when views, stored procedures and the like are created/altered), it will depend on the actual queries whether an index will be used or not. You can have a look at the plans of a query to see what indexes are used.&lt;/P&gt;
&lt;P&gt;Here are some possible helpful links from the v12.0.1 docs:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/indexes-top-perform.html"&gt;Use indexes effectively &lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/workingwdb-s-3995211.html"&gt;Index Consultant&lt;/A&gt; - that may help to get general information of useful indexes based on a single query or a particular workload&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/readingaccessplans-queryoptimization.html"&gt;Query execution plans&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;
&lt;P&gt;Or do you relate to the automatically created indexes for primary, unique and foreign keys? They will be used to check for unique key values and/or existing FK values (besides the normal usage of indixes to access rows efficiently).&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2015 14:29:41 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2015-02-17T14:29:41Z</dc:date>
    <item>
      <title>Statistics on index usage</title>
      <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaq-p/13849069</link>
      <description>&lt;P&gt;v12.01.4142&lt;/P&gt;
&lt;P&gt;Are there any system tables that would help in determining which indexes are being used and which are not?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 14:07:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaq-p/13849069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-17T14:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics on index usage</title>
      <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849070#M4879913</link>
      <description>&lt;P&gt;Why do you expect such information in system tables? - As SQL Anywhere does usually optimize statements when they are executed (and not beforehand, i.e. not when views, stored procedures and the like are created/altered), it will depend on the actual queries whether an index will be used or not. You can have a look at the plans of a query to see what indexes are used.&lt;/P&gt;
&lt;P&gt;Here are some possible helpful links from the v12.0.1 docs:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/indexes-top-perform.html"&gt;Use indexes effectively &lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/workingwdb-s-3995211.html"&gt;Index Consultant&lt;/A&gt; - that may help to get general information of useful indexes based on a single query or a particular workload&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbusage/readingaccessplans-queryoptimization.html"&gt;Query execution plans&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;
&lt;P&gt;Or do you relate to the automatically created indexes for primary, unique and foreign keys? They will be used to check for unique key values and/or existing FK values (besides the normal usage of indixes to access rows efficiently).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 14:29:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849070#M4879913</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-02-17T14:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics on index usage</title>
      <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849071#M4879914</link>
      <description>&lt;P&gt;What we are trying to do is to eliminate un-needed indexes.  Ex. On one table, we have 10 indexes and we would like to drop indexes that are not being used or rarely used.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 14:55:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849071#M4879914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-17T14:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics on index usage</title>
      <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849072#M4879915</link>
      <description>&lt;P&gt;So we can assume these inxexes are "secondary" ones, i.e. not needed for PKs/UNIQUE KEYs/FKs? - Then you may use "typical queries" on this table to find out whether these indexes are used. The Index Consultant may be helpful here, too, as it can check whether secondary indexes are used or not.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 15:10:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849072#M4879915</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-02-17T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics on index usage</title>
      <link>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849073#M4879916</link>
      <description>&lt;P&gt;I can see how this would be useful; it's something that Gupta SQLBase used to have - a UseCount field in the sysindexes system table. We monitored it for indexes where the count wasn't increasing over a fairly long period and dropped them if they never got used.&lt;/P&gt;
&lt;P&gt;However I imagine that there is considerable overhead to maintain such data, and it's noticeable that later versions of SQLBase don't support it. &lt;/P&gt;
&lt;P&gt;If you have a lot of dynamic SQL, effective checking of plans for which indexes are selected for use is going to be tricky, and can change as the distribution of data changes. At the end of the day I think you are going to have to rely on your knowledge of your product and therefore they sort of queries that are going to be run, to decide what is likely to be useful. &lt;/P&gt;
&lt;P&gt;There are two things in your favour though, SQL Anywhere automatically optimizes duplicate indexes and only maintains one physical version. Second, unless you have very high transaction throughput, the actual overhead of maintaining indexes seems to be pretty low, compared with everything else going on.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 15:37:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/statistics-on-index-usage/qaa-p/13849073#M4879916</guid>
      <dc:creator>justin_willey</dc:creator>
      <dc:date>2015-02-17T15:37:37Z</dc:date>
    </item>
  </channel>
</rss>

