{"id":145,"date":"2008-12-19T20:39:00","date_gmt":"2008-12-19T22:39:00","guid":{"rendered":"http:\/\/www.soudba.com.br\/?p=145"},"modified":"2008-12-19T20:39:00","modified_gmt":"2008-12-19T22:39:00","slug":"utilizacao-dos-indices","status":"publish","type":"post","link":"https:\/\/www.soudba.com.br\/?p=145","title":{"rendered":"Utilizacao dos Indices"},"content":{"rendered":"<p>Um problema grave nas empresas \u00e9 que geralmente se criam muitos indices, para evitar isso monitore de tempos em tempos a utilizacao dos mesmos:<\/p>\n<p><a style=\"position:static;text-decoration:underline !important;\" href=\"http:\/\/dbataj.blogspot.com\/2008\/07\/oracle-monitoring-index-usage.html#\" target=\"_top\" rel=\"noopener noreferrer\">SQL<br \/><\/a>&gt; drop table test purge;Table dropped.<br \/>SQL&gt; create table test as select * from all_objects;Table created.<br \/>SQL&gt; create index testidx on test(object_id);Index created.<br \/>SQL&gt; &#8211;now enable monitoring on index<br \/>SQL&gt; alter index TESTIDX MONITORING usage;Index altered.<br \/>SQL&gt; &#8212;execute query where index is created.<br \/>SQL&gt; select count(*) from test where object_id=77204;COUNT(*)<br \/>&#8212;&#8212;&#8212;-<br \/>1<br \/>SQL&gt;&#8212;disable index mornitoring<br \/>SQL&gt; alter index TESTIDX NOmonitoring usage;Index altered.<br \/>SQL&gt; &#8212;now check the V$OBJECT_USAGE for index utilization. if we found nothing then drop index is better option<br \/>SQL&gt; select * from v$object_usage;INDEX_NAME TABLE_NAME MON USED START_MONITORIN END_MONITORING<br \/>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;- &#8212; &#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>TESTIDX TEST NO YES 07\/31\/2008 19:51:20<br \/>07\/31\/2008 19:52:04<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um problema grave nas empresas \u00e9 que geralmente se criam muitos indices, para evitar isso monitore de tempos em tempos a utilizacao dos mesmos: SQL&gt; drop table test purge;Table dropped.SQL&gt; create table test as select * from all_objects;Table created.SQL&gt; create &hellip; <a href=\"https:\/\/www.soudba.com.br\/?p=145\">Continue lendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[116,117,325],"tags":[],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-index-monitoring","category-index-usage","category-utilizacao-dos-indices"],"_links":{"self":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=145"}],"version-history":[{"count":0,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}