{"id":424,"date":"2009-08-03T18:29:49","date_gmt":"2009-08-03T23:29:49","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=424"},"modified":"2011-07-06T09:58:25","modified_gmt":"2011-07-06T14:58:25","slug":"are-you-actually-using-oracle-partitioning","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2009\/08\/03\/are-you-actually-using-oracle-partitioning\/","title":{"rendered":"Are you actually *using* Oracle partitioning?"},"content":{"rendered":"<p>Partitioning is sometimes sold as the panacea to all performance problems.  Anyone who has added local indexes on a column other than the one on which the table was partitioned quickly finds out this isn&#8217;t always the case.<\/p>\n<p>Keep in mind that partitioning is not only about improving performance, but also increasing availability and manageability.<\/p>\n<p>I came up with what is below to run across our databases and determine if we were actually using it, and where.  It is an expensive option ($11.5K US per processor), so if you&#8217;re not using it, why pay for it?<\/p>\n<pre lang=\"sql\" line=\"1\">\r\nselect *\r\n  from (select dhss.sql_id,\r\n               object_name,\r\n               dbms_lob.substr(sql_text,2000,1),\r\n               sum(executions_delta) execs,\r\n               operation,\r\n               options\r\n          from dba_hist_sql_plan dhsp,\r\n               dba_hist_sqlstat dhss,\r\n               dba_hist_sqltext dhst\r\n          where dhsp.sql_id = dhss.sql_id\r\n            and dhst.sql_id = dhss.sql_id\r\n            and operation like '%PARTITION%'\r\n            and options like '%SINGLE%'\r\n          group by dhss.sql_id,\r\n                   dbms_lob.substr(sql_text,2000,1),\r\n                   operation,\r\n                   object_name,\r\n                   options\r\n          order by 4 desc)\r\n  where rownum <= 10000;\r\n<\/pre>\n<p>In general, you want to focus on the ones that have an OPTIONS value of SINGLE.  This indicates partition pruning, which is where partitioning really shines from a performance perspective.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Partitioning is sometimes sold as the panacea to all performance problems. Anyone who has added local indexes on a column other than the one on which the table was partitioned quickly finds out this isn&#8217;t always the case. Keep in&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2009\/08\/03\/are-you-actually-using-oracle-partitioning\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,22],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/424"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":13,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":942,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/424\/revisions\/942"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}